]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'upstream-fixes' of git://lost.foo-projects.org/~ahkok/git/netdev-2...
authorJeff Garzik <jgarzik@localhost.localdomain>
Thu, 26 Oct 2006 04:11:28 +0000 (21:11 -0700)
committerJeff Garzik <jgarzik@localhost.localdomain>
Thu, 26 Oct 2006 04:11:28 +0000 (21:11 -0700)
340 files changed:
Documentation/mips/time.README
Documentation/watchdog/src/watchdog-simple.c
Makefile
arch/arm/configs/at91rm9200dk_defconfig
arch/arm/configs/at91rm9200ek_defconfig
arch/arm/configs/csb337_defconfig
arch/arm/configs/csb637_defconfig
arch/arm/configs/kafa_defconfig
arch/arm/configs/onearm_defconfig
arch/arm/mach-ixp2000/ixdp2400.c
arch/arm/mach-lh7a40x/Kconfig
arch/avr32/Makefile
arch/avr32/boot/images/Makefile
arch/avr32/configs/atstk1002_defconfig
arch/avr32/kernel/avr32_ksyms.c
arch/avr32/kernel/kprobes.c
arch/avr32/kernel/module.c
arch/avr32/kernel/ptrace.c
arch/avr32/lib/Makefile
arch/avr32/lib/io-readsb.S [new file with mode: 0644]
arch/avr32/lib/io-writesb.S [new file with mode: 0644]
arch/avr32/mach-at32ap/hsmc.h
arch/avr32/mach-at32ap/intc.h
arch/avr32/mach-at32ap/pio.h
arch/avr32/mach-at32ap/sm.h
arch/avr32/mm/init.c
arch/avr32/mm/ioremap.c
arch/i386/Makefile
arch/i386/defconfig
arch/i386/kernel/head.S
arch/i386/kernel/nmi.c
arch/i386/kernel/process.c
arch/mips/mips-boards/generic/time.c
arch/mips/mips-boards/sim/sim_time.c
arch/mips/mm/init.c
arch/mips/mm/pgtable-32.c
arch/mips/mm/pgtable-64.c
arch/powerpc/Kconfig
arch/powerpc/boot/Makefile
arch/powerpc/configs/cell_defconfig
arch/powerpc/configs/pseries_defconfig
arch/powerpc/kernel/cputable.c
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/misc_32.S
arch/powerpc/kernel/misc_64.S
arch/powerpc/kernel/module_32.c
arch/powerpc/kernel/module_64.c
arch/powerpc/kernel/prom.c
arch/powerpc/kernel/setup_32.c
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/time.c
arch/powerpc/kernel/vdso.c
arch/powerpc/kernel/vdso32/vdso32.lds.S
arch/powerpc/kernel/vdso64/gettimeofday.S
arch/powerpc/kernel/vdso64/vdso64.lds.S
arch/powerpc/oprofile/op_model_power4.c
arch/powerpc/platforms/cell/spufs/file.c
arch/powerpc/platforms/cell/spufs/hw_ops.c
arch/powerpc/platforms/chrp/setup.c
arch/powerpc/platforms/iseries/setup.c
arch/powerpc/platforms/powermac/sleep.S
arch/powerpc/sysdev/i8259.c
arch/powerpc/sysdev/ipic.c
arch/powerpc/sysdev/qe_lib/ucc.c
arch/powerpc/sysdev/qe_lib/ucc_fast.c
arch/powerpc/sysdev/qe_lib/ucc_slow.c
arch/powerpc/sysdev/tsi108_dev.c
arch/ppc/boot/simple/relocate.S
arch/ppc/kernel/misc.S
arch/ppc/kernel/setup.c
arch/sh/boards/hp6xx/hp6xx_apm.c
arch/sh/boards/hp6xx/pm.c
arch/sh/boards/hp6xx/setup.c
arch/sh/boards/renesas/hs7751rvoip/io.c
arch/sh/boards/renesas/hs7751rvoip/irq.c
arch/sh/boards/renesas/hs7751rvoip/setup.c
arch/sh/boards/renesas/r7780rp/io.c
arch/sh/boards/renesas/r7780rp/irq.c
arch/sh/boards/renesas/r7780rp/setup.c
arch/sh/boards/renesas/rts7751r2d/io.c
arch/sh/boards/renesas/rts7751r2d/irq.c
arch/sh/boards/renesas/rts7751r2d/led.c
arch/sh/boards/renesas/rts7751r2d/setup.c
arch/sh/boards/shmin/setup.c
arch/sh/cchips/voyagergx/irq.c
arch/sh/drivers/pci/ops-r7780rp.c
arch/sh/drivers/pci/ops-rts7751r2d.c
arch/sh/kernel/cpu/irq/intc2.c
arch/sh/kernel/cpu/irq/ipr.c
arch/sh/kernel/cpu/sh3/ex.S
arch/sh/kernel/cpu/sh4/ex.S
arch/sh/kernel/cpu/sh4/setup-sh7760.c
arch/sh/kernel/cpu/sh4/setup-sh7780.c
arch/sh/kernel/irq.c
arch/sh/kernel/process.c
arch/sh/kernel/traps.c
arch/um/drivers/mconsole_kern.c
arch/um/drivers/mconsole_user.c
arch/um/include/mconsole.h
arch/x86_64/Makefile
arch/x86_64/defconfig
arch/x86_64/kernel/e820.c
arch/x86_64/kernel/early-quirks.c
arch/x86_64/kernel/entry.S
arch/x86_64/kernel/genapic_flat.c
arch/x86_64/kernel/io_apic.c
arch/x86_64/kernel/pci-calgary.c
arch/x86_64/kernel/smpboot.c
arch/x86_64/kernel/time.c
arch/x86_64/kernel/vmlinux.lds.S
arch/x86_64/mm/srat.c
arch/x86_64/pci/Makefile
drivers/ata/Kconfig
drivers/ata/ahci.c
drivers/ata/ata_piix.c
drivers/ata/libata-sff.c
drivers/atm/ambassador.c
drivers/atm/firestream.c
drivers/atm/horizon.c
drivers/atm/nicstar.c
drivers/block/cciss.c
drivers/char/agp/uninorth-agp.c
drivers/char/drm/drm_bufs.c
drivers/char/drm/drm_sysfs.c
drivers/char/drm/mga_drv.c
drivers/char/drm/r300_cmdbuf.c
drivers/char/drm/radeon_state.c
drivers/char/drm/savage_bci.c
drivers/char/drm/savage_state.c
drivers/char/moxa.c
drivers/char/rio/host.h
drivers/char/rio/rio_linux.c
drivers/char/watchdog/Kconfig
drivers/char/watchdog/Makefile
drivers/char/watchdog/at91rm9200_wdt.c [moved from drivers/char/watchdog/at91_wdt.c with 100% similarity]
drivers/char/watchdog/iTCO_wdt.c
drivers/char/watchdog/s3c2410_wdt.c
drivers/char/watchdog/smsc37b787_wdt.c [new file with mode: 0644]
drivers/char/watchdog/w83627hf_wdt.c
drivers/char/watchdog/w83697hf_wdt.c [new file with mode: 0644]
drivers/clocksource/acpi_pm.c
drivers/fc4/fc.c
drivers/fc4/fcp_impl.h
drivers/firmware/dmi_scan.c
drivers/ide/pci/generic.c
drivers/input/touchscreen/hp680_ts_input.c
drivers/md/bitmap.c
drivers/md/md.c
drivers/md/multipath.c
drivers/md/raid10.c
drivers/message/fusion/mptbase.h
drivers/message/fusion/mptfc.c
drivers/message/i2o/exec-osm.c
drivers/misc/Kconfig
drivers/misc/ioc4.c
drivers/mmc/tifm_sd.c
drivers/net/Kconfig
drivers/net/wireless/bcm43xx/bcm43xx_dma.h
drivers/s390/scsi/zfcp_def.h
drivers/s390/scsi/zfcp_scsi.c
drivers/scsi/aic7xxx/aic79xx.h
drivers/scsi/aic7xxx/aic79xx_core.c
drivers/scsi/aic7xxx/aic79xx_inline.h
drivers/scsi/aic7xxx/aic79xx_osm.c
drivers/scsi/aic7xxx/aic79xx_osm.h
drivers/scsi/aic7xxx/aic79xx_osm_pci.c
drivers/scsi/aic7xxx/aic79xx_pci.c
drivers/scsi/aic7xxx/aic79xx_proc.c
drivers/scsi/aic7xxx/aic7xxx.h
drivers/scsi/aic7xxx/aic7xxx_core.c
drivers/scsi/aic7xxx/aic7xxx_osm.c
drivers/scsi/aic7xxx/aic7xxx_osm.h
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
drivers/scsi/aic7xxx/aic7xxx_pci.c
drivers/scsi/aic7xxx/aic7xxx_proc.c
drivers/scsi/aic7xxx_old.c
drivers/scsi/aic94xx/aic94xx_hwi.h
drivers/scsi/aic94xx/aic94xx_init.c
drivers/scsi/aic94xx/aic94xx_sds.c
drivers/scsi/fdomain.c
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/scsi/libiscsi.c
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/lpfc/lpfc_ct.c
drivers/scsi/pcmcia/nsp_cs.c
drivers/scsi/pcmcia/nsp_cs.h
drivers/scsi/pcmcia/nsp_debug.c
drivers/scsi/pcmcia/nsp_message.c
drivers/scsi/psi240i.c
drivers/scsi/psi240i.h
drivers/scsi/qla1280.c
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_dbg.h
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_version.h
drivers/scsi/qla4xxx/ql4_dbg.h
drivers/scsi/qla4xxx/ql4_glbl.h
drivers/scsi/qla4xxx/ql4_mbx.c
drivers/scsi/qla4xxx/ql4_os.c
drivers/scsi/qlogicfas408.c
drivers/scsi/qlogicfas408.h
drivers/scsi/scsi_debug.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_sysfs.c
drivers/scsi/scsi_transport_iscsi.c
drivers/scsi/st.c
drivers/scsi/sun3_NCR5380.c
drivers/scsi/sun3_scsi.c
drivers/scsi/sun3_scsi.h
drivers/scsi/sun3_scsi_vme.c
drivers/scsi/tmscsim.c
drivers/video/backlight/corgi_bl.c
drivers/video/hitfb.c
drivers/video/intelfb/intelfbhw.c
fs/Kconfig
fs/dcache.c
fs/jfs/jfs_imap.c
fs/nfs/dir.c
include/asm-arm/arch-pxa/irqs.h
include/asm-avr32/atomic.h
include/asm-avr32/io.h
include/asm-generic/vmlinux.lds.h
include/asm-mips/cacheflush.h
include/asm-mips/fixmap.h
include/asm-powerpc/asm-compat.h
include/asm-powerpc/cputable.h
include/asm-powerpc/firmware.h
include/asm-powerpc/i8259.h
include/asm-powerpc/ppc_asm.h
include/asm-powerpc/prom.h
include/asm-powerpc/reg.h
include/asm-powerpc/time.h
include/asm-powerpc/timex.h
include/asm-sh/edosk7705.h [moved from include/asm-sh/edosk7705/io.h with 100% similarity]
include/asm-sh/hp6xx.h [moved from include/asm-sh/hp6xx/hp6xx.h with 100% similarity]
include/asm-sh/hp6xx/ide.h [deleted file]
include/asm-sh/hp6xx/io.h [deleted file]
include/asm-sh/hs7751rvoip.h [moved from include/asm-sh/hs7751rvoip/hs7751rvoip.h with 100% similarity]
include/asm-sh/hs7751rvoip/ide.h [deleted file]
include/asm-sh/irq-sh7780.h
include/asm-sh/irq.h
include/asm-sh/landisk/ide.h [deleted file]
include/asm-sh/processor.h
include/asm-sh/r7780rp.h [moved from include/asm-sh/r7780rp/r7780rp.h with 96% similarity]
include/asm-sh/r7780rp/ide.h [deleted file]
include/asm-sh/rts7751r2d.h [moved from include/asm-sh/rts7751r2d/rts7751r2d.h with 100% similarity]
include/asm-sh/rts7751r2d/ide.h [deleted file]
include/asm-sh/sh03/ide.h [deleted file]
include/asm-sh/shmin.h [moved from include/asm-sh/shmin/shmin.h with 100% similarity]
include/asm-sh/system.h
include/asm-sparc64/compat.h
include/asm-x86_64/hw_irq.h
include/asm-x86_64/pgtable.h
include/asm-x86_64/proto.h
include/linux/compat_ioctl.h
include/linux/device.h
include/linux/dmi.h
include/linux/libata.h
include/linux/mempolicy.h
include/linux/mmzone.h
include/linux/pci.h
include/linux/raid/bitmap.h
include/linux/raid/md_p.h
include/linux/unwind.h
include/net/dn.h
include/net/flow.h
include/net/sock.h
include/scsi/libiscsi.h
include/scsi/scsi.h
include/scsi/scsi_transport_iscsi.h
include/sound/version.h
init/main.c
kernel/unwind.c
mm/page_alloc.c
mm/slab.c
net/atm/atm_sysfs.c
net/dccp/Kconfig
net/dccp/ackvec.c
net/dccp/ackvec.h
net/dccp/ccids/Kconfig
net/dccp/ccids/ccid2.c
net/dccp/ccids/ccid3.c
net/dccp/dccp.h
net/dccp/input.c
net/dccp/ipv4.c
net/dccp/ipv6.c
net/dccp/options.c
net/ieee80211/Kconfig
net/ipv4/ipconfig.c
net/ipv6/ip6_fib.c
net/ipv6/netfilter/ip6_tables.c
net/ipv6/netfilter/ip6t_ah.c
net/ipv6/netfilter/ip6t_frag.c
net/ipv6/netfilter/ip6t_hbh.c
net/ipv6/netfilter/ip6t_rt.c
net/sched/sch_netem.c
net/xfrm/xfrm_state.c
scripts/mod/modpost.c
sound/core/control.c
sound/core/info.c
sound/isa/Kconfig
sound/isa/ad1816a/ad1816a.c
sound/isa/cmi8330.c
sound/isa/gus/interwave.c
sound/isa/opti9xx/opti92x-ad1848.c
sound/oss/sh_dac_audio.c
sound/pci/ac97/ac97_codec.c
sound/pci/ali5451/ali5451.c
sound/pci/als300.c
sound/pci/als4000.c
sound/pci/atiixp.c
sound/pci/atiixp_modem.c
sound/pci/azt3328.c
sound/pci/cmipci.c
sound/pci/cs4281.c
sound/pci/cs46xx/cs46xx_lib.c
sound/pci/cs5535audio/cs5535audio_pm.c
sound/pci/emu10k1/emu10k1.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/hda/patch_analog.c
sound/pci/hda/patch_atihdmi.c
sound/pci/hda/patch_realtek.c
sound/pci/intel8x0.c
sound/pci/intel8x0m.c
sound/pci/maestro3.c
sound/pci/nm256/nm256.c
sound/pci/riptide/riptide.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

index 69ddc5c14b7990592a1710957985fd9b6e01369b..e1304b6bc48349d518472ce94e37b581ec03d521 100644 (file)
@@ -63,7 +63,7 @@ the following functions or values:
   a) board_time_init - a function pointer.  Invoked at the beginnig of
      time_init().  It is optional.
        1. (optional) set up RTC routines
-       2. (optional) calibrate and set the mips_counter_frequency
+       2. (optional) calibrate and set the mips_hpt_frequency
 
   b) plat_timer_setup - a function pointer.  Invoked at the end of time_init()
        1. (optional) over-ride any decisions made in time_init()
@@ -72,7 +72,7 @@ the following functions or values:
 
   c) (optional) board-specific RTC routines.
 
-  d) (optional) mips_counter_frequency - It must be definied if the board
+  d) (optional) mips_hpt_frequency - It must be definied if the board
      is using CPU counter for timer interrupt or it is using fixed rate
      gettimeoffset().
 
@@ -104,7 +104,7 @@ Step 1: decide how you like to implement the time services.
      or use an exnternal timer?
 
      In order to use CPU counter register as the timer interrupt source, you
-     must know the counter speed (mips_counter_frequency).  It is usually the
+     must know the counter speed (mips_hpt_frequency).  It is usually the
      same as the CPU speed or an integral divisor of it.
 
   d) decide on whether you want to use high-level or low-level timer
@@ -121,8 +121,8 @@ Step 3: implement rtc routines, board_time_init() and plat_timer_setup()
   if needed.
 
   board_time_init() -
-       a) (optional) set up RTC routines, 
-        b) (optional) calibrate and set the mips_counter_frequency
+       a) (optional) set up RTC routines,
+        b) (optional) calibrate and set the mips_hpt_frequency
            (only needed if you intended to use fixed_rate_gettimeoffset
             or use cpu counter as timer interrupt source)
 
index 85cf17c48669d73111ff14ae8490417425da7030..47801bc7e742dd44a650322e2e8b79bbf463adcf 100644 (file)
@@ -1,4 +1,6 @@
+#include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <fcntl.h>
 
 int main(int argc, const char *argv[]) {
index 62a1343cf327c84e0afae0128b7d705c9330966b..25b35992a02c7d66e537186ea68c469433aa43c1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 19
-EXTRAVERSION =-rc2
+EXTRAVERSION =-rc3
 NAME=Avast! A bilge rat!
 
 # *DOCUMENTATION*
@@ -499,6 +499,7 @@ endif
 
 ifdef CONFIG_UNWIND_INFO
 CFLAGS         += -fasynchronous-unwind-tables
+LDFLAGS_vmlinux        += --eh-frame-hdr
 endif
 
 ifdef CONFIG_DEBUG_INFO
index c82e4667f45e25e4a9e2efb3e922b77efe6df987..b43041476e02b9c550f48d82fabf536ea06aa052 100644 (file)
@@ -577,7 +577,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
 # Watchdog Device Drivers
 #
 # CONFIG_SOFT_WATCHDOG is not set
-CONFIG_AT91_WATCHDOG=y
+CONFIG_AT91RM9200_WATCHDOG=y
 
 #
 # USB-based Watchdog Cards
index b983fc59aa42b437d42aec4af7bc6795819f23b5..d96fc8386e2f024ea7905e54a3b287a7f5244294 100644 (file)
@@ -558,7 +558,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
 # Watchdog Device Drivers
 #
 # CONFIG_SOFT_WATCHDOG is not set
-CONFIG_AT91_WATCHDOG=y
+CONFIG_AT91RM9200_WATCHDOG=y
 
 #
 # USB-based Watchdog Cards
index a2d6fd398f16b4acea1abd03b21e6f0e2e85a74d..20e68250d835196252e65d142e1b9f2e302450b8 100644 (file)
@@ -615,7 +615,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
 # Watchdog Device Drivers
 #
 # CONFIG_SOFT_WATCHDOG is not set
-CONFIG_AT91_WATCHDOG=y
+CONFIG_AT91RM9200_WATCHDOG=y
 
 #
 # USB-based Watchdog Cards
index 2a1ac6c60abc0a1ce184008f45fb0b28a2b56154..df8595ac031f15cb6a72406e965acd1f80f51eca 100644 (file)
@@ -615,7 +615,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
 # Watchdog Device Drivers
 #
 # CONFIG_SOFT_WATCHDOG is not set
-CONFIG_AT91_WATCHDOG=y
+CONFIG_AT91RM9200_WATCHDOG=y
 
 #
 # USB-based Watchdog Cards
index 54fcd75779da062a12865aeb2e795f8127ddb206..a4cdafc1548a1113abe42de978a1595a3bfc83d9 100644 (file)
@@ -560,7 +560,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
 # Watchdog Device Drivers
 #
 # CONFIG_SOFT_WATCHDOG is not set
-CONFIG_AT91_WATCHDOG=y
+CONFIG_AT91RM9200_WATCHDOG=y
 # CONFIG_NVRAM is not set
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
index cb1d94f9049ee4e447a9d5ae31840abc4289c884..9b9f2155af35fedcd8999102a3eab37ca4c59d46 100644 (file)
@@ -607,7 +607,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
 # Watchdog Device Drivers
 #
 # CONFIG_SOFT_WATCHDOG is not set
-CONFIG_AT91_WATCHDOG=y
+CONFIG_AT91RM9200_WATCHDOG=y
 
 #
 # USB-based Watchdog Cards
index 9ee63834e6031839a7776492adaa734d5a27347b..0fdd03ab36e6c4cbbcfd7da57a7cb8c4d8684c68 100644 (file)
@@ -135,11 +135,11 @@ static void ixdp2400_pci_postinit(void)
        if (ixdp2x00_master_npu()) {
                dev = pci_get_bus_and_slot(1, IXDP2400_SLAVE_ENET_DEVFN);
                pci_remove_bus_device(dev);
-               pci_dev_put(dev)
+               pci_dev_put(dev);
        } else {
                dev = pci_get_bus_and_slot(1, IXDP2400_MASTER_ENET_DEVFN);
                pci_remove_bus_device(dev);
-               pci_dev_put(dev)
+               pci_dev_put(dev);
 
                ixdp2x00_slave_pci_postinit();
        }
index 558a34f53b1c7f8bcdbce50bcad11f9f8c14b48b..147b01928a9b49b612e7ae3bf16c3d2d84f816c6 100644 (file)
@@ -14,7 +14,7 @@ config MACH_LPD7A400
        bool "LPD7A400 Card Engine"
        select ARCH_LH7A400
 #      select IDE_POLL
-       select HAS_TOUCHSCREEN_ADS7843_LH7
+#      select HAS_TOUCHSCREEN_ADS7843_LH7
        help
          Say Y here if you are using Logic Product Development's
          LPD7A400 CardEngine.  For the time being, the LPD7A400 and
@@ -24,7 +24,7 @@ config MACH_LPD7A404
        bool "LPD7A404 Card Engine"
        select ARCH_LH7A404
 #      select IDE_POLL
-       select HAS_TOUCHSCREEN_ADC_LH7
+#      select HAS_TOUCHSCREEN_ADC_LH7
        help
          Say Y here if you are using Logic Product Development's
          LPD7A404 CardEngine. For the time being, the LPD7A400 and
index cefc95a73980e7a356e714684bcbe4e4e4c1bf15..7b842e98efed40ebd1a9d7ca03900094f74ac7f0 100644 (file)
@@ -7,7 +7,7 @@
 
 # Default target when executing plain make
 .PHONY: all
-all: uImage vmlinux.elf linux.lst
+all: uImage vmlinux.elf
 
 KBUILD_DEFCONFIG       := atstk1002_defconfig
 
@@ -21,9 +21,7 @@ cpuflags-$(CONFIG_CPU_AP7000) += -mcpu=ap7000
 CFLAGS         += $(cpuflags-y)
 AFLAGS         += $(cpuflags-y)
 
-CHECKFLAGS     += -D__avr32__
-
-LIBGCC         := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
+CHECKFLAGS     += -D__avr32__ -D__BIG_ENDIAN
 
 head-$(CONFIG_LOADER_U_BOOT)           += arch/avr32/boot/u-boot/head.o
 head-y                                 += arch/avr32/kernel/head.o
@@ -32,7 +30,7 @@ core-$(CONFIG_BOARD_ATSTK1000)                += arch/avr32/boards/atstk1000/
 core-$(CONFIG_LOADER_U_BOOT)           += arch/avr32/boot/u-boot/
 core-y                                 += arch/avr32/kernel/
 core-y                                 += arch/avr32/mm/
-libs-y                                 += arch/avr32/lib/ #$(LIBGCC)
+libs-y                                 += arch/avr32/lib/
 
 archincdir-$(CONFIG_PLATFORM_AT32AP)   := arch-at32ap
 
@@ -48,6 +46,8 @@ endif
 
 archprepare: include/asm-avr32/.arch
 
+CLEAN_FILES += include/asm-avr32/.arch include/asm-avr32/arch
+
 BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
 
 .PHONY: $(BOOT_TARGETS) install
@@ -71,14 +71,19 @@ vmlinux.elf vmlinux.bin uImage.srec uImage vmlinux.cso: vmlinux
 install: vmlinux
        $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
 
-linux.s: vmlinux
+vmlinux.s: vmlinux
        $(call if_changed,disasm)
 
-linux.lst: vmlinux
+vmlinux.lst: vmlinux
        $(call if_changed,listing)
 
+CLEAN_FILES += vmlinux.s vmlinux.lst
+
+archclean:
+       $(Q)$(MAKE) $(clean)=$(boot)
+
 define archhelp
   @echo '* vmlinux.elf         - ELF image with load address 0'
   @echo '  vmlinux.cso         - PathFinder CSO image'
-  @echo '  uImage              - Create a bootable image for U-Boot'
+  @echo '* uImage              - Create a bootable image for U-Boot'
 endef
index ccd74eeecec38eca019d543800da2914bcd45c3e..219720a47bf93772c77d8a57787fe46812bbb006 100644 (file)
@@ -37,14 +37,12 @@ OBJCOPYFLAGS_vmlinux.elf := --change-section-lma .text-0x80000000 \
                            --change-section-lma .data-0x80000000 \
                            --change-section-lma .init-0x80000000 \
                            --change-section-lma .bss-0x80000000 \
-                           --change-section-lma .initrd-0x80000000 \
                            --change-section-lma __param-0x80000000 \
                            --change-section-lma __ksymtab-0x80000000 \
                            --change-section-lma __ksymtab_gpl-0x80000000 \
                            --change-section-lma __kcrctab-0x80000000 \
                            --change-section-lma __kcrctab_gpl-0x80000000 \
                            --change-section-lma __ksymtab_strings-0x80000000 \
-                           --change-section-lma .got-0x80000000 \
                            --set-start 0xa0000000
 $(obj)/vmlinux.elf: vmlinux FORCE
        $(call if_changed,objcopy)
@@ -59,4 +57,4 @@ install: $(BOOTIMAGE)
        sh $(srctree)/install-kernel.sh $<
 
 # Generated files to be removed upon make clean
-clean-files    := vmlinux* uImage uImage.srec
+clean-files    := vmlinux.elf vmlinux.bin vmlinux.gz uImage uImage.srec
index 6c2c5e00dfc7ecd93113a51fc18f5175454ea737..ae92a14ef9a0200f3d36d9967b385b934feb3d92 100644 (file)
@@ -1,13 +1,14 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18-rc1
-# Tue Jul 11 12:41:36 2006
+# Linux kernel version: 2.6.19-rc2
+# Fri Oct 20 11:52:37 2006
 #
 CONFIG_AVR32=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
@@ -25,16 +26,23 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
 CONFIG_LOCALVERSION=""
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SWAP=y
-# CONFIG_SYSVIPC is not set
-# CONFIG_POSIX_MQUEUE is not set
-# CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
-# CONFIG_AUDIT is not set
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+# CONFIG_UTS_NS is not set
+CONFIG_AUDIT=y
 # CONFIG_IKCONFIG is not set
-# CONFIG_RELAY is not set
+CONFIG_RELAY=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_TASK_XACCT is not set
+CONFIG_SYSCTL=y
 CONFIG_EMBEDDED=y
+# CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -43,14 +51,15 @@ CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 # CONFIG_BASE_FULL is not set
-# CONFIG_FUTEX is not set
-# CONFIG_EPOLL is not set
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
 CONFIG_SHMEM=y
-# CONFIG_SLAB is not set
-# CONFIG_VM_EVENT_COUNTERS is not set
+CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=1
-CONFIG_SLOB=y
+# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -65,6 +74,7 @@ CONFIG_MODULE_UNLOAD=y
 #
 # Block layer
 #
+CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 
 #
@@ -166,10 +176,12 @@ CONFIG_IP_PNP_DHCP=y
 # CONFIG_INET_TUNNEL is not set
 # CONFIG_INET_XFRM_MODE_TRANSPORT is not set
 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
@@ -199,7 +211,6 @@ CONFIG_TCP_CONG_BIC=y
 # 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
 
@@ -212,7 +223,6 @@ CONFIG_TCP_CONG_BIC=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
-# CONFIG_NET_TCPPROBE is not set
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
@@ -239,7 +249,84 @@ CONFIG_STANDALONE=y
 #
 # Memory Technology Devices (MTD)
 #
-# CONFIG_MTD is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_OBSOLETE_CHIPS is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0x8000000
+CONFIG_MTD_PHYSMAP_LEN=0x0
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+
+#
+# OneNAND Flash Device Drivers
+#
+# CONFIG_MTD_ONENAND is not set
 
 #
 # Parallel port support
@@ -260,10 +347,17 @@ CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=m
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 
+#
+# Misc devices
+#
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -274,6 +368,12 @@ CONFIG_BLK_DEV_INITRD=y
 #
 # CONFIG_RAID_ATTRS is not set
 # CONFIG_SCSI is not set
+# CONFIG_SCSI_NETLINK is not set
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+# CONFIG_ATA is not set
 
 #
 # Multi-device support (RAID and LVM)
@@ -305,14 +405,11 @@ CONFIG_TUN=m
 #
 # PHY device support
 #
-# CONFIG_PHYLIB is not set
 
 #
 # Ethernet (10 or 100Mbit)
 #
-CONFIG_NET_ETHERNET=y
-CONFIG_MII=y
-CONFIG_MACB=y
+# CONFIG_NET_ETHERNET is not set
 
 #
 # Ethernet (1000 Mbit)
@@ -341,10 +438,11 @@ CONFIG_PPP=m
 CONFIG_PPP_ASYNC=m
 # CONFIG_PPP_SYNC_TTY is not set
 CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
+CONFIG_PPP_BSDCOMP=m
 # CONFIG_PPP_MPPE is not set
 # CONFIG_PPPOE is not set
 # CONFIG_SLIP is not set
+CONFIG_SLHC=m
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
@@ -417,7 +515,6 @@ CONFIG_UNIX98_PTYS=y
 # TPM devices
 #
 # CONFIG_TCG_TPM is not set
-# CONFIG_TELCLOCK is not set
 
 #
 # I2C support
@@ -427,23 +524,13 @@ CONFIG_UNIX98_PTYS=y
 #
 # SPI support
 #
-CONFIG_SPI=y
-# CONFIG_SPI_DEBUG is not set
-CONFIG_SPI_MASTER=y
-
-#
-# SPI Master Controller Drivers
-#
-CONFIG_SPI_ATMEL=m
-# CONFIG_SPI_BITBANG is not set
-
-#
-# SPI Protocol Masters
-#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
 
 #
 # Dallas's 1-wire bus
 #
+# CONFIG_W1 is not set
 
 #
 # Hardware Monitoring support
@@ -451,15 +538,10 @@ CONFIG_SPI_ATMEL=m
 # CONFIG_HWMON is not set
 # CONFIG_HWMON_VID is not set
 
-#
-# Misc devices
-#
-
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
-CONFIG_VIDEO_V4L2=y
 
 #
 # Digital Video Broadcasting Devices
@@ -470,28 +552,8 @@ CONFIG_VIDEO_V4L2=y
 # Graphics support
 #
 # CONFIG_FIRMWARE_EDID is not set
-CONFIG_FB=m
-CONFIG_FB_CFB_FILLRECT=m
-CONFIG_FB_CFB_COPYAREA=m
-CONFIG_FB_CFB_IMAGEBLIT=m
-# CONFIG_FB_MACMODES is not set
-# CONFIG_FB_BACKLIGHT is not set
-# CONFIG_FB_MODE_HELPERS is not set
-# CONFIG_FB_TILEBLITTING is not set
-CONFIG_FB_SIDSA=m
-CONFIG_FB_SIDSA_DEFAULT_BPP=24
-# CONFIG_FB_S1D13XXX is not set
-# CONFIG_FB_VIRTUAL is not set
-
-#
-# Logo configuration
-#
-# CONFIG_LOGO is not set
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
-# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
-CONFIG_LCD_CLASS_DEVICE=m
-CONFIG_LCD_DEVICE=y
-CONFIG_LCD_LTV350QV=m
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Sound
@@ -561,18 +623,21 @@ CONFIG_LCD_LTV350QV=m
 #
 # File systems
 #
-CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS=m
 # CONFIG_EXT2_FS_XATTR is not set
 # CONFIG_EXT2_FS_XIP is not set
 # CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
 # CONFIG_FS_POSIX_ACL is not set
 # CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
 CONFIG_MINIX_FS=m
-CONFIG_ROMFS_FS=m
-# CONFIG_INOTIFY is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
 # CONFIG_DNOTIFY is not set
 # CONFIG_AUTOFS_FS is not set
@@ -600,8 +665,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
 CONFIG_RAMFS=y
 CONFIG_CONFIGFS_FS=m
@@ -616,6 +683,16 @@ CONFIG_CONFIGFS_FS=m
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
@@ -626,26 +703,10 @@ CONFIG_CONFIGFS_FS=m
 #
 # Network File Systems
 #
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-# CONFIG_NFS_V3_ACL is not set
-# CONFIG_NFS_V4 is not set
-# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFS_FS is not set
 # CONFIG_NFSD is not set
-CONFIG_ROOT_NFS=y
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-CONFIG_NFS_COMMON=y
-CONFIG_SUNRPC=y
-# CONFIG_RPCSEC_GSS_KRB5 is not set
-# CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
-CONFIG_CIFS=m
-# CONFIG_CIFS_STATS is not set
-# CONFIG_CIFS_WEAK_PW_HASH is not set
-# CONFIG_CIFS_XATTR is not set
-# CONFIG_CIFS_DEBUG2 is not set
-# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
@@ -665,7 +726,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=m
 # CONFIG_NLS_CODEPAGE_737 is not set
 # CONFIG_NLS_CODEPAGE_775 is not set
-CONFIG_NLS_CODEPAGE_850=m
+# CONFIG_NLS_CODEPAGE_850 is not set
 # CONFIG_NLS_CODEPAGE_852 is not set
 # CONFIG_NLS_CODEPAGE_855 is not set
 # CONFIG_NLS_CODEPAGE_857 is not set
@@ -705,13 +766,17 @@ CONFIG_NLS_UTF8=m
 # Kernel hacking
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
-CONFIG_PRINTK_TIME=y
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_MUTEXES is not set
 # CONFIG_DEBUG_RWSEMS is not set
@@ -722,11 +787,13 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
 CONFIG_FRAME_POINTER=y
 # CONFIG_UNWIND_INFO is not set
 CONFIG_FORCED_INLINING=y
+# CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
-CONFIG_KPROBES=y
+# CONFIG_KPROBES is not set
 
 #
 # Security options
@@ -739,16 +806,14 @@ CONFIG_KPROBES=y
 #
 # CONFIG_CRYPTO is not set
 
-#
-# Hardware crypto devices
-#
-
 #
 # Library routines
 #
 CONFIG_CRC_CCITT=m
 # CONFIG_CRC16 is not set
-CONFIG_CRC32=m
+CONFIG_CRC32=y
 # CONFIG_LIBCRC32C is not set
-CONFIG_ZLIB_INFLATE=m
-CONFIG_ZLIB_DEFLATE=m
+CONFIG_AUDIT_GENERIC=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
index 04f767a272b76f554e50950cd2ce607538cc278c..372e3f8b2417737c38d3be01bcd3990d4f71967e 100644 (file)
@@ -7,6 +7,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <linux/io.h>
 #include <linux/module.h>
 
 #include <asm/checksum.h>
@@ -53,3 +54,11 @@ EXPORT_SYMBOL(find_next_zero_bit);
 EXPORT_SYMBOL(find_first_bit);
 EXPORT_SYMBOL(find_next_bit);
 EXPORT_SYMBOL(generic_find_next_zero_le_bit);
+
+/* I/O primitives (lib/io-*.S) */
+EXPORT_SYMBOL(__raw_readsb);
+EXPORT_SYMBOL(__raw_readsw);
+EXPORT_SYMBOL(__raw_readsl);
+EXPORT_SYMBOL(__raw_writesb);
+EXPORT_SYMBOL(__raw_writesw);
+EXPORT_SYMBOL(__raw_writesl);
index 6caf9e8d8080791e656225cbf06e3dc445e43d54..ca41fc1edbe1aa26711343a3fcae488899de7882 100644 (file)
@@ -109,7 +109,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
        void *addr = (void *)regs->pc;
        int ret = 0;
 
-       pr_debug("kprobe_handler: kprobe_running=%d\n",
+       pr_debug("kprobe_handler: kprobe_running=%p\n",
                 kprobe_running());
 
        /*
index dfc32f2817b6f6e11ad1b1de45eec7d8969ab592..b599eae6457601f2932bbf45f4451966307e8935 100644 (file)
@@ -263,7 +263,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
                         * value of PC.  Just subtract the value of
                         * GOT, and we're done.
                         */
-                       pr_debug("GOTPC: PC=0x%lx, got_offset=0x%lx, core=0x%p\n",
+                       pr_debug("GOTPC: PC=0x%x, got_offset=0x%lx, core=0x%p\n",
                                 relocation, module->arch.got_offset,
                                 module->module_core);
                        relocation -= ((unsigned long)module->module_core
@@ -282,7 +282,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
                            && (relocation & 0xffff0000) != 0xffff0000)
                                return reloc_overflow(module, "R_AVR32_GOT16S",
                                                      relocation);
-                       pr_debug("GOT reloc @ 0x%lx -> %lu\n",
+                       pr_debug("GOT reloc @ 0x%x -> %u\n",
                                 rel->r_offset, relocation);
                        value = *location;
                        value = ((value & 0xffff0000)
index 3c89e59029abf292820e83415ae14baa59b63749..f2e81cd7900223cc3e112fa0b1c40eeb8319ff13 100644 (file)
@@ -157,7 +157,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
        unsigned long tmp;
        int ret;
 
-       pr_debug("arch_ptrace(%ld, %ld, %#lx, %#lx)\n",
+       pr_debug("arch_ptrace(%ld, %d, %#lx, %#lx)\n",
                 request, child->pid, addr, data);
 
        pr_debug("ptrace: Enabling monitor mode...\n");
index 09ac43e40522bd0fc702b30d527f1158def1d73c..084d95bac5e75ba37bf288d713c01e11e93e902e 100644 (file)
@@ -7,4 +7,5 @@ lib-y   += strncpy_from_user.o strnlen_user.o
 lib-y  += delay.o memset.o memcpy.o findbit.o
 lib-y  += csum_partial.o csum_partial_copy_generic.o
 lib-y  += io-readsw.o io-readsl.o io-writesw.o io-writesl.o
+lib-y  += io-readsb.o io-writesb.o
 lib-y  += __avr32_lsl64.o __avr32_lsr64.o __avr32_asr64.o
diff --git a/arch/avr32/lib/io-readsb.S b/arch/avr32/lib/io-readsb.S
new file mode 100644 (file)
index 0000000..b319d5e
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2004-2006 Atmel 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.
+ */
+
+       .text
+.Lnot_word_aligned:
+1:     ld.ub   r8, r12[0]
+       sub     r10, 1
+       st.b    r11++, r8
+       reteq   r12
+       tst     r11, r9
+       brne    1b
+
+       /* fall through */
+
+       .global __raw_readsb
+       .type   __raw_readsb,@function
+__raw_readsb:
+       cp.w    r10, 0
+       mov     r9, 3
+       reteq   r12
+
+       tst     r11, r9
+       brne    .Lnot_word_aligned
+
+       sub     r10, 4
+       brlt    2f
+
+1:     ldins.b r8:t, r12[0]
+       ldins.b r8:u, r12[0]
+       ldins.b r8:l, r12[0]
+       ldins.b r8:b, r12[0]
+       st.w    r11++, r8
+       sub     r10, 4
+       brge    1b
+
+2:     sub     r10, -4
+       reteq   r12
+
+3:     ld.uh   r8, r12[0]
+       sub     r10, 1
+       st.b    r11++, r8
+       brne    3b
diff --git a/arch/avr32/lib/io-writesb.S b/arch/avr32/lib/io-writesb.S
new file mode 100644 (file)
index 0000000..b4ebaac
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2004-2006 Atmel 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.
+ */
+
+       .text
+.Lnot_word_aligned:
+1:     ld.ub   r8, r11++
+       sub     r10, 1
+       st.b    r12[0], r8
+       reteq   r12
+       tst     r11, r9
+       brne    1b
+
+       /* fall through */
+
+       .global __raw_writesb
+       .type   __raw_writesb,@function
+__raw_writesb:
+       cp.w    r10, 0
+       mov     r9, 3
+       reteq   r12
+
+       tst     r11, r9
+       brne    .Lnot_word_aligned
+
+       sub     r10, 4
+       brlt    2f
+
+1:     ld.w    r8, r11++
+       bfextu  r9, r8, 24, 8
+       st.b    r12[0], r9
+       bfextu  r9, r8, 16, 8
+       st.b    r12[0], r9
+       bfextu  r9, r8, 8, 8
+       st.b    r12[0], r9
+       st.b    r12[0], r8
+       sub     r10, 4
+       brge    1b
+
+2:     sub     r10, -4
+       reteq   r12
+
+3:     ld.ub   r8, r11++
+       sub     r10, 1
+       st.b    r12[0], r8
+       brne    3b
+
+       retal   r12
index 5681276fafdb88b801c5db9d1736a2afd6e4691a..d1d48e26e39378702eee37b4d7e148ddf76306ea 100644 (file)
 
 /* Register access macros */
 #define hsmc_readl(port,reg)                                           \
-       readl((port)->regs + HSMC_##reg)
+       __raw_readl((port)->regs + HSMC_##reg)
 #define hsmc_writel(port,reg,value)                                    \
-       writel((value), (port)->regs + HSMC_##reg)
+       __raw_writel((value), (port)->regs + HSMC_##reg)
 
 #endif /* __ASM_AVR32_HSMC_H__ */
index d289ca2fff13bf9de671527ce6348f8eb92a7b49..4d3664e43a8e605218bd23dafc72d8821d7c8b68 100644 (file)
 #define INTC_MKBF(name, value)       (((value) & ((1 << INTC_##name##_SIZE) - 1)) << INTC_##name##_OFFSET)
 #define INTC_GETBF(name, value)      (((value) >> INTC_##name##_OFFSET) & ((1 << INTC_##name##_SIZE) - 1))
 
-#define intc_readl(port,reg)         readl((port)->regs + INTC_##reg)
-#define intc_writel(port,reg,value)  writel((value), (port)->regs + INTC_##reg)
+#define intc_readl(port,reg)                                   \
+       __raw_readl((port)->regs + INTC_##reg)
+#define intc_writel(port,reg,value)                            \
+       __raw_writel((value), (port)->regs + INTC_##reg)
 
 #endif /* __ASM_AVR32_PERIHP_INTC_H__ */
index cfea123515993bb9dc0e3392d771c24303501dd9..50fa3aca32c58c23f471469e2def0c02767b2491 100644 (file)
 #define PIO_BFINS(name,value,old)              (((old) & ~(((1 << PIO_##name##_SIZE) - 1) << PIO_##name##_OFFSET)) | PIO_BF(name,value))
 
 /* Register access macros */
-#define pio_readl(port,reg)                    readl((port)->regs + PIO_##reg)
-#define pio_writel(port,reg,value)             writel((value), (port)->regs + PIO_##reg)
+#define pio_readl(port,reg)                                    \
+       __raw_readl((port)->regs + PIO_##reg)
+#define pio_writel(port,reg,value)                             \
+       __raw_writel((value), (port)->regs + PIO_##reg)
 
 void at32_init_pio(struct platform_device *pdev);
 
index 27565822ae2a3e08590447567434c8f9ee7b797a..cad02b512bcb68f4d65cd4e41d5ce5206d1b9896 100644 (file)
 #define SM_BFINS(name,value,old)                (((old) & ~(((1 << SM_##name##_SIZE) - 1) << SM_##name##_OFFSET)) | SM_BF(name,value))
 
 /* Register access macros */
-#define sm_readl(port,reg)                      readl((port)->regs + SM_##reg)
-#define sm_writel(port,reg,value)               writel((value), (port)->regs + SM_##reg)
+#define sm_readl(port,reg)                                     \
+       __raw_readl((port)->regs + SM_##reg)
+#define sm_writel(port,reg,value)                              \
+       __raw_writel((value), (port)->regs + SM_##reg)
 
 #endif /* __ASM_AVR32_SM_H__ */
index 3e6c4103980855281164ea4acdfe945fa6819b85..70da6894acc1dbfbde9d4501115c6d6eb26ea135 100644 (file)
@@ -206,7 +206,7 @@ void __init setup_bootmem(void)
 
        if (mem_ramdisk) {
 #ifdef CONFIG_BLK_DEV_INITRD
-               initrd_start = __va(mem_ramdisk->addr);
+               initrd_start = (unsigned long)__va(mem_ramdisk->addr);
                initrd_end = initrd_start + mem_ramdisk->size;
 
                print_memory_map("RAMDISK images", mem_ramdisk);
index 8cfec65e37f76f72ac101aaacc1315affe1da913..3437c82434ac9ec189742862d1ce996223feabf4 100644 (file)
@@ -77,6 +77,8 @@ void __iounmap(void __iomem *addr)
 
        if ((unsigned long)addr >= P4SEG)
                return;
+       if (PXSEG(addr) == P2SEG)
+               return;
 
        p = remove_vm_area((void *)(PAGE_MASK & (unsigned long __force)addr));
        if (unlikely(!p)) {
index 7cc0b189b82baa80d83d813a11ec256243a6cb0c..0677908dfa0600dd3f5cf9e315d4ad62154aca3f 100644 (file)
@@ -42,6 +42,10 @@ cflags-$(CONFIG_REGPARM) += -mregparm=3
 # temporary until string.h is fixed
 cflags-y += -ffreestanding
 
+# this works around some issues with generating unwind tables in older gccs
+# newer gccs do it by default
+cflags-y += -maccumulate-outgoing-args
+
 # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
 # a lot more stack due to the lack of sharing of stacklots:
 CFLAGS                         += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;)
@@ -51,8 +55,8 @@ cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
 AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
 
 # is .cfi_signal_frame supported too?
-cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
-AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
+cflags-y += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
+AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
 
 CFLAGS += $(cflags-y)
 
index 60c0c02574f08c7edad60a99e0125d5c96a8539a..97aacd6bd7d810a85c15f9d96811167b5b680165 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.19-rc1
-# Thu Oct  5 13:04:53 2006
+# Linux kernel version: 2.6.19-rc2-git4
+# Sat Oct 21 03:38:56 2006
 #
 CONFIG_X86_32=y
 CONFIG_GENERIC_TIME=y
@@ -380,8 +380,8 @@ CONFIG_INET6_XFRM_MODE_TRANSPORT=y
 CONFIG_INET6_XFRM_MODE_TUNNEL=y
 # CONFIG_INET6_XFRM_MODE_BEET is not set
 # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=y
 # CONFIG_IPV6_TUNNEL is not set
-# CONFIG_IPV6_SUBTREES is not set
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
@@ -482,6 +482,13 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 
+#
+# Misc devices
+#
+# CONFIG_IBM_ASM is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -1024,6 +1031,7 @@ CONFIG_HANGCHECK_TIMER=y
 #
 # Dallas's 1-wire bus
 #
+# CONFIG_W1 is not set
 
 #
 # Hardware Monitoring support
@@ -1031,12 +1039,6 @@ CONFIG_HANGCHECK_TIMER=y
 # CONFIG_HWMON is not set
 # CONFIG_HWMON_VID is not set
 
-#
-# Misc devices
-#
-# CONFIG_IBM_ASM is not set
-# CONFIG_TIFM_CORE is not set
-
 #
 # Multimedia devices
 #
@@ -1169,7 +1171,6 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
-# CONFIG_USB_TRANCEVIBRATOR is not set
 
 #
 # USB Imaging devices
@@ -1215,6 +1216,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -1284,6 +1286,7 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 CONFIG_EXT3_FS_POSIX_ACL=y
 # CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
@@ -1307,6 +1310,7 @@ CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 CONFIG_AUTOFS4_FS=y
 # CONFIG_FUSE_FS is not set
+CONFIG_GENERIC_ACL=y
 
 #
 # CD-ROM/DVD Filesystems
@@ -1384,7 +1388,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
 # CONFIG_9P_FS is not set
-CONFIG_GENERIC_ACL=y
 
 #
 # Partition Types
@@ -1436,10 +1439,6 @@ CONFIG_NLS_ISO8859_15=y
 # CONFIG_NLS_KOI8_U is not set
 CONFIG_NLS_UTF8=y
 
-#
-# Distributed Lock Manager
-#
-
 #
 # Instrumentation Support
 #
@@ -1480,6 +1479,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_UNWIND_INFO=y
 CONFIG_STACK_UNWIND=y
 # CONFIG_FORCED_INLINING is not set
+# CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_LKDTM is not set
 CONFIG_EARLY_PRINTK=y
index be9d883c62ce0302995b56c830530670902a7fe6..ca31f18d277c5487e3afab809783f9d79beb4fbe 100644 (file)
@@ -317,7 +317,7 @@ is386:      movl $2,%ecx            # set MP
        movl %eax,%gs
        lldt %ax
        cld                     # gcc2 wants the direction flag cleared at all times
-       pushl %eax              # fake return address
+       pushl $0                # fake return address for unwinder
 #ifdef CONFIG_SMP
        movb ready, %cl
        movb $1, ready
index 3e8e3adb04896243323922cc0dadf3b94429c0c1..eaafe233a5da83f4abbb2c17e670b8a46fa4edaa 100644 (file)
@@ -219,11 +219,11 @@ static int __init check_nmi_watchdog(void)
        int cpu;
 
        /* Enable NMI watchdog for newer systems.
-           Actually it should be safe for most systems before 2004 too except
-          for some IBM systems that corrupt registers when NMI happens
-          during SMM. Unfortunately we don't have more exact information
-          on these and use this coarse check. */
-       if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004)
+          Probably safe on most older systems too, but let's be careful.
+          IBM ThinkPads use INT10 inside SMM and that allows early NMI inside SMM
+          which hangs the system. Disable watchdog for all thinkpads */
+       if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004 &&
+               !dmi_name_in_vendors("ThinkPad"))
                nmi_watchdog = NMI_LOCAL_APIC;
 
        if ((nmi_watchdog == NMI_NONE) || (nmi_watchdog == NMI_DEFAULT))
index 57d375900afb0643cf64f10b52ed49462131d001..1e1fa3e391a3889ec822c869c19bd9feb76e5e36 100644 (file)
@@ -336,7 +336,6 @@ extern void kernel_thread_helper(void);
 int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 {
        struct pt_regs regs;
-       int err;
 
        memset(&regs, 0, sizeof(regs));
 
@@ -351,10 +350,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
        regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2;
 
        /* Ok, create the new process.. */
-       err = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
-       if (err == 0) /* terminate kernel stack */
-               task_pt_regs(current)->eip = 0;
-       return err;
+       return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
 }
 EXPORT_SYMBOL(kernel_thread);
 
index 6f8a9fe7c1e3e52d569ff75fd9cdba44ec8d6790..c079e2ae02a1d0484884005f779f6d5e323815e0 100644 (file)
@@ -187,7 +187,7 @@ out:
 }
 
 /*
- * Estimate CPU frequency.  Sets mips_counter_frequency as a side-effect
+ * Estimate CPU frequency.  Sets mips_hpt_frequency as a side-effect
  */
 static unsigned int __init estimate_cpu_frequency(void)
 {
index c566b9bd0427e64deb4182e188280edc87f8eae6..24a4ed00cc0a0f39786a5e6749dadff0aee6296d 100644 (file)
@@ -102,7 +102,7 @@ irqreturn_t sim_timer_interrupt(int irq, void *dev_id)
 
 
 /*
- * Estimate CPU frequency.  Sets mips_counter_frequency as a side-effect
+ * Estimate CPU frequency.  Sets mips_hpt_frequency as a side-effect
  */
 static unsigned int __init estimate_cpu_frequency(void)
 {
index 88b72c9a84957f2ac787ccf83fa46c4dbb0818d2..2de4d3c367a2c2da9adb6bcf29b5105c46c01f78 100644 (file)
 #include <asm/cachectl.h>
 #include <asm/cpu.h>
 #include <asm/dma.h>
+#include <asm/kmap_types.h>
 #include <asm/mmu_context.h>
 #include <asm/sections.h>
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/tlb.h>
+#include <asm/fixmap.h>
+
+/* Atomicity and interruptability */
+#ifdef CONFIG_MIPS_MT_SMTC
+
+#include <asm/mipsmtregs.h>
+
+#define ENTER_CRITICAL(flags) \
+       { \
+       unsigned int mvpflags; \
+       local_irq_save(flags);\
+       mvpflags = dvpe()
+#define EXIT_CRITICAL(flags) \
+       evpe(mvpflags); \
+       local_irq_restore(flags); \
+       }
+#else
+
+#define ENTER_CRITICAL(flags) local_irq_save(flags)
+#define EXIT_CRITICAL(flags) local_irq_restore(flags)
+
+#endif /* CONFIG_MIPS_MT_SMTC */
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
@@ -80,13 +103,142 @@ unsigned long setup_zero_pages(void)
        return 1UL << order;
 }
 
-#ifdef CONFIG_HIGHMEM
-pte_t *kmap_pte;
-pgprot_t kmap_prot;
+/*
+ * These are almost like kmap_atomic / kunmap_atmic except they take an
+ * additional address argument as the hint.
+ */
 
 #define kmap_get_fixmap_pte(vaddr)                                     \
        pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr))
 
+#ifdef CONFIG_MIPS_MT_SMTC
+static pte_t *kmap_coherent_pte;
+static void __init kmap_coherent_init(void)
+{
+       unsigned long vaddr;
+
+       /* cache the first coherent kmap pte */
+       vaddr = __fix_to_virt(FIX_CMAP_BEGIN);
+       kmap_coherent_pte = kmap_get_fixmap_pte(vaddr);
+}
+#else
+static inline void kmap_coherent_init(void) {}
+#endif
+
+static inline void *kmap_coherent(struct page *page, unsigned long addr)
+{
+       enum fixed_addresses idx;
+       unsigned long vaddr, flags, entrylo;
+       unsigned long old_ctx;
+       pte_t pte;
+       int tlbidx;
+
+       inc_preempt_count();
+       idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1);
+#ifdef CONFIG_MIPS_MT_SMTC
+       idx += FIX_N_COLOURS * smp_processor_id();
+#endif
+       vaddr = __fix_to_virt(FIX_CMAP_END - idx);
+       pte = mk_pte(page, PAGE_KERNEL);
+#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1)
+       entrylo = pte.pte_high;
+#else
+       entrylo = pte_val(pte) >> 6;
+#endif
+
+       ENTER_CRITICAL(flags);
+       old_ctx = read_c0_entryhi();
+       write_c0_entryhi(vaddr & (PAGE_MASK << 1));
+       write_c0_entrylo0(entrylo);
+       write_c0_entrylo1(entrylo);
+#ifdef CONFIG_MIPS_MT_SMTC
+       set_pte(kmap_coherent_pte - (FIX_CMAP_END - idx), pte);
+       /* preload TLB instead of local_flush_tlb_one() */
+       mtc0_tlbw_hazard();
+       tlb_probe();
+       tlb_probe_hazard();
+       tlbidx = read_c0_index();
+       mtc0_tlbw_hazard();
+       if (tlbidx < 0)
+               tlb_write_random();
+       else
+               tlb_write_indexed();
+#else
+       tlbidx = read_c0_wired();
+       write_c0_wired(tlbidx + 1);
+       write_c0_index(tlbidx);
+       mtc0_tlbw_hazard();
+       tlb_write_indexed();
+#endif
+       tlbw_use_hazard();
+       write_c0_entryhi(old_ctx);
+       EXIT_CRITICAL(flags);
+
+       return (void*) vaddr;
+}
+
+#define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
+
+static inline void kunmap_coherent(struct page *page)
+{
+#ifndef CONFIG_MIPS_MT_SMTC
+       unsigned int wired;
+       unsigned long flags, old_ctx;
+
+       ENTER_CRITICAL(flags);
+       old_ctx = read_c0_entryhi();
+       wired = read_c0_wired() - 1;
+       write_c0_wired(wired);
+       write_c0_index(wired);
+       write_c0_entryhi(UNIQUE_ENTRYHI(wired));
+       write_c0_entrylo0(0);
+       write_c0_entrylo1(0);
+       mtc0_tlbw_hazard();
+       tlb_write_indexed();
+       tlbw_use_hazard();
+       write_c0_entryhi(old_ctx);
+       EXIT_CRITICAL(flags);
+#endif
+       dec_preempt_count();
+       preempt_check_resched();
+}
+
+void copy_to_user_page(struct vm_area_struct *vma,
+       struct page *page, unsigned long vaddr, void *dst, const void *src,
+       unsigned long len)
+{
+       if (cpu_has_dc_aliases) {
+               void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
+               memcpy(vto, src, len);
+               kunmap_coherent(page);
+       } else
+               memcpy(dst, src, len);
+       if ((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc)
+               flush_cache_page(vma, vaddr, page_to_pfn(page));
+}
+
+EXPORT_SYMBOL(copy_to_user_page);
+
+void copy_from_user_page(struct vm_area_struct *vma,
+       struct page *page, unsigned long vaddr, void *dst, const void *src,
+       unsigned long len)
+{
+       if (cpu_has_dc_aliases) {
+               void *vfrom =
+                       kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
+               memcpy(dst, vfrom, len);
+               kunmap_coherent(page);
+       } else
+               memcpy(dst, src, len);
+}
+
+EXPORT_SYMBOL(copy_from_user_page);
+
+
+#ifdef CONFIG_HIGHMEM
+pte_t *kmap_pte;
+pgprot_t kmap_prot;
+
 static void __init kmap_init(void)
 {
        unsigned long kmap_vstart;
@@ -97,11 +249,12 @@ static void __init kmap_init(void)
 
        kmap_prot = PAGE_KERNEL;
 }
+#endif /* CONFIG_HIGHMEM */
 
-#ifdef CONFIG_32BIT
 void __init fixrange_init(unsigned long start, unsigned long end,
        pgd_t *pgd_base)
 {
+#if defined(CONFIG_HIGHMEM) || defined(CONFIG_MIPS_MT_SMTC)
        pgd_t *pgd;
        pud_t *pud;
        pmd_t *pmd;
@@ -122,7 +275,7 @@ void __init fixrange_init(unsigned long start, unsigned long end,
                        for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) {
                                if (pmd_none(*pmd)) {
                                        pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
-                                       set_pmd(pmd, __pmd(pte));
+                                       set_pmd(pmd, __pmd((unsigned long)pte));
                                        if (pte != pte_offset_kernel(pmd, 0))
                                                BUG();
                                }
@@ -132,9 +285,8 @@ void __init fixrange_init(unsigned long start, unsigned long end,
                }
                j = 0;
        }
+#endif
 }
-#endif /* CONFIG_32BIT */
-#endif /* CONFIG_HIGHMEM */
 
 #ifndef CONFIG_NEED_MULTIPLE_NODES
 extern void pagetable_init(void);
@@ -175,6 +327,7 @@ void __init paging_init(void)
 #ifdef CONFIG_HIGHMEM
        kmap_init();
 #endif
+       kmap_coherent_init();
 
        max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
        low = max_low_pfn;
index 4bdaa05f485b446e0d66587015cbd8378abf4a69..4a61e624b0ecfcd921a560d426e92e1df2df1de2 100644 (file)
@@ -31,9 +31,10 @@ void pgd_init(unsigned long page)
 
 void __init pagetable_init(void)
 {
-#ifdef CONFIG_HIGHMEM
        unsigned long vaddr;
-       pgd_t *pgd, *pgd_base;
+       pgd_t *pgd_base;
+#ifdef CONFIG_HIGHMEM
+       pgd_t *pgd;
        pud_t *pud;
        pmd_t *pmd;
        pte_t *pte;
@@ -44,7 +45,6 @@ void __init pagetable_init(void)
        pgd_init((unsigned long)swapper_pg_dir
                 + sizeof(pgd_t) * USER_PTRS_PER_PGD);
 
-#ifdef CONFIG_HIGHMEM
        pgd_base = swapper_pg_dir;
 
        /*
@@ -53,6 +53,7 @@ void __init pagetable_init(void)
        vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
        fixrange_init(vaddr, 0, pgd_base);
 
+#ifdef CONFIG_HIGHMEM
        /*
         * Permanent kmaps:
         */
index 44b5e97fff65f75286fdd15f33c2bcf40841082a..8d600d307d5ddb3f617ffc34929ea98d4613b4a7 100644 (file)
@@ -8,6 +8,7 @@
  */
 #include <linux/init.h>
 #include <linux/mm.h>
+#include <asm/fixmap.h>
 #include <asm/pgtable.h>
 
 void pgd_init(unsigned long page)
@@ -52,7 +53,17 @@ void pmd_init(unsigned long addr, unsigned long pagetable)
 
 void __init pagetable_init(void)
 {
+       unsigned long vaddr;
+       pgd_t *pgd_base;
+
        /* Initialize the entire pgd.  */
        pgd_init((unsigned long)swapper_pg_dir);
        pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table);
+
+       pgd_base = swapper_pg_dir;
+       /*
+        * Fixed mappings:
+        */
+       vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
+       fixrange_init(vaddr, 0, pgd_base);
 }
index 8b6910465578b02cf8d00b9c9326f302d7ef5b5e..2bd9b7fb0f6c91cc7e35bdedf3bafed7f897e7a3 100644 (file)
@@ -751,6 +751,15 @@ config ARCH_MEMORY_PROBE
        def_bool y
        depends on MEMORY_HOTPLUG
 
+# Some NUMA nodes have memory ranges that span
+# other nodes.  Even though a pfn is valid and
+# between a node's start and end pfns, it may not
+# reside on that node.  See memmap_init_zone()
+# for details.
+config NODES_SPAN_OTHER_NODES
+       def_bool y
+       depends on NEED_MULTIPLE_NODES
+
 config PPC_64K_PAGES
        bool "64k page size"
        depends on PPC64
index 37ddfcab000330ab360e3a6727ee26d22ef638f1..4b2be611f77f350c44304731ccf0a065520d7702 100644 (file)
@@ -115,7 +115,7 @@ endif
 quiet_cmd_wrap = WRAP    $@
       cmd_wrap =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) vmlinux
 quiet_cmd_wrap_initrd = WRAP    $@
-      cmd_wrap_initrd =$(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
+      cmd_wrap_initrd =$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
                                -i $(obj)/ramdisk.image.gz vmlinux
 
 $(obj)/zImage.chrp: vmlinux $(wrapperbits)
index 892d5dd3254e3dc1ced10e570f7e478599e7eb7f..0aba06d7d2eccad8215c096e2b9e8502d96c49f2 100644 (file)
@@ -254,6 +254,7 @@ CONFIG_SYN_COOKIES=y
 CONFIG_INET_TUNNEL=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
+# CONFIG_INET_XFRM_MODE_BEET is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -275,7 +276,9 @@ CONFIG_INET6_XFRM_TUNNEL=m
 CONFIG_INET6_TUNNEL=m
 CONFIG_INET6_XFRM_MODE_TRANSPORT=y
 CONFIG_INET6_XFRM_MODE_TUNNEL=y
+# CONFIG_INET6_XFRM_MODE_BEET is not set
 # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+# CONFIG_IPV6_SIT is not set
 CONFIG_IPV6_TUNNEL=m
 # CONFIG_IPV6_SUBTREES is not set
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
@@ -405,6 +408,12 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 
+#
+# Misc devices
+#
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -738,7 +747,6 @@ CONFIG_GEN_RTC=y
 # TPM devices
 #
 # CONFIG_TCG_TPM is not set
-# CONFIG_TELCLOCK is not set
 
 #
 # I2C support
@@ -802,6 +810,7 @@ CONFIG_I2C_ALGOBIT=y
 #
 # Dallas's 1-wire bus
 #
+# CONFIG_W1 is not set
 
 #
 # Hardware Monitoring support
@@ -809,15 +818,10 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_HWMON is not set
 # CONFIG_HWMON_VID is not set
 
-#
-# Misc devices
-#
-
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
-CONFIG_VIDEO_V4L2=y
 
 #
 # Digital Video Broadcasting Devices
@@ -923,6 +927,7 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 # CONFIG_EXT3_FS_POSIX_ACL is not set
 # CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
@@ -930,6 +935,7 @@ CONFIG_FS_MBCACHE=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
@@ -1129,6 +1135,7 @@ CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_FORCED_INLINING is not set
+# CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_DEBUG_STACKOVERFLOW is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
index 9828663652e9eb8eaa79d6983b7ad233550e6bb0..d2833c1a1f3d784f7b0b37302fb9728a64516dea 100644 (file)
@@ -184,6 +184,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
 CONFIG_RESOURCES_64BIT=y
 CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
+CONFIG_NODES_SPAN_OTHER_NODES=y
 # CONFIG_PPC_64K_PAGES is not set
 CONFIG_SCHED_SMT=y
 CONFIG_PROC_DEVICETREE=y
index 95382f99440475b097420a322031b5293858492a..bfd499ee37530807a070886409b03a504ccca8e9 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <asm/oprofile_impl.h>
 #include <asm/cputable.h>
+#include <asm/prom.h>          /* for PTRRELOC on ARCH=ppc */
 
 struct cpu_spec* cur_cpu_spec = NULL;
 EXPORT_SYMBOL(cur_cpu_spec);
@@ -73,7 +74,7 @@ extern void __restore_cpu_ppc970(void);
 #define PPC_FEATURE_SPE_COMP   0
 #endif
 
-struct cpu_spec        cpu_specs[] = {
+static struct cpu_spec cpu_specs[] = {
 #ifdef CONFIG_PPC64
        {       /* Power3 */
                .pvr_mask               = 0xffff0000,
@@ -227,6 +228,21 @@ struct cpu_spec    cpu_specs[] = {
                .oprofile_type          = PPC_OPROFILE_POWER4,
                .platform               = "ppc970",
        },
+       {       /* PPC970GX */
+               .pvr_mask               = 0xffff0000,
+               .pvr_value              = 0x00450000,
+               .cpu_name               = "PPC970GX",
+               .cpu_features           = CPU_FTRS_PPC970,
+               .cpu_user_features      = COMMON_USER_POWER4 |
+                       PPC_FEATURE_HAS_ALTIVEC_COMP,
+               .icache_bsize           = 128,
+               .dcache_bsize           = 128,
+               .num_pmcs               = 8,
+               .cpu_setup              = __setup_cpu_ppc970,
+               .oprofile_cpu_type      = "ppc64/970",
+               .oprofile_type          = PPC_OPROFILE_POWER4,
+               .platform               = "ppc970",
+       },
        {       /* Power5 GR */
                .pvr_mask               = 0xffff0000,
                .pvr_value              = 0x003a0000,
@@ -1152,3 +1168,71 @@ struct cpu_spec  cpu_specs[] = {
 #endif /* !CLASSIC_PPC */
 #endif /* CONFIG_PPC32 */
 };
+
+struct cpu_spec *identify_cpu(unsigned long offset)
+{
+       struct cpu_spec *s = cpu_specs;
+       struct cpu_spec **cur = &cur_cpu_spec;
+       unsigned int pvr = mfspr(SPRN_PVR);
+       int i;
+
+       s = PTRRELOC(s);
+       cur = PTRRELOC(cur);
+
+       if (*cur != NULL)
+               return PTRRELOC(*cur);
+
+       for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
+               if ((pvr & s->pvr_mask) == s->pvr_value) {
+                       *cur = cpu_specs + i;
+#ifdef CONFIG_PPC64
+                       /* ppc64 expects identify_cpu to also call setup_cpu
+                        * for that processor. I will consolidate that at a
+                        * later time, for now, just use our friend #ifdef.
+                        * we also don't need to PTRRELOC the function pointer
+                        * on ppc64 as we are running at 0 in real mode.
+                        */
+                       if (s->cpu_setup) {
+                               s->cpu_setup(offset, s);
+                       }
+#endif /* CONFIG_PPC64 */
+                       return s;
+               }
+       BUG();
+       return NULL;
+}
+
+void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
+{
+       struct fixup_entry {
+               unsigned long   mask;
+               unsigned long   value;
+               long            start_off;
+               long            end_off;
+       } *fcur, *fend;
+
+       fcur = fixup_start;
+       fend = fixup_end;
+
+       for (; fcur < fend; fcur++) {
+               unsigned int *pstart, *pend, *p;
+
+               if ((value & fcur->mask) == fcur->value)
+                       continue;
+
+               /* These PTRRELOCs will disappear once the new scheme for
+                * modules and vdso is implemented
+                */
+               pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
+               pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
+
+               for (p = pstart; p < pend; p++) {
+                       *p = 0x60000000u;
+                       asm volatile ("dcbst 0, %0" : : "r" (p));
+               }
+               asm volatile ("sync" : : : "memory");
+               for (p = pstart; p < pend; p++)
+                       asm volatile ("icbi 0,%0" : : "r" (p));
+               asm volatile ("sync; isync" : : : "memory");
+       }
+}
index 645c7f10fb28300b782334e4c264602d80718877..291e3629b5046e67caea8b9dbbbbbb70ca1eca15 100644 (file)
@@ -1580,11 +1580,6 @@ _STATIC(__start_initialization_iSeries)
        li      r0,0
        stdu    r0,-STACK_FRAME_OVERHEAD(r1)
 
-       LOAD_REG_IMMEDIATE(r3,cpu_specs)
-       LOAD_REG_IMMEDIATE(r4,cur_cpu_spec)
-       li      r5,0
-       bl      .identify_cpu
-
        LOAD_REG_IMMEDIATE(r2,__toc_start)
        addi    r2,r2,0x4000
        addi    r2,r2,0x4000
@@ -1646,6 +1641,8 @@ _GLOBAL(__start_initialization_multiplatform)
        cmpwi   r0,0x3c         /* 970FX */
        beq     1f
        cmpwi   r0,0x44         /* 970MP */
+       beq     1f
+       cmpwi   r0,0x45         /* 970GX */
        bne     2f
 1:     bl      .__cpu_preinit_ppc970
 2:
@@ -1964,13 +1961,6 @@ _STATIC(start_here_multiplatform)
        addi    r2,r2,0x4000
        add     r2,r2,r26
 
-       LOAD_REG_IMMEDIATE(r3, cpu_specs)
-       add     r3,r3,r26
-       LOAD_REG_IMMEDIATE(r4,cur_cpu_spec)
-       add     r4,r4,r26
-       mr      r5,r26
-       bl      .identify_cpu
-
        /* Do very early kernel initializations, including initial hash table,
         * stab and slb setup before we turn on relocation.     */
 
@@ -2000,13 +1990,6 @@ _STATIC(start_here_common)
        li      r0,0
        stdu    r0,-STACK_FRAME_OVERHEAD(r1)
 
-       /* Apply the CPUs-specific fixups (nop out sections not relevant
-        * to this CPU
-        */
-       li      r3,0
-       bl      .do_cpu_ftr_fixups
-       bl      .do_fw_ftr_fixups
-
        /* ptr to current */
        LOAD_REG_IMMEDIATE(r4, init_task)
        std     r4,PACACURRENT(r13)
index 88fd73fdf048aea647974a694f033653e93cd4f8..412bea3cf813279bd64d8820ed12e593327fa457 100644 (file)
@@ -101,80 +101,6 @@ _GLOBAL(reloc_got2)
        mtlr    r11
        blr
 
-/*
- * identify_cpu,
- * called with r3 = data offset and r4 = CPU number
- * doesn't change r3
- */
-_GLOBAL(identify_cpu)
-       addis   r8,r3,cpu_specs@ha
-       addi    r8,r8,cpu_specs@l
-       mfpvr   r7
-1:
-       lwz     r5,CPU_SPEC_PVR_MASK(r8)
-       and     r5,r5,r7
-       lwz     r6,CPU_SPEC_PVR_VALUE(r8)
-       cmplw   0,r6,r5
-       beq     1f
-       addi    r8,r8,CPU_SPEC_ENTRY_SIZE
-       b       1b
-1:
-       addis   r6,r3,cur_cpu_spec@ha
-       addi    r6,r6,cur_cpu_spec@l
-       sub     r8,r8,r3
-       stw     r8,0(r6)
-       blr
-
-/*
- * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
- * and writes nop's over sections of code that don't apply for this cpu.
- * r3 = data offset (not changed)
- */
-_GLOBAL(do_cpu_ftr_fixups)
-       /* Get CPU 0 features */
-       addis   r6,r3,cur_cpu_spec@ha
-       addi    r6,r6,cur_cpu_spec@l
-       lwz     r4,0(r6)
-       add     r4,r4,r3
-       lwz     r4,CPU_SPEC_FEATURES(r4)
-
-       /* Get the fixup table */
-       addis   r6,r3,__start___ftr_fixup@ha
-       addi    r6,r6,__start___ftr_fixup@l
-       addis   r7,r3,__stop___ftr_fixup@ha
-       addi    r7,r7,__stop___ftr_fixup@l
-
-       /* Do the fixup */
-1:     cmplw   0,r6,r7
-       bgelr
-       addi    r6,r6,16
-       lwz     r8,-16(r6)      /* mask */
-       and     r8,r8,r4
-       lwz     r9,-12(r6)      /* value */
-       cmplw   0,r8,r9
-       beq     1b
-       lwz     r8,-8(r6)       /* section begin */
-       lwz     r9,-4(r6)       /* section end */
-       subf.   r9,r8,r9
-       beq     1b
-       /* write nops over the section of code */
-       /* todo: if large section, add a branch at the start of it */
-       srwi    r9,r9,2
-       mtctr   r9
-       add     r8,r8,r3
-       lis     r0,0x60000000@h /* nop */
-3:     stw     r0,0(r8)
-       andi.   r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
-       beq     2f
-       dcbst   0,r8            /* suboptimal, but simpler */
-       sync
-       icbi    0,r8
-2:     addi    r8,r8,4
-       bdnz    3b
-       sync                    /* additional sync needed on g4 */
-       isync
-       b       1b
-
 /*
  * call_setup_cpu - call the setup_cpu function for this cpu
  * r3 = data offset, r24 = cpu number
index c70e20708a1f625347139f9a7caec7410544266f..21fd2c662a9913cc9ef8f3d0efe421c4907b8929 100644 (file)
@@ -246,130 +246,6 @@ _GLOBAL(__flush_dcache_icache)
        isync
        blr
 
-/*
- * identify_cpu and calls setup_cpu
- * In: r3 = base of the cpu_specs array
- *     r4 = address of cur_cpu_spec
- *     r5 = relocation offset
- */
-_GLOBAL(identify_cpu)
-       mfpvr   r7
-1:
-       lwz     r8,CPU_SPEC_PVR_MASK(r3)
-       and     r8,r8,r7
-       lwz     r9,CPU_SPEC_PVR_VALUE(r3)
-       cmplw   0,r9,r8
-       beq     1f
-       addi    r3,r3,CPU_SPEC_ENTRY_SIZE
-       b       1b
-1:
-       sub     r0,r3,r5
-       std     r0,0(r4)
-       ld      r4,CPU_SPEC_SETUP(r3)
-       cmpdi   0,r4,0
-       add     r4,r4,r5
-       beqlr
-       ld      r4,0(r4)
-       add     r4,r4,r5
-       mtctr   r4
-       /* Calling convention for cpu setup is r3=offset, r4=cur_cpu_spec */
-       mr      r4,r3
-       mr      r3,r5
-       bctr
-
-/*
- * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
- * and writes nop's over sections of code that don't apply for this cpu.
- * r3 = data offset (not changed)
- */
-_GLOBAL(do_cpu_ftr_fixups)
-       /* Get CPU 0 features */
-       LOAD_REG_IMMEDIATE(r6,cur_cpu_spec)
-       sub     r6,r6,r3
-       ld      r4,0(r6)
-       sub     r4,r4,r3
-       ld      r4,CPU_SPEC_FEATURES(r4)
-       /* Get the fixup table */
-       LOAD_REG_IMMEDIATE(r6,__start___ftr_fixup)
-       sub     r6,r6,r3
-       LOAD_REG_IMMEDIATE(r7,__stop___ftr_fixup)
-       sub     r7,r7,r3
-       /* Do the fixup */
-1:     cmpld   r6,r7
-       bgelr
-       addi    r6,r6,32
-       ld      r8,-32(r6)      /* mask */
-       and     r8,r8,r4
-       ld      r9,-24(r6)      /* value */
-       cmpld   r8,r9
-       beq     1b
-       ld      r8,-16(r6)      /* section begin */
-       ld      r9,-8(r6)       /* section end */
-       subf.   r9,r8,r9
-       beq     1b
-       /* write nops over the section of code */
-       /* todo: if large section, add a branch at the start of it */
-       srwi    r9,r9,2
-       mtctr   r9
-       sub     r8,r8,r3
-       lis     r0,0x60000000@h /* nop */
-3:     stw     r0,0(r8)
-       andi.   r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
-       beq     2f
-       dcbst   0,r8            /* suboptimal, but simpler */
-       sync
-       icbi    0,r8
-2:     addi    r8,r8,4
-       bdnz    3b
-       sync                    /* additional sync needed on g4 */
-       isync
-       b       1b
-
-/*
- * do_fw_ftr_fixups - goes through the list of firmware feature fixups
- * and writes nop's over sections of code that don't apply for this firmware.
- * r3 = data offset (not changed)
- */
-_GLOBAL(do_fw_ftr_fixups)
-       /* Get firmware features */
-       LOAD_REG_IMMEDIATE(r6,powerpc_firmware_features)
-       sub     r6,r6,r3
-       ld      r4,0(r6)
-       /* Get the fixup table */
-       LOAD_REG_IMMEDIATE(r6,__start___fw_ftr_fixup)
-       sub     r6,r6,r3
-       LOAD_REG_IMMEDIATE(r7,__stop___fw_ftr_fixup)
-       sub     r7,r7,r3
-       /* Do the fixup */
-1:     cmpld   r6,r7
-       bgelr
-       addi    r6,r6,32
-       ld      r8,-32(r6)      /* mask */
-       and     r8,r8,r4
-       ld      r9,-24(r6)      /* value */
-       cmpld   r8,r9
-       beq     1b
-       ld      r8,-16(r6)      /* section begin */
-       ld      r9,-8(r6)       /* section end */
-       subf.   r9,r8,r9
-       beq     1b
-       /* write nops over the section of code */
-       /* todo: if large section, add a branch at the start of it */
-       srwi    r9,r9,2
-       mtctr   r9
-       sub     r8,r8,r3
-       lis     r0,0x60000000@h /* nop */
-3:     stw     r0,0(r8)
-BEGIN_FTR_SECTION
-       dcbst   0,r8            /* suboptimal, but simpler */
-       sync
-       icbi    0,r8
-END_FTR_SECTION_IFSET(CPU_FTR_SPLIT_ID_CACHE)
-       addi    r8,r8,4
-       bdnz    3b
-       sync                    /* additional sync needed on g4 */
-       isync
-       b       1b
 
 #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE)
 /*
index 92f4e5f64f02c3e30c07fb34822a1e2a78318400..e2c3c6a85f33b4180cd8f9d812e831e2f4c4176c 100644 (file)
@@ -24,6 +24,8 @@
 #include <linux/kernel.h>
 #include <linux/cache.h>
 
+#include "setup.h"
+
 #if 0
 #define DEBUGP printk
 #else
@@ -269,33 +271,50 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
        return 0;
 }
 
+static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
+                                   const Elf_Shdr *sechdrs,
+                                   const char *name)
+{
+       char *secstrings;
+       unsigned int i;
+
+       secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
+       for (i = 1; i < hdr->e_shnum; i++)
+               if (strcmp(secstrings+sechdrs[i].sh_name, name) == 0)
+                       return &sechdrs[i];
+       return NULL;
+}
+
 int module_finalize(const Elf_Ehdr *hdr,
                    const Elf_Shdr *sechdrs,
                    struct module *me)
 {
-       char *secstrings;
-       unsigned int i;
+       const Elf_Shdr *sect;
 
        me->arch.bug_table = NULL;
        me->arch.num_bugs = 0;
 
        /* Find the __bug_table section, if present */
-       secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
-       for (i = 1; i < hdr->e_shnum; i++) {
-               if (strcmp(secstrings+sechdrs[i].sh_name, "__bug_table"))
-                       continue;
-               me->arch.bug_table = (void *) sechdrs[i].sh_addr;
-               me->arch.num_bugs = sechdrs[i].sh_size / sizeof(struct bug_entry);
-               break;
+       sect = find_section(hdr, sechdrs, "__bug_table");
+       if (sect != NULL) {
+               me->arch.bug_table = (void *) sect->sh_addr;
+               me->arch.num_bugs = sect->sh_size / sizeof(struct bug_entry);
        }
 
-       /*
+       /*
         * Strictly speaking this should have a spinlock to protect against
         * traversals, but since we only traverse on BUG()s, a spinlock
         * could potentially lead to deadlock and thus be counter-productive.
         */
        list_add(&me->arch.bug_list, &module_bug_list);
 
+       /* Apply feature fixups */
+       sect = find_section(hdr, sechdrs, "__ftr_fixup");
+       if (sect != NULL)
+               do_feature_fixups(cur_cpu_spec->cpu_features,
+                                 (void *)sect->sh_addr,
+                                 (void *)sect->sh_addr + sect->sh_size);
+
        return 0;
 }
 
index ba34001fca8e8420b6c1aab0df0f9b0a43de3bda..8dd1f0aae5d6265809748dcc0e0001b2a55e440e 100644 (file)
@@ -22,6 +22,9 @@
 #include <linux/vmalloc.h>
 #include <asm/module.h>
 #include <asm/uaccess.h>
+#include <asm/firmware.h>
+
+#include "setup.h"
 
 /* FIXME: We don't do .init separately.  To do this, we'd need to have
    a separate r2 value in the init and core section, and stub between
@@ -400,6 +403,11 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
                                | (value & 0x03fffffc);
                        break;
 
+               case R_PPC64_REL64:
+                       /* 64 bits relative (used by features fixups) */
+                       *location = value - (unsigned long)location;
+                       break;
+
                default:
                        printk("%s: Unknown ADD relocation: %lu\n",
                               me->name,
@@ -413,23 +421,33 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
 
 LIST_HEAD(module_bug_list);
 
-int module_finalize(const Elf_Ehdr *hdr,
-               const Elf_Shdr *sechdrs, struct module *me)
+static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
+                                   const Elf_Shdr *sechdrs,
+                                   const char *name)
 {
        char *secstrings;
        unsigned int i;
 
+       secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
+       for (i = 1; i < hdr->e_shnum; i++)
+               if (strcmp(secstrings+sechdrs[i].sh_name, name) == 0)
+                       return &sechdrs[i];
+       return NULL;
+}
+
+int module_finalize(const Elf_Ehdr *hdr,
+               const Elf_Shdr *sechdrs, struct module *me)
+{
+       const Elf_Shdr *sect;
+
        me->arch.bug_table = NULL;
        me->arch.num_bugs = 0;
 
        /* Find the __bug_table section, if present */
-       secstrings = (char *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
-       for (i = 1; i < hdr->e_shnum; i++) {
-               if (strcmp(secstrings+sechdrs[i].sh_name, "__bug_table"))
-                       continue;
-               me->arch.bug_table = (void *) sechdrs[i].sh_addr;
-               me->arch.num_bugs = sechdrs[i].sh_size / sizeof(struct bug_entry);
-               break;
+       sect = find_section(hdr, sechdrs, "__bug_table");
+       if (sect != NULL) {
+               me->arch.bug_table = (void *) sect->sh_addr;
+               me->arch.num_bugs = sect->sh_size / sizeof(struct bug_entry);
        }
 
        /*
@@ -439,6 +457,19 @@ int module_finalize(const Elf_Ehdr *hdr,
         */
        list_add(&me->arch.bug_list, &module_bug_list);
 
+       /* Apply feature fixups */
+       sect = find_section(hdr, sechdrs, "__ftr_fixup");
+       if (sect != NULL)
+               do_feature_fixups(cur_cpu_spec->cpu_features,
+                                 (void *)sect->sh_addr,
+                                 (void *)sect->sh_addr + sect->sh_size);
+
+       sect = find_section(hdr, sechdrs, "__fw_ftr_fixup");
+       if (sect != NULL)
+               do_feature_fixups(powerpc_firmware_features,
+                                 (void *)sect->sh_addr,
+                                 (void *)sect->sh_addr + sect->sh_size);
+
        return 0;
 }
 
index 865b9648d0d57057fe1af797d67d6faea5345459..bdb412d4b74832fb62c4c530dffa6f7b8c635d25 100644 (file)
@@ -1014,7 +1014,7 @@ EXPORT_SYMBOL(find_all_nodes);
 /** Checks if the given "compat" string matches one of the strings in
  * the device's "compatible" property
  */
-int device_is_compatible(struct device_node *device, const char *compat)
+int device_is_compatible(const struct device_node *device, const char *compat)
 {
        const char* cp;
        int cplen, l;
@@ -1491,7 +1491,8 @@ static int __init prom_reconfig_setup(void)
 __initcall(prom_reconfig_setup);
 #endif
 
-struct property *of_find_property(struct device_node *np, const char *name,
+struct property *of_find_property(const struct device_node *np,
+                                 const char *name,
                                  int *lenp)
 {
        struct property *pp;
@@ -1512,7 +1513,8 @@ struct property *of_find_property(struct device_node *np, const char *name,
  * Find a property with a given name for a given node
  * and return the value.
  */
-const void *get_property(struct device_node *np, const char *name, int *lenp)
+const void *get_property(const struct device_node *np, const char *name,
+                        int *lenp)
 {
        struct property *pp = of_find_property(np,name,lenp);
        return pp ? pp->value : NULL;
index 191d0ab0922227908db8dc6fc3b0fefa53ed876d..a4c2964a3ca6b325f86a52eb1c7880c534ff43d7 100644 (file)
@@ -91,6 +91,7 @@ int ucache_bsize;
 unsigned long __init early_init(unsigned long dt_ptr)
 {
        unsigned long offset = reloc_offset();
+       struct cpu_spec *spec;
 
        /* First zero the BSS -- use memset_io, some platforms don't have
         * caches on yet */
@@ -100,8 +101,11 @@ unsigned long __init early_init(unsigned long dt_ptr)
         * Identify the CPU type and fix up code sections
         * that depend on which cpu we have.
         */
-       identify_cpu(offset, 0);
-       do_cpu_ftr_fixups(offset);
+       spec = identify_cpu(offset);
+
+       do_feature_fixups(spec->cpu_features,
+                         PTRRELOC(&__start___ftr_fixup),
+                         PTRRELOC(&__stop___ftr_fixup));
 
        return KERNELBASE + offset;
 }
index 4b2e32eab9dc3e6b50bea7ffdf52fcdcb229492d..16278968dab68e2153a284709e2b4dfdd067adb4 100644 (file)
@@ -170,6 +170,9 @@ void __init setup_paca(int cpu)
 
 void __init early_setup(unsigned long dt_ptr)
 {
+       /* Identify CPU type */
+       identify_cpu(0);
+
        /* Assume we're on cpu 0 for now. Don't write to the paca yet! */
        setup_paca(0);
 
@@ -348,6 +351,14 @@ void __init setup_system(void)
 {
        DBG(" -> setup_system()\n");
 
+       /* Apply the CPUs-specific and firmware specific fixups to kernel
+        * text (nop out sections not relevant to this CPU or this firmware)
+        */
+       do_feature_fixups(cur_cpu_spec->cpu_features,
+                         &__start___ftr_fixup, &__stop___ftr_fixup);
+       do_feature_fixups(powerpc_firmware_features,
+                         &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup);
+
        /*
         * Unflatten the device-tree passed by prom_init or kexec
         */
index 5b59bc18dfe7b76586cf10449c120a3e6e8e7f2c..a1b5e4b1615101d448bd52e437b6b7866756fefc 100644 (file)
@@ -220,11 +220,8 @@ static void account_process_time(struct pt_regs *regs)
  */
 struct cpu_purr_data {
        int     initialized;                    /* thread is running */
-       u64     tb0;                    /* timebase at origin time */
-       u64     purr0;                  /* PURR at origin time */
        u64     tb;                     /* last TB value read */
        u64     purr;                   /* last PURR value read */
-       u64     stolen;                 /* stolen time so far */
        spinlock_t lock;
 };
 
@@ -234,10 +231,8 @@ static void snapshot_tb_and_purr(void *data)
 {
        struct cpu_purr_data *p = &__get_cpu_var(cpu_purr_data);
 
-       p->tb0 = mftb();
-       p->purr0 = mfspr(SPRN_PURR);
-       p->tb = p->tb0;
-       p->purr = 0;
+       p->tb = mftb();
+       p->purr = mfspr(SPRN_PURR);
        wmb();
        p->initialized = 1;
 }
@@ -258,37 +253,24 @@ void snapshot_timebases(void)
 
 void calculate_steal_time(void)
 {
-       u64 tb, purr, t0;
+       u64 tb, purr;
        s64 stolen;
-       struct cpu_purr_data *p0, *pme, *phim;
-       int cpu;
+       struct cpu_purr_data *pme;
 
        if (!cpu_has_feature(CPU_FTR_PURR))
                return;
-       cpu = smp_processor_id();
-       pme = &per_cpu(cpu_purr_data, cpu);
+       pme = &per_cpu(cpu_purr_data, smp_processor_id());
        if (!pme->initialized)
                return;         /* this can happen in early boot */
-       p0 = &per_cpu(cpu_purr_data, cpu & ~1);
-       phim = &per_cpu(cpu_purr_data, cpu ^ 1);
-       spin_lock(&p0->lock);
+       spin_lock(&pme->lock);
        tb = mftb();
-       purr = mfspr(SPRN_PURR) - pme->purr0;
-       if (!phim->initialized || !cpu_online(cpu ^ 1)) {
-               stolen = (tb - pme->tb) - (purr - pme->purr);
-       } else {
-               t0 = pme->tb0;
-               if (phim->tb0 < t0)
-                       t0 = phim->tb0;
-               stolen = phim->tb - t0 - phim->purr - purr - p0->stolen;
-       }
-       if (stolen > 0) {
+       purr = mfspr(SPRN_PURR);
+       stolen = (tb - pme->tb) - (purr - pme->purr);
+       if (stolen > 0)
                account_steal_time(current, stolen);
-               p0->stolen += stolen;
-       }
        pme->tb = tb;
        pme->purr = purr;
-       spin_unlock(&p0->lock);
+       spin_unlock(&pme->lock);
 }
 
 /*
@@ -297,30 +279,17 @@ void calculate_steal_time(void)
  */
 static void snapshot_purr(void)
 {
-       int cpu;
-       u64 purr;
-       struct cpu_purr_data *p0, *pme, *phim;
+       struct cpu_purr_data *pme;
        unsigned long flags;
 
        if (!cpu_has_feature(CPU_FTR_PURR))
                return;
-       cpu = smp_processor_id();
-       pme = &per_cpu(cpu_purr_data, cpu);
-       p0 = &per_cpu(cpu_purr_data, cpu & ~1);
-       phim = &per_cpu(cpu_purr_data, cpu ^ 1);
-       spin_lock_irqsave(&p0->lock, flags);
-       pme->tb = pme->tb0 = mftb();
-       purr = mfspr(SPRN_PURR);
-       if (!phim->initialized) {
-               pme->purr = 0;
-               pme->purr0 = purr;
-       } else {
-               /* set p->purr and p->purr0 for no change in p0->stolen */
-               pme->purr = phim->tb - phim->tb0 - phim->purr - p0->stolen;
-               pme->purr0 = purr - pme->purr;
-       }
+       pme = &per_cpu(cpu_purr_data, smp_processor_id());
+       spin_lock_irqsave(&pme->lock, flags);
+       pme->tb = mftb();
+       pme->purr = mfspr(SPRN_PURR);
        pme->initialized = 1;
-       spin_unlock_irqrestore(&p0->lock, flags);
+       spin_unlock_irqrestore(&pme->lock, flags);
 }
 
 #endif /* CONFIG_PPC_SPLPAR */
index 1a7e19cdab39c37a9f0e759a6b2177744ef3a967..c913ad5cad2918e3daebe1251de37a18292f67c9 100644 (file)
@@ -36,6 +36,8 @@
 #include <asm/vdso.h>
 #include <asm/vdso_datapage.h>
 
+#include "setup.h"
+
 #undef DEBUG
 
 #ifdef DEBUG
@@ -586,6 +588,43 @@ static __init int vdso_fixup_datapage(struct lib32_elfinfo *v32,
        return 0;
 }
 
+
+static __init int vdso_fixup_features(struct lib32_elfinfo *v32,
+                                     struct lib64_elfinfo *v64)
+{
+       void *start32;
+       unsigned long size32;
+
+#ifdef CONFIG_PPC64
+       void *start64;
+       unsigned long size64;
+
+       start64 = find_section64(v64->hdr, "__ftr_fixup", &size64);
+       if (start64)
+               do_feature_fixups(cur_cpu_spec->cpu_features,
+                                 start64, start64 + size64);
+
+       start64 = find_section64(v64->hdr, "__fw_ftr_fixup", &size64);
+       if (start64)
+               do_feature_fixups(powerpc_firmware_features,
+                                 start64, start64 + size64);
+#endif /* CONFIG_PPC64 */
+
+       start32 = find_section32(v32->hdr, "__ftr_fixup", &size32);
+       if (start32)
+               do_feature_fixups(cur_cpu_spec->cpu_features,
+                                 start32, start32 + size32);
+
+#ifdef CONFIG_PPC64
+       start32 = find_section32(v32->hdr, "__fw_ftr_fixup", &size32);
+       if (start32)
+               do_feature_fixups(powerpc_firmware_features,
+                                 start32, start32 + size32);
+#endif /* CONFIG_PPC64 */
+
+       return 0;
+}
+
 static __init int vdso_fixup_alt_funcs(struct lib32_elfinfo *v32,
                                       struct lib64_elfinfo *v64)
 {
@@ -634,6 +673,9 @@ static __init int vdso_setup(void)
        if (vdso_fixup_datapage(&v32, &v64))
                return -1;
 
+       if (vdso_fixup_features(&v32, &v64))
+               return -1;
+
        if (vdso_fixup_alt_funcs(&v32, &v64))
                return -1;
 
@@ -714,6 +756,7 @@ void __init vdso_init(void)
         * Setup the syscall map in the vDOS
         */
        vdso_setup_syscall_map();
+
        /*
         * Initialize the vDSO images in memory, that is do necessary
         * fixups of vDSO symbols, locate trampolines, etc...
index 6187af2d54c393ea825e523172636ebbcd062427..26e138c4ce1756fe73ac995fc6c86e26cf5328ed 100644 (file)
@@ -32,6 +32,18 @@ SECTIONS
   PROVIDE (_etext = .);
   PROVIDE (etext = .);
 
+  . = ALIGN(8);
+  __ftr_fixup : {
+    *(__ftr_fixup)
+  }
+
+#ifdef CONFIG_PPC64
+  . = ALIGN(8);
+  __fw_ftr_fixup : {
+    *(__fw_ftr_fixup)
+  }
+#endif
+
   /* Other stuff is appended to the text segment: */
   .rodata              : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
   .rodata1             : { *(.rodata1) }
index 56e76ff5498f49fd2a5b590a8c599c1e606f41cc..40ffd9b6cef7bf55fd81a6c62067afec4175d7c5 100644 (file)
@@ -229,8 +229,10 @@ V_FUNCTION_BEGIN(__do_get_xsec)
        xor     r0,r8,r8                /* create dependency */
        add     r3,r3,r0
 
-       /* Get TB & offset it */
-       mftb    r7
+       /* Get TB & offset it. We use the MFTB macro which will generate
+        * workaround code for Cell.
+        */
+       MFTB(r7)
        ld      r9,CFG_TB_ORIG_STAMP(r3)
        subf    r7,r9,r7
 
index 4a2b6dc0960c582b3b0f0f9c8ba73a171195ee0c..2d70f35d50b520bdd2d81bf78d0b2e1eb9a7601b 100644 (file)
@@ -31,6 +31,16 @@ SECTIONS
   PROVIDE (_etext = .);
   PROVIDE (etext = .);
 
+  . = ALIGN(8);
+  __ftr_fixup : {
+    *(__ftr_fixup)
+  }
+
+  . = ALIGN(8);
+  __fw_ftr_fixup : {
+    *(__fw_ftr_fixup)
+  }
+
   /* Other stuff is appended to the text segment: */
   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
   .rodata1        : { *(.rodata1) }
index 506f6b79f893225df5fcc093f146d3d9656f3e7f..6a927effcc7799c0e6f37b1e56cb636256a43397 100644 (file)
@@ -76,7 +76,7 @@ static inline int mmcra_must_set_sample(void)
 {
        if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p) ||
            __is_processor(PV_970) || __is_processor(PV_970FX) ||
-           __is_processor(PV_970MP))
+           __is_processor(PV_970MP) || __is_processor(PV_970GX))
                return 1;
 
        return 0;
index 0de8e114e6b68355b26c2f2ef4de546367792dbc..533e2723e1840eafd8645a962f1f6b0cf4ef96c9 100644 (file)
@@ -385,7 +385,7 @@ static ssize_t spufs_mbox_read(struct file *file, char __user *buf,
        udata = (void __user *)buf;
 
        spu_acquire(ctx);
-       for (count = 0; count <= len; count += 4, udata++) {
+       for (count = 0; (count + 4) <= len; count += 4, udata++) {
                int ret;
                ret = ctx->ops->mbox_read(ctx, &mbox_data);
                if (ret == 0)
index efc452e71ab0f03b93b4d3178d28cc05ef1200c1..d805ffed892d4721db9a697720a31e097e90f974 100644 (file)
@@ -147,7 +147,7 @@ static void spu_hw_signal1_write(struct spu_context *ctx, u32 data)
 
 static u32 spu_hw_signal2_read(struct spu_context *ctx)
 {
-       return in_be32(&ctx->spu->problem->signal_notify1);
+       return in_be32(&ctx->spu->problem->signal_notify2);
 }
 
 static void spu_hw_signal2_write(struct spu_context *ctx, u32 data)
index cae3d13229b995f88374cf0021dac66577c37d30..49b8dabcbc992996db5a3c53dd00b9035f7e5a05 100644 (file)
@@ -477,8 +477,10 @@ static void __init chrp_find_8259(void)
                       " address, polling\n");
 
        i8259_init(pic, chrp_int_ack);
-       if (ppc_md.get_irq == NULL)
+       if (ppc_md.get_irq == NULL) {
                ppc_md.get_irq = i8259_irq;
+               irq_set_default_host(i8259_get_host());
+       }
        if (chrp_mpic != NULL) {
                cascade_irq = irq_of_parse_and_map(pic, 0);
                if (cascade_irq == NO_IRQ)
index a0ff7ba7d666addc2a78a3f20276e9de56d09f61..6f73469fd3b0c64b1a753003af5e3a93a1fef072 100644 (file)
@@ -694,6 +694,11 @@ void * __init iSeries_early_setup(void)
 {
        unsigned long phys_mem_size;
 
+       /* Identify CPU type. This is done again by the common code later
+        * on but calling this function multiple times is fine.
+        */
+       identify_cpu(0);
+
        powerpc_firmware_features |= FW_FEATURE_ISERIES;
        powerpc_firmware_features |= FW_FEATURE_LPAR;
 
index 1174ca128efa4aa160b13790937ad418366e280a..adee28da353f9f00095d7d8ed85d3234d8001dab 100644 (file)
@@ -45,7 +45,8 @@
        .section .text
        .align  5
 
-#if defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ_PMAC)
+#if defined(CONFIG_PM) || defined(CONFIG_CPU_FREQ_PMAC) || \
+    (defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32))
 
 /* This gets called by via-pmu.c late during the sleep process.
  * The PMU was already send the sleep command and will shut us down
index 0450265d73bbe38e628829ea2f9219046c5d7f8e..ad87adc975bcc1a6bbf0a901f8f158b6bc5610d3 100644 (file)
@@ -224,6 +224,11 @@ static struct irq_host_ops i8259_host_ops = {
        .xlate = i8259_host_xlate,
 };
 
+struct irq_host *i8259_get_host(void)
+{
+       return i8259_host;
+}
+
 /**
  * i8259_init - Initialize the legacy controller
  * @node: device node of the legacy PIC (can be NULL, but then, it will match
index bc4d4a7f9657d39c4ae037e39ac6a81d9d9a3444..746f78c153756c29007c2bad272e0d0779926989 100644 (file)
@@ -473,9 +473,9 @@ static int ipic_set_irq_type(unsigned int virq, unsigned int flow_type)
        desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
        if (flow_type & IRQ_TYPE_LEVEL_LOW)  {
                desc->status |= IRQ_LEVEL;
-               set_irq_handler(virq, handle_level_irq);
+               desc->handle_irq = handle_level_irq;
        } else {
-               set_irq_handler(virq, handle_edge_irq);
+               desc->handle_irq = handle_edge_irq;
        }
 
        /* only EXT IRQ senses are programmable on ipic
index 916c9e5df57faa67afb71b0d7d90220929b639dd..ac12a44d516f6ceb6d987ec4f09d7c85a67ee77a 100644 (file)
@@ -207,6 +207,7 @@ int ucc_set_qe_mux_rxtx(int ucc_num, enum qe_clock clock, enum comm_dir mode)
                case QE_CLK18:  source = 8; break;
                case QE_CLK7:   source = 9; break;
                case QE_CLK8:   source = 10; break;
+               case QE_CLK16:  source = 11; break;
                default:        source = -1; break;
                }
                break;
@@ -222,6 +223,7 @@ int ucc_set_qe_mux_rxtx(int ucc_num, enum qe_clock clock, enum comm_dir mode)
                case QE_CLK22:  source = 8; break;
                case QE_CLK7:   source = 9; break;
                case QE_CLK8:   source = 10; break;
+               case QE_CLK16:  source = 11; break;
                default:        source = -1; break;
                }
                break;
index c2be7348fcbd81f1db943715147cd973b551367e..75fa3104a43aaeb4ac1bdde7cdd1a19045c2b22e 100644 (file)
@@ -163,7 +163,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 
        /* check if the UCC port number is in range. */
        if ((uf_info->ucc_num < 0) || (uf_info->ucc_num > UCC_MAX_NUM - 1)) {
-               uccf_err("ucc_fast_init: Illagal UCC number!");
+               uccf_err("ucc_fast_init: Illegal UCC number!");
                return -EINVAL;
        }
 
index 1fb88ef7cf0640ef8063e024d3a4603d79c609d5..a49da6b73ecf6c2d8fa0d23b71f872ca362c07b0 100644 (file)
@@ -152,7 +152,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 
        /* check if the UCC port number is in range. */
        if ((us_info->ucc_num < 0) || (us_info->ucc_num > UCC_MAX_NUM - 1)) {
-               uccs_err("ucc_slow_init: Illagal UCC number!");
+               uccs_err("ucc_slow_init: Illegal UCC number!");
                return -EINVAL;
        }
 
index 11de090eb9015ea7a2917b3269dff8afa4c519d4..97f37ef4bbbf42e1c09d6bd535ebfb87e6c7f140 100644 (file)
@@ -48,7 +48,7 @@ phys_addr_t get_csrbase(void)
        tsi = of_find_node_by_type(NULL, "tsi-bridge");
        if (tsi) {
                unsigned int size;
-               void *prop = get_property(tsi, "reg", &size);
+               const void *prop = get_property(tsi, "reg", &size);
                tsi108_csr_base = of_translate_address(tsi, prop);
                of_node_put(tsi);
        };
@@ -79,7 +79,7 @@ static int __init tsi108_eth_of_init(void)
                hw_info tsi_eth_data;
                unsigned int *id;
                unsigned int *phy_id;
-               void *mac_addr;
+               const void *mac_addr;
                phandle *ph;
 
                memset(r, 0, sizeof(r));
index 0c021556d78e25a822e573aea1d521fd06c0d8e5..1bbbcd2f2bcbd44c033329f479cc0def95ce7630 100644 (file)
@@ -154,8 +154,8 @@ do_relocate_out:
 
 start_ldr:
 /* Clear all of BSS and set up stack for C calls */
-       lis     r3,edata@h
-       ori     r3,r3,edata@l
+       lis     r3,__bss_start@h
+       ori     r3,r3,__bss_start@l
        lis     r4,end@h
        ori     r4,r4,end@l
        subi    r3,r3,4
@@ -163,7 +163,7 @@ start_ldr:
        li      r0,0
 50:    stwu    r0,4(r3)
        cmpw    cr0,r3,r4
-       bne     50b
+       blt     50b
 90:    mr      r9,r1           /* Save old stack pointer (in case it matters) */
        lis     r1,.stack@h
        ori     r1,r1,.stack@l
index 5f6684012ded76d4d02c9b0f55c37b8e2cb6548f..d319f9ba2379d812f31d5bfbc8b249989de79636 100644 (file)
@@ -109,80 +109,6 @@ _GLOBAL(reloc_got2)
        mtlr    r11
        blr
 
-/*
- * identify_cpu,
- * called with r3 = data offset and r4 = CPU number
- * doesn't change r3
- */
-_GLOBAL(identify_cpu)
-       addis   r8,r3,cpu_specs@ha
-       addi    r8,r8,cpu_specs@l
-       mfpvr   r7
-1:
-       lwz     r5,CPU_SPEC_PVR_MASK(r8)
-       and     r5,r5,r7
-       lwz     r6,CPU_SPEC_PVR_VALUE(r8)
-       cmplw   0,r6,r5
-       beq     1f
-       addi    r8,r8,CPU_SPEC_ENTRY_SIZE
-       b       1b
-1:
-       addis   r6,r3,cur_cpu_spec@ha
-       addi    r6,r6,cur_cpu_spec@l
-       sub     r8,r8,r3
-       stw     r8,0(r6)
-       blr
-
-/*
- * do_cpu_ftr_fixups - goes through the list of CPU feature fixups
- * and writes nop's over sections of code that don't apply for this cpu.
- * r3 = data offset (not changed)
- */
-_GLOBAL(do_cpu_ftr_fixups)
-       /* Get CPU 0 features */
-       addis   r6,r3,cur_cpu_spec@ha
-       addi    r6,r6,cur_cpu_spec@l
-       lwz     r4,0(r6)
-       add     r4,r4,r3
-       lwz     r4,CPU_SPEC_FEATURES(r4)
-
-       /* Get the fixup table */
-       addis   r6,r3,__start___ftr_fixup@ha
-       addi    r6,r6,__start___ftr_fixup@l
-       addis   r7,r3,__stop___ftr_fixup@ha
-       addi    r7,r7,__stop___ftr_fixup@l
-
-       /* Do the fixup */
-1:     cmplw   0,r6,r7
-       bgelr
-       addi    r6,r6,16
-       lwz     r8,-16(r6)      /* mask */
-       and     r8,r8,r4
-       lwz     r9,-12(r6)      /* value */
-       cmplw   0,r8,r9
-       beq     1b
-       lwz     r8,-8(r6)       /* section begin */
-       lwz     r9,-4(r6)       /* section end */
-       subf.   r9,r8,r9
-       beq     1b
-       /* write nops over the section of code */
-       /* todo: if large section, add a branch at the start of it */
-       srwi    r9,r9,2
-       mtctr   r9
-       add     r8,r8,r3
-       lis     r0,0x60000000@h /* nop */
-3:     stw     r0,0(r8)
-       andi.   r10,r4,CPU_FTR_SPLIT_ID_CACHE@l
-       beq     2f
-       dcbst   0,r8            /* suboptimal, but simpler */
-       sync
-       icbi    0,r8
-2:     addi    r8,r8,4
-       bdnz    3b
-       sync                    /* additional sync needed on g4 */
-       isync
-       b       1b
-
 /*
  * call_setup_cpu - call the setup_cpu function for this cpu
  * r3 = data offset, r24 = cpu number
index 75fe13815be27c23e817ac7527c00079476f1c0b..27faeca2c7a209438eca4fb394b2ce868ce357c2 100644 (file)
@@ -38,6 +38,7 @@
 #include <asm/nvram.h>
 #include <asm/xmon.h>
 #include <asm/ocp.h>
+#include <asm/prom.h>
 
 #define USES_PPC_SYS (defined(CONFIG_85xx) || defined(CONFIG_83xx) || \
                      defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \
@@ -53,8 +54,6 @@
 
 extern void platform_init(unsigned long r3, unsigned long r4,
                unsigned long r5, unsigned long r6, unsigned long r7);
-extern void identify_cpu(unsigned long offset, unsigned long cpu);
-extern void do_cpu_ftr_fixups(unsigned long offset);
 extern void reloc_got2(unsigned long offset);
 
 extern void ppc6xx_idle(void);
@@ -301,6 +300,7 @@ early_init(int r3, int r4, int r5)
 {
        unsigned long phys;
        unsigned long offset = reloc_offset();
+       struct cpu_spec *spec;
 
        /* Default */
        phys = offset + KERNELBASE;
@@ -313,8 +313,10 @@ early_init(int r3, int r4, int r5)
         * Identify the CPU type and fix up code sections
         * that depend on which cpu we have.
         */
-       identify_cpu(offset, 0);
-       do_cpu_ftr_fixups(offset);
+       spec = identify_cpu(offset);
+       do_feature_fixups(spec->cpu_features,
+                         PTRRELOC(&__start___ftr_fixup),
+                         PTRRELOC(&__stop___ftr_fixup));
 
        return phys;
 }
index 219179114f0fe6fda9faf5b610c7e2a17781a5cf..d146cdaa0b8b03897b5f09e68aec42f2acd4abd4 100644 (file)
@@ -14,7 +14,7 @@
 #include <asm/io.h>
 #include <asm/apm.h>
 #include <asm/adc.h>
-#include <asm/hp6xx/hp6xx.h>
+#include <asm/hp6xx.h>
 
 #define SH7709_PGDR                    0xa400012c
 
index 83d3272120645d149c16965e46d0f90b2f5c1183..d1947732fb3e5013e0b8d00f6f8ce42bf31e090a 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/time.h>
 #include <asm/io.h>
 #include <asm/hd64461.h>
-#include <asm/hp6xx/hp6xx.h>
+#include <asm/hp6xx.h>
 #include <asm/cpu/dac.h>
 #include <asm/pm.h>
 
index 2d3a5b4faf585b5dedcc201234cbf2efdfc3481d..b5a96649ed2692fc9a8b591171376809b7c61193 100644 (file)
@@ -13,7 +13,7 @@
 #include <asm/hd64461.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/hp6xx/hp6xx.h>
+#include <asm/hp6xx.h>
 #include <asm/cpu/dac.h>
 
 #define        SCPCR   0xa4000116
index 51f3f6574210c712fb98adbc1d7165977c8366d8..bb9aa0d62852379d05aefa16a327650c2721d815 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <asm/io.h>
-#include <asm/hs7751rvoip/hs7751rvoip.h>
+#include <asm/hs7751rvoip.h>
 #include <asm/addrspace.h>
 
 extern void *area6_io8_base;   /* Area 6 8bit I/O Base address */
index c617b188258a0e4a27bbb731f4ec99e48c0cdad3..943f93aa6052cc8ddc5a3723c804819b52a84bd7 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/irq.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/hs7751rvoip/hs7751rvoip.h>
+#include <asm/hs7751rvoip.h>
 
 static int mask_pos[] = {8, 9, 10, 11, 12, 13, 0, 1, 2, 3, 4, 5, 6, 7};
 
index 0414c15c3458da63969f97c7cf3ddb923646bbdb..1d997ffd7931d859053cbd30ed16efddd5524c79 100644 (file)
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/mm.h>
-#include <linux/vmalloc.h>
-#include <linux/hdreg.h>
-#include <linux/ide.h>
 #include <linux/pm.h>
+#include <asm/hs7751rvoip.h>
 #include <asm/io.h>
-#include <asm/hs7751rvoip/hs7751rvoip.h>
 #include <asm/machvec.h>
-#include <asm/rtc.h>
-#include <asm/irq.h>
 
 static void __init hs7751rvoip_init_irq(void)
 {
index db92d6e6ae9936cea200bcc6faee4adcb6fbf071..311ccccba718c48e7665403b6b1b722732c9a339 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
-#include <asm/r7780rp/r7780rp.h>
+#include <asm/r7780rp.h>
 #include <asm/addrspace.h>
 #include <asm/io.h>
 
index b544772cbc72c61ae31aa12c643d586f90d0a2ae..aa15ec5bc69ee42cf26b776f20562520277f1f46 100644 (file)
@@ -10,7 +10,8 @@
  */
 #include <linux/init.h>
 #include <linux/irq.h>
-#include <asm/io.h>
+#include <linux/io.h>
+#include <asm/r7780rp.h>
 
 #ifdef CONFIG_SH_R7780MP
 static int mask_pos[] = {12, 11, 9, 14, 15, 8, 13, 6, 5, 4, 3, 2, 0, 0, 1, 0};
@@ -32,7 +33,7 @@ static void disable_r7780rp_irq(unsigned int irq)
 }
 
 static struct irq_chip r7780rp_irq_chip __read_mostly = {
-       .name           = "r7780rp",
+       .name           = "R7780RP",
        .mask           = disable_r7780rp_irq,
        .unmask         = enable_r7780rp_irq,
        .mask_ack       = disable_r7780rp_irq,
@@ -47,8 +48,8 @@ void __init init_r7780rp_IRQ(void)
 
        for (i = 0; i < 15; i++) {
                disable_irq_nosync(i);
-               set_irq_chip_and_handler(i, &r7780rp_irq_chip,
-                                        handle_level_irq);
+               set_irq_chip_and_handler_name(i, &r7780rp_irq_chip,
+                                             handle_level_irq, "level");
                enable_r7780rp_irq(i);
        }
 }
index b941aa0aa34e60b8397e235ed5260cd87e932516..c331caeb694b681658639d5a8e75a3f765afa36c 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <asm/machvec.h>
-#include <asm/r7780rp/r7780rp.h>
+#include <asm/r7780rp.h>
 #include <asm/clock.h>
 #include <asm/io.h>
 
index 135aa0b5e62dcc926d7df4f3c4996c70c1433c96..f2507a804979a35f0b3a2bedb696986c06d1a689 100644 (file)
@@ -11,8 +11,8 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/pci.h>
-#include <asm/rts7751r2d/rts7751r2d.h>
-#include <asm/io.h>
+#include <linux/io.h>
+#include <asm/rts7751r2d.h>
 #include <asm/addrspace.h>
 
 /*
index c915e7a3693a0648b8f52e090cdc4add9b72ac09..cb0eb20d1b4348fbd58a81c54a88bf7be7973399 100644 (file)
@@ -8,12 +8,10 @@
  * Modified for RTS7751R2D by
  * Atom Create Engineering Co., Ltd. 2002.
  */
-
 #include <linux/init.h>
 #include <linux/irq.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/rts7751r2d/rts7751r2d.h>
+#include <linux/io.h>
+#include <asm/rts7751r2d.h>
 
 #if defined(CONFIG_RTS7751R2D_REV11)
 static int mask_pos[] = {11, 9, 8, 12, 10, 6, 5, 4, 7, 14, 13, 0, 0, 0, 0};
index a7ce66c1e4f04ceb5a39d0dbd1c95050bffe879f..509f548bdce037e12eebdb4a5179515ade7dce0b 100644 (file)
@@ -8,13 +8,9 @@
  *
  * This file contains Renesas Technology Sales RTS7751R2D specific LED code.
  */
-
-#include <asm/io.h>
-#include <asm/rts7751r2d/rts7751r2d.h>
-
-#ifdef CONFIG_HEARTBEAT
-
+#include <linux/io.h>
 #include <linux/sched.h>
+#include <asm/rts7751r2d.h>
 
 /* Cycle the LED's in the clasic Knightriger/Sun pattern */
 void heartbeat_rts7751r2d(void)
@@ -46,10 +42,3 @@ void heartbeat_rts7751r2d(void)
        else
                bit--;
 }
-#endif /* CONFIG_HEARTBEAT */
-
-void rts7751r2d_led(unsigned short value)
-{
-       ctrl_outw(value, PA_OUTPORT);
-}
-
index 20597a6e6702c40e76f5cab65a2b396f668b3c08..5c042d35ec91768d5255d2cba2ddf8c48f59fcb8 100644 (file)
@@ -12,9 +12,9 @@
 #include <linux/platform_device.h>
 #include <linux/serial_8250.h>
 #include <linux/pm.h>
-#include <asm/io.h>
 #include <asm/machvec.h>
 #include <asm/mach/rts7751r2d.h>
+#include <asm/io.h>
 #include <asm/voyagergx.h>
 
 extern void heartbeat_rts7751r2d(void);
index 2f0c19706cf9ad3e144b57fada06bbd83ac15eef..a31a1d1e2681f06e16dff61cf2eef069977949ab 100644 (file)
@@ -7,7 +7,7 @@
  */
 #include <linux/init.h>
 #include <asm/machvec.h>
-#include <asm/shmin/shmin.h>
+#include <asm/shmin.h>
 #include <asm/clock.h>
 #include <asm/irq.h>
 #include <asm/io.h>
index bf1b28feca06d7222ca5c5f53e272b753a0d6a3f..f7ea700d05ae53c022493c791f601aa25266f7e5 100644 (file)
 
     Copyright 2003 (c) Lineo uSolutions,Inc.
 */
-/* -------------------------------------------------------------------- */
-
-#undef DEBUG
-
-#include <linux/sched.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/param.h>
-#include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
-#include <linux/irq.h>
-
-#include <asm/io.h>
-#include <asm/irq.h>
+#include <linux/io.h>
 #include <asm/voyagergx.h>
+#include <asm/rts7751r2d.h>
 
 static void disable_voyagergx_irq(unsigned int irq)
 {
        unsigned long val;
        unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE);
 
-       pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask);
+       pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask);
         val = inl(VOYAGER_INT_MASK);
         val &= ~mask;
         outl(val, VOYAGER_INT_MASK);
@@ -50,7 +39,7 @@ static void enable_voyagergx_irq(unsigned int irq)
         unsigned long val;
         unsigned long mask = 1 << (irq - VOYAGER_IRQ_BASE);
 
-        pr_debug("disable_voyagergx_irq(%d): mask=%x\n", irq, mask);
+        pr_debug("disable_voyagergx_irq(%d): mask=%lx\n", irq, mask);
         val = inl(VOYAGER_INT_MASK);
         val |= mask;
         outl(val, VOYAGER_INT_MASK);
@@ -137,7 +126,7 @@ int voyagergx_irq_demux(int irq)
                } else {
                        printk("Unexpected IRQ irq = %d status = 0x%08lx\n", irq, val);
                }
-               pr_debug("voyagergx_irq_demux %\n", i);
+               pr_debug("voyagergx_irq_demux %ld\n", i);
 #else
                for (bit = 1, i = 0 ; i < VOYAGER_IRQ_NUM ; bit <<= 1, i++)
                        if (val & bit)
@@ -185,4 +174,3 @@ void __init setup_voyagergx_irq(void)
 
        setup_irq(IRQ_VOYAGER, &irq0);
 }
-
index 6e3ba9c65b40534de3d65f3c9a358d52d3476853..eeea1577e112727d6afd32d018ced0681788e65f 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
-#include <asm/r7780rp/r7780rp.h>
+#include <asm/r7780rp.h>
 #include <asm/io.h>
 #include "pci-sh4.h"
 
index b68824c8b81e72684946ac2f36628c70bd613a4c..4a518d948049b41ff150a82303b3b69ee58fa691 100644 (file)
  *
  * PCI initialization for the Renesas SH7751R RTS7751R2D board
  */
-
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
-#include <linux/delay.h>
 #include <linux/pci.h>
-#include <linux/module.h>
-#include <asm/rts7751r2d/rts7751r2d.h>
-#include <asm/io.h>
+#include <linux/io.h>
+#include <asm/rts7751r2d.h>
 #include "pci-sh4.h"
 
+static u8 rts7751r2d_irq_tab[] __initdata = {
+       IRQ_PCISLOT1,
+       IRQ_PCISLOT2,
+       IRQ_PCMCIA,
+       IRQ_PCIETH,
+};
+
 int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
 {
-        switch (slot) {
-       case 0: return IRQ_PCISLOT1;    /* PCI Extend slot #1 */
-       case 1: return IRQ_PCISLOT2;    /* PCI Extend slot #2 */
-       case 2: return IRQ_PCMCIA;      /* PCI Cardbus Bridge */
-       case 3: return IRQ_PCIETH;      /* Realtek Ethernet controller */
-       default:
-               printk("PCI: Bad IRQ mapping request for slot %d\n", slot);
-               return -1;
-       }
+       return rts7751r2d_irq_tab[slot];
 }
 
 static struct resource sh7751_io_resource = {
index d4b2bb7e08c706772df81f9f79766c68a8bbefbf..74ca576a7ce502984e26cf8511a7808acaf65c03 100644 (file)
  * Hitachi 7751, the STM ST40 STB1, SH7760, and SH7780.
  */
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/irq.h>
+#include <linux/io.h>
 #include <asm/system.h>
-#include <asm/io.h>
 
 static void disable_intc2_irq(unsigned int irq)
 {
@@ -31,7 +30,7 @@ static void enable_intc2_irq(unsigned int irq)
 }
 
 static struct irq_chip intc2_irq_chip = {
-       .typename       = "intc2",
+       .name           = "INTC2",
        .mask           = disable_intc2_irq,
        .unmask         = enable_intc2_irq,
        .mask_ack       = disable_intc2_irq,
@@ -45,150 +44,36 @@ static struct irq_chip intc2_irq_chip = {
  *    PIO1 which is INTPRI00[19,16] and INTMSK00[13]
  * would be:               ^     ^             ^  ^
  *                         |     |             |  |
- *    make_intc2_irq(84,   0,   16,            0, 13);
+ *     { 84,              0,   16,            0, 13 },
+ *
+ * in the intc2_data table.
  */
-void make_intc2_irq(struct intc2_data *p)
+void make_intc2_irq(struct intc2_data *table, unsigned int nr_irqs)
 {
-       unsigned int flags;
-       unsigned long ipr;
-
-       disable_irq_nosync(p->irq);
-
-       /* Set the priority level */
-       local_irq_save(flags);
-
-       ipr = ctrl_inl(INTC2_BASE + INTC2_INTPRI_OFFSET + p->ipr_offset);
-       ipr &= ~(0xf << p->ipr_shift);
-       ipr |= p->priority << p->ipr_shift;
-       ctrl_outl(ipr, INTC2_BASE + INTC2_INTPRI_OFFSET + p->ipr_offset);
-
-       local_irq_restore(flags);
+       int i;
 
-       set_irq_chip_and_handler(p->irq, &intc2_irq_chip, handle_level_irq);
-       set_irq_chip_data(p->irq, p);
+       for (i = 0; i < nr_irqs; i++) {
+               unsigned long ipr, flags;
+               struct intc2_data *p = table + i;
 
-       enable_intc2_irq(p->irq);
-}
+               disable_irq_nosync(p->irq);
 
-static struct intc2_data intc2_irq_table[] = {
-#if defined(CONFIG_CPU_SUBTYPE_ST40)
-       {64,  0,  0, 0,  0, 13},        /* PCI serr */
-       {65,  0,  4, 0,  1, 13},        /* PCI err */
-       {66,  0,  4, 0,  2, 13},        /* PCI ad */
-       {67,  0,  4, 0,  3, 13},        /* PCI pwd down */
-       {72,  0,  8, 0,  5, 13},        /* DMAC INT0 */
-       {73,  0,  8, 0,  6, 13},        /* DMAC INT1 */
-       {74,  0,  8, 0,  7, 13},        /* DMAC INT2 */
-       {75,  0,  8, 0,  8, 13},        /* DMAC INT3 */
-       {76,  0,  8, 0,  9, 13},        /* DMAC INT4 */
-       {78,  0,  8, 0, 11, 13},        /* DMAC ERR */
-       {80,  0, 12, 0, 12, 13},        /* PIO0 */
-       {84,  0, 16, 0, 13, 13},        /* PIO1 */
-       {88,  0, 20, 0, 14, 13},        /* PIO2 */
-       {112, 4,  0, 4,  0, 13},        /* Mailbox */
- #ifdef CONFIG_CPU_SUBTYPE_ST40GX1
-       {116, 4,  4, 4,  4, 13},        /* SSC0 */
-       {120, 4,  8, 4,  8, 13},        /* IR Blaster */
-       {124, 4, 12, 4, 12, 13},        /* USB host */
-       {128, 4, 16, 4, 16, 13},        /* Video processor BLITTER */
-       {132, 4, 20, 4, 20, 13},        /* UART0 */
-       {134, 4, 20, 4, 22, 13},        /* UART2 */
-       {136, 4, 24, 4, 24, 13},        /* IO_PIO0 */
-       {140, 4, 28, 4, 28, 13},        /* EMPI */
-       {144, 8,  0, 8,  0, 13},        /* MAFE */
-       {148, 8,  4, 8,  4, 13},        /* PWM */
-       {152, 8,  8, 8,  8, 13},        /* SSC1 */
-       {156, 8, 12, 8, 12, 13},        /* IO_PIO1 */
-       {160, 8, 16, 8, 16, 13},        /* USB target */
-       {164, 8, 20, 8, 20, 13},        /* UART1 */
-       {168, 8, 24, 8, 24, 13},        /* Teletext */
-       {172, 8, 28, 8, 28, 13},        /* VideoSync VTG */
-       {173, 8, 28, 8, 29, 13},        /* VideoSync DVP0 */
-       {174, 8, 28, 8, 30, 13},        /* VideoSync DVP1 */
-#endif
-#elif defined(CONFIG_CPU_SUBTYPE_SH7760)
-/*
- * SH7760 INTC2-Style interrupts, vectors IRQ48-111 INTEVT 0x800-0xFE0
- */
-       /* INTPRIO0 | INTMSK0 */
-       {48,  0, 28, 0, 31,  3},        /* IRQ 4 */
-       {49,  0, 24, 0, 30,  3},        /* IRQ 3 */
-       {50,  0, 20, 0, 29,  3},        /* IRQ 2 */
-       {51,  0, 16, 0, 28,  3},        /* IRQ 1 */
-       /* 52-55 (INTEVT 0x880-0x8E0) unused/reserved */
-       /* INTPRIO4 | INTMSK0 */
-       {56,  4, 28, 0, 25,  3},        /* HCAN2_CHAN0 */
-       {57,  4, 24, 0, 24,  3},        /* HCAN2_CHAN1 */
-       {58,  4, 20, 0, 23,  3},        /* I2S_CHAN0   */
-       {59,  4, 16, 0, 22,  3},        /* I2S_CHAN1   */
-       {60,  4, 12, 0, 21,  3},        /* AC97_CHAN0  */
-       {61,  4,  8, 0, 20,  3},        /* AC97_CHAN1  */
-       {62,  4,  4, 0, 19,  3},        /* I2C_CHAN0   */
-       {63,  4,  0, 0, 18,  3},        /* I2C_CHAN1   */
-       /* INTPRIO8 | INTMSK0 */
-       {52,  8, 16, 0, 11,  3},        /* SCIF0_ERI_IRQ */
-       {53,  8, 16, 0, 10,  3},        /* SCIF0_RXI_IRQ */
-       {54,  8, 16, 0,  9,  3},        /* SCIF0_BRI_IRQ */
-       {55,  8, 16, 0,  8,  3},        /* SCIF0_TXI_IRQ */
-       {64,  8, 28, 0, 17,  3},        /* USBHI_IRQ */
-       {65,  8, 24, 0, 16,  3},        /* LCDC      */
-       /* 66, 67 unused */
-       {68,  8, 20, 0, 14, 13},        /* DMABRGI0_IRQ */
-       {69,  8, 20, 0, 13, 13},        /* DMABRGI1_IRQ */
-       {70,  8, 20, 0, 12, 13},        /* DMABRGI2_IRQ */
-       /* 71 unused */
-       {72,  8, 12, 0,  7,  3},        /* SCIF1_ERI_IRQ */
-       {73,  8, 12, 0,  6,  3},        /* SCIF1_RXI_IRQ */
-       {74,  8, 12, 0,  5,  3},        /* SCIF1_BRI_IRQ */
-       {75,  8, 12, 0,  4,  3},        /* SCIF1_TXI_IRQ */
-       {76,  8,  8, 0,  3,  3},        /* SCIF2_ERI_IRQ */
-       {77,  8,  8, 0,  2,  3},        /* SCIF2_RXI_IRQ */
-       {78,  8,  8, 0,  1,  3},        /* SCIF2_BRI_IRQ */
-       {79,  8,  8, 0,  0,  3},        /* SCIF2_TXI_IRQ */
-       /*          | INTMSK4 */
-       {80,  8,  4, 4, 23,  3},        /* SIM_ERI */
-       {81,  8,  4, 4, 22,  3},        /* SIM_RXI */
-       {82,  8,  4, 4, 21,  3},        /* SIM_TXI */
-       {83,  8,  4, 4, 20,  3},        /* SIM_TEI */
-       {84,  8,  0, 4, 19,  3},        /* HSPII */
-       /* INTPRIOC | INTMSK4 */
-       /* 85-87 unused/reserved */
-       {88, 12, 20, 4, 18,  3},        /* MMCI0 */
-       {89, 12, 20, 4, 17,  3},        /* MMCI1 */
-       {90, 12, 20, 4, 16,  3},        /* MMCI2 */
-       {91, 12, 20, 4, 15,  3},        /* MMCI3 */
-       {92, 12, 12, 4,  6,  3},        /* MFI (unsure, bug? in my 7760 manual*/
-       /* 93-107 reserved/undocumented */
-       {108,12,  4, 4,  1,  3},        /* ADC  */
-       {109,12,  0, 4,  0,  3},        /* CMTI */
-       /* 110-111 reserved/unused */
-#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
-       { TIMER_IRQ, 0, 24, 0, INTC_TMU0_MSK, 2},
-       { 21, 1, 0, 0, INTC_RTC_MSK, TIMER_PRIORITY },
-       { 22, 1, 1, 0, INTC_RTC_MSK, TIMER_PRIORITY },
-       { 23, 1, 2, 0, INTC_RTC_MSK, TIMER_PRIORITY },
-       { SCIF0_ERI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
-       { SCIF0_RXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
-       { SCIF0_BRI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
-       { SCIF0_TXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
+               /* Set the priority level */
+               local_irq_save(flags);
 
-       { SCIF1_ERI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
-       { SCIF1_RXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
-       { SCIF1_BRI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
-       { SCIF1_TXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
+               ipr = ctrl_inl(INTC2_BASE + INTC2_INTPRI_OFFSET +
+                              p->ipr_offset);
+               ipr &= ~(0xf << p->ipr_shift);
+               ipr |= p->priority << p->ipr_shift;
+               ctrl_outl(ipr, INTC2_BASE + INTC2_INTPRI_OFFSET +
+                         p->ipr_offset);
 
-       { PCIC0_IRQ, 0x10,  8, 0, INTC_PCIC0_MSK, PCIC0_PRIORITY },
-       { PCIC1_IRQ, 0x10,  0, 0, INTC_PCIC1_MSK, PCIC1_PRIORITY },
-       { PCIC2_IRQ, 0x14, 24, 0, INTC_PCIC2_MSK, PCIC2_PRIORITY },
-       { PCIC3_IRQ, 0x14, 16, 0, INTC_PCIC3_MSK, PCIC3_PRIORITY },
-       { PCIC4_IRQ, 0x14,  8, 0, INTC_PCIC4_MSK, PCIC4_PRIORITY },
-#endif
-};
+               local_irq_restore(flags);
 
-void __init init_IRQ_intc2(void)
-{
-       int i;
+               set_irq_chip_and_handler_name(p->irq, &intc2_irq_chip,
+                                             handle_level_irq, "level");
+               set_irq_chip_data(p->irq, p);
 
-       for (i = 0; i < ARRAY_SIZE(intc2_irq_table); i++)
-               make_intc2_irq(intc2_irq_table + i);
+               enable_intc2_irq(p->irq);
+       }
 }
index 8944abdf6e1c27bd6177458159202dc2661f9bb3..f7997312ef988e4016aa72411494eae994c34af6 100644 (file)
@@ -44,7 +44,7 @@ static void enable_ipr_irq(unsigned int irq)
 }
 
 static struct irq_chip ipr_irq_chip = {
-       .name           = "ipr",
+       .name           = "IPR",
        .mask           = disable_ipr_irq,
        .unmask         = enable_ipr_irq,
        .mask_ack       = disable_ipr_irq,
@@ -60,7 +60,8 @@ void make_ipr_irq(unsigned int irq, unsigned int addr, int pos, int priority)
        ipr_data.shift = pos*4; /* POSition (0-3) x 4 means shift */
        ipr_data.priority = priority;
 
-       set_irq_chip_and_handler(irq, &ipr_irq_chip, handle_level_irq);
+       set_irq_chip_and_handler_name(irq, &ipr_irq_chip,
+                                     handle_level_irq, "level");
        set_irq_chip_data(irq, &ipr_data);
 
        enable_ipr_irq(irq);
index 6be46f0686b77c1c8110185afd4b91d8fe67178a..ba3082d640b5f1d06191a7cc9671ee62a4bb111e 100644 (file)
@@ -4,7 +4,7 @@
  *  The SH-3 exception vector table.
 
  *  Copyright (C) 1999, 2000, 2002  Niibe Yutaka
- *  Copyright (C) 2003  Paul Mundt
+ *  Copyright (C) 2003 - 2006  Paul Mundt
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
@@ -49,3 +49,10 @@ ENTRY(nmi_slot)
 #endif
 ENTRY(user_break_point_trap)
        .long   break_point_trap        /* 1E0 */
+
+       /*
+        * Pad the remainder of the table out, exceptions residing in far
+        * away offsets can be manually inserted in to their appropriate
+        * location via set_exception_table_{evt,vec}().
+        */
+       .balign 4096,0,4096
index 3f4cd043e900ef5ae6cde1094d506598246d98a3..ac8ab57413cced9e802c5f77485be6e4b844d299 100644 (file)
@@ -4,7 +4,7 @@
  *  The SH-4 exception vector table.
 
  *  Copyright (C) 1999, 2000, 2002  Niibe Yutaka
- *  Copyright (C) 2003  Paul Mundt
+ *  Copyright (C) 2003 - 2006  Paul Mundt
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
@@ -53,3 +53,10 @@ ENTRY(nmi_slot)
 #endif
 ENTRY(user_break_point_trap)
        .long   break_point_trap        /* 1E0 */
+
+       /*
+        * Pad the remainder of the table out, exceptions residing in far
+        * away offsets can be manually inserted in to their appropriate
+        * location via set_exception_table_{evt,vec}().
+        */
+       .balign 4096,0,4096
index 97f1c9af35d652b46bc06af385477724816aa8b9..07e5377bf55016edfb299b52a9a0e2896db386df 100644 (file)
@@ -51,3 +51,66 @@ static int __init sh7760_devices_setup(void)
                                    ARRAY_SIZE(sh7760_devices));
 }
 __initcall(sh7760_devices_setup);
+
+/*
+ * SH7760 INTC2-Style interrupts, vectors IRQ48-111 INTEVT 0x800-0xFE0
+ */
+static struct intc2_data intc2_irq_table[] = {
+       /* INTPRIO0 | INTMSK0 */
+       {48,  0, 28, 0, 31,  3},        /* IRQ 4 */
+       {49,  0, 24, 0, 30,  3},        /* IRQ 3 */
+       {50,  0, 20, 0, 29,  3},        /* IRQ 2 */
+       {51,  0, 16, 0, 28,  3},        /* IRQ 1 */
+       /* 52-55 (INTEVT 0x880-0x8E0) unused/reserved */
+       /* INTPRIO4 | INTMSK0 */
+       {56,  4, 28, 0, 25,  3},        /* HCAN2_CHAN0 */
+       {57,  4, 24, 0, 24,  3},        /* HCAN2_CHAN1 */
+       {58,  4, 20, 0, 23,  3},        /* I2S_CHAN0   */
+       {59,  4, 16, 0, 22,  3},        /* I2S_CHAN1   */
+       {60,  4, 12, 0, 21,  3},        /* AC97_CHAN0  */
+       {61,  4,  8, 0, 20,  3},        /* AC97_CHAN1  */
+       {62,  4,  4, 0, 19,  3},        /* I2C_CHAN0   */
+       {63,  4,  0, 0, 18,  3},        /* I2C_CHAN1   */
+       /* INTPRIO8 | INTMSK0 */
+       {52,  8, 16, 0, 11,  3},        /* SCIF0_ERI_IRQ */
+       {53,  8, 16, 0, 10,  3},        /* SCIF0_RXI_IRQ */
+       {54,  8, 16, 0,  9,  3},        /* SCIF0_BRI_IRQ */
+       {55,  8, 16, 0,  8,  3},        /* SCIF0_TXI_IRQ */
+       {64,  8, 28, 0, 17,  3},        /* USBHI_IRQ */
+       {65,  8, 24, 0, 16,  3},        /* LCDC      */
+       /* 66, 67 unused */
+       {68,  8, 20, 0, 14, 13},        /* DMABRGI0_IRQ */
+       {69,  8, 20, 0, 13, 13},        /* DMABRGI1_IRQ */
+       {70,  8, 20, 0, 12, 13},        /* DMABRGI2_IRQ */
+       /* 71 unused */
+       {72,  8, 12, 0,  7,  3},        /* SCIF1_ERI_IRQ */
+       {73,  8, 12, 0,  6,  3},        /* SCIF1_RXI_IRQ */
+       {74,  8, 12, 0,  5,  3},        /* SCIF1_BRI_IRQ */
+       {75,  8, 12, 0,  4,  3},        /* SCIF1_TXI_IRQ */
+       {76,  8,  8, 0,  3,  3},        /* SCIF2_ERI_IRQ */
+       {77,  8,  8, 0,  2,  3},        /* SCIF2_RXI_IRQ */
+       {78,  8,  8, 0,  1,  3},        /* SCIF2_BRI_IRQ */
+       {79,  8,  8, 0,  0,  3},        /* SCIF2_TXI_IRQ */
+       /*          | INTMSK4 */
+       {80,  8,  4, 4, 23,  3},        /* SIM_ERI */
+       {81,  8,  4, 4, 22,  3},        /* SIM_RXI */
+       {82,  8,  4, 4, 21,  3},        /* SIM_TXI */
+       {83,  8,  4, 4, 20,  3},        /* SIM_TEI */
+       {84,  8,  0, 4, 19,  3},        /* HSPII */
+       /* INTPRIOC | INTMSK4 */
+       /* 85-87 unused/reserved */
+       {88, 12, 20, 4, 18,  3},        /* MMCI0 */
+       {89, 12, 20, 4, 17,  3},        /* MMCI1 */
+       {90, 12, 20, 4, 16,  3},        /* MMCI2 */
+       {91, 12, 20, 4, 15,  3},        /* MMCI3 */
+       {92, 12, 12, 4,  6,  3},        /* MFI (unsure, bug? in my 7760 manual*/
+       /* 93-107 reserved/undocumented */
+       {108,12,  4, 4,  1,  3},        /* ADC  */
+       {109,12,  0, 4,  0,  3},        /* CMTI */
+       /* 110-111 reserved/unused */
+};
+
+void __init init_IRQ_intc2(void)
+{
+       make_intc2_irq(intc2_irq_table, ARRAY_SIZE(intc2_irq_table));
+}
index 72493f259edccf63e6e187328c6dd5270d481622..814ddb226531c26c92ed78efd27aea24b5cd98db 100644 (file)
@@ -77,3 +77,30 @@ static int __init sh7780_devices_setup(void)
                                    ARRAY_SIZE(sh7780_devices));
 }
 __initcall(sh7780_devices_setup);
+
+static struct intc2_data intc2_irq_table[] = {
+       { TIMER_IRQ, 0, 24, 0, INTC_TMU0_MSK, 2 },
+       { 21, 1, 0, 0, INTC_RTC_MSK, TIMER_PRIORITY },
+       { 22, 1, 1, 0, INTC_RTC_MSK, TIMER_PRIORITY },
+       { 23, 1, 2, 0, INTC_RTC_MSK, TIMER_PRIORITY },
+       { SCIF0_ERI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
+       { SCIF0_RXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
+       { SCIF0_BRI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
+       { SCIF0_TXI_IRQ, 8, 24, 0, INTC_SCIF0_MSK, SCIF0_PRIORITY },
+
+       { SCIF1_ERI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
+       { SCIF1_RXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
+       { SCIF1_BRI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
+       { SCIF1_TXI_IRQ, 8, 16, 0, INTC_SCIF1_MSK, SCIF1_PRIORITY },
+
+       { PCIC0_IRQ, 0x10,  8, 0, INTC_PCIC0_MSK, PCIC0_PRIORITY },
+       { PCIC1_IRQ, 0x10,  0, 0, INTC_PCIC1_MSK, PCIC1_PRIORITY },
+       { PCIC2_IRQ, 0x14, 24, 0, INTC_PCIC2_MSK, PCIC2_PRIORITY },
+       { PCIC3_IRQ, 0x14, 16, 0, INTC_PCIC3_MSK, PCIC3_PRIORITY },
+       { PCIC4_IRQ, 0x14,  8, 0, INTC_PCIC4_MSK, PCIC4_PRIORITY },
+};
+
+void __init init_IRQ_intc2(void)
+{
+       make_intc2_irq(intc2_irq_table, ARRAY_SIZE(intc2_irq_table));
+}
index acf2602569c4928a5ecd6dc023ede793afd64d2e..944128ce97066ff46bc67cae6a5ce98a3717e9d6 100644 (file)
@@ -54,7 +54,7 @@ int show_interrupts(struct seq_file *p, void *v)
                for_each_online_cpu(j)
                        seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
                seq_printf(p, " %14s", irq_desc[i].chip->name);
-               seq_printf(p, "-%s", handle_irq_name(irq_desc[i].handle_irq));
+               seq_printf(p, "-%-8s", irq_desc[i].name);
                seq_printf(p, "  %s", action->name);
 
                for (action=action->next; action; action = action->next)
index 91516dca4a857180dacb51bd37b68c72ab3630e4..a52b13ac6b7f80a32e81a5daeef04a115de406da 100644 (file)
@@ -105,7 +105,7 @@ void show_regs(struct pt_regs * regs)
 {
        printk("\n");
        printk("Pid : %d, Comm: %20s\n", current->pid, current->comm);
-       print_symbol("PC is at %s\n", regs->pc);
+       print_symbol("PC is at %s\n", instruction_pointer(regs));
        printk("PC  : %08lx SP  : %08lx SR  : %08lx ",
               regs->pc, regs->regs[15], regs->sr);
 #ifdef CONFIG_MMU
@@ -130,15 +130,7 @@ void show_regs(struct pt_regs * regs)
        printk("MACH: %08lx MACL: %08lx GBR : %08lx PR  : %08lx\n",
               regs->mach, regs->macl, regs->gbr, regs->pr);
 
-       /*
-        * If we're in kernel mode, dump the stack too..
-        */
-       if (!user_mode(regs)) {
-               extern void show_task(unsigned long *sp);
-               unsigned long sp = regs->regs[15];
-
-               show_task((unsigned long *)sp);
-       }
+       show_trace(NULL, (unsigned long *)regs->regs[15], regs);
 }
 
 /*
index c2c597e0948242c780d4d369dff64c69dee14c59..53dfa55f3156b40327e977aef77d7fef08d5351e 100644 (file)
@@ -1,38 +1,25 @@
-/* $Id: traps.c,v 1.17 2004/05/02 01:46:30 sugioka Exp $
- *
- *  linux/arch/sh/traps.c
+/*
+ * 'traps.c' handles hardware traps and faults after we have saved some
+ * state in 'entry.S'.
  *
  *  SuperH version: Copyright (C) 1999 Niibe Yutaka
  *                  Copyright (C) 2000 Philipp Rumpf
  *                  Copyright (C) 2000 David Howells
- *                  Copyright (C) 2002, 2003 Paul Mundt
- */
-
-/*
- * 'Traps.c' handles hardware traps and faults after we have saved some
- * state in 'entry.S'.
+ *                  Copyright (C) 2002 - 2006 Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
  */
-#include <linux/sched.h>
 #include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/errno.h>
 #include <linux/ptrace.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/init.h>
-#include <linux/delay.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
 #include <linux/kallsyms.h>
-
+#include <linux/io.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
-#include <asm/io.h>
-#include <asm/atomic.h>
-#include <asm/processor.h>
-#include <asm/sections.h>
 
 #ifdef CONFIG_SH_KGDB
 #include <asm/kgdb.h>
 #define TRAP_ILLEGAL_SLOT_INST 13
 #endif
 
-/*
- * These constants are for searching for possible module text
- * segments.  VMALLOC_OFFSET comes from mm/vmalloc.c; MODULE_RANGE is
- * a guess of how much space is likely to be vmalloced.
- */
-#define VMALLOC_OFFSET (8*1024*1024)
-#define MODULE_RANGE (8*1024*1024)
+static void dump_mem(const char *str, unsigned long bottom, unsigned long top)
+{
+       unsigned long p;
+       int i;
+
+       printk("%s(0x%08lx to 0x%08lx)\n", str, bottom, top);
+
+       for (p = bottom & ~31; p < top; ) {
+               printk("%04lx: ", p & 0xffff);
+
+               for (i = 0; i < 8; i++, p += 4) {
+                       unsigned int val;
+
+                       if (p < bottom || p >= top)
+                               printk("         ");
+                       else {
+                               if (__get_user(val, (unsigned int __user *)p)) {
+                                       printk("\n");
+                                       return;
+                               }
+                               printk("%08x ", val);
+                       }
+               }
+               printk("\n");
+       }
+}
 
 DEFINE_SPINLOCK(die_lock);
 
@@ -69,14 +75,28 @@ void die(const char * str, struct pt_regs * regs, long err)
 
        console_verbose();
        spin_lock_irq(&die_lock);
+       bust_spinlocks(1);
+
        printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
+
        CHK_REMOTE_DEBUG(regs);
+       print_modules();
        show_regs(regs);
+
+       printk("Process: %s (pid: %d, stack limit = %p)\n",
+              current->comm, current->pid, task_stack_page(current) + 1);
+
+       if (!user_mode(regs) || in_interrupt())
+               dump_mem("Stack: ", regs->regs[15], THREAD_SIZE +
+                        (unsigned long)task_stack_page(current));
+
+       bust_spinlocks(0);
        spin_unlock_irq(&die_lock);
        do_exit(SIGSEGV);
 }
 
-static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err)
+static inline void die_if_kernel(const char *str, struct pt_regs *regs,
+                                long err)
 {
        if (!user_mode(regs))
                die(str, regs, err);
@@ -93,8 +113,7 @@ static int handle_unaligned_notify_count = 10;
  */
 static int die_if_no_fixup(const char * str, struct pt_regs * regs, long err)
 {
-       if (!user_mode(regs))
-       {
+       if (!user_mode(regs)) {
                const struct exception_table_entry *fixup;
                fixup = search_exception_tables(regs->pc);
                if (fixup) {
@@ -550,7 +569,10 @@ int is_dsp_inst(struct pt_regs *regs)
 #define is_dsp_inst(regs)      (0)
 #endif /* CONFIG_SH_DSP */
 
-extern int do_fpu_inst(unsigned short, struct pt_regs*);
+/* arch/sh/kernel/cpu/sh4/fpu.c */
+extern int do_fpu_inst(unsigned short, struct pt_regs *);
+extern asmlinkage void do_fpu_state_restore(unsigned long r4, unsigned long r5,
+               unsigned long r6, unsigned long r7, struct pt_regs regs);
 
 asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5,
                                unsigned long r6, unsigned long r7,
@@ -709,14 +731,20 @@ void __init per_cpu_trap_init(void)
                     : "memory");
 }
 
-void __init trap_init(void)
+void *set_exception_table_vec(unsigned int vec, void *handler)
 {
        extern void *exception_handling_table[];
+       void *old_handler;
+       
+       old_handler = exception_handling_table[vec];
+       exception_handling_table[vec] = handler;
+       return old_handler;
+}
 
-       exception_handling_table[TRAP_RESERVED_INST]
-               = (void *)do_reserved_inst;
-       exception_handling_table[TRAP_ILLEGAL_SLOT_INST]
-               = (void *)do_illegal_slot_inst;
+void __init trap_init(void)
+{
+       set_exception_table_vec(TRAP_RESERVED_INST, do_reserved_inst);
+       set_exception_table_vec(TRAP_ILLEGAL_SLOT_INST, do_illegal_slot_inst);
 
 #if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_FPU) || \
     defined(CONFIG_SH_FPU_EMU)
@@ -725,61 +753,54 @@ void __init trap_init(void)
         * reserved. They'll be handled in the math-emu case, or faulted on
         * otherwise.
         */
-       /* entry 64 corresponds to EXPEVT=0x800 */
-       exception_handling_table[64] = (void *)do_reserved_inst;
-       exception_handling_table[65] = (void *)do_illegal_slot_inst;
+       set_exception_table_evt(0x800, do_reserved_inst);
+       set_exception_table_evt(0x820, do_illegal_slot_inst);
+#elif defined(CONFIG_SH_FPU)
+       set_exception_table_evt(0x800, do_fpu_state_restore);
+       set_exception_table_evt(0x820, do_fpu_state_restore);
 #endif
                
        /* Setup VBR for boot cpu */
        per_cpu_trap_init();
 }
 
-void show_stack(struct task_struct *tsk, unsigned long *sp)
+void show_trace(struct task_struct *tsk, unsigned long *sp,
+               struct pt_regs *regs)
 {
-       unsigned long *stack, addr;
-       unsigned long module_start = VMALLOC_START;
-       unsigned long module_end = VMALLOC_END;
-       int i = 1;
-
-       if (!tsk)
-               tsk = current;
-       if (tsk == current)
-               sp = (unsigned long *)current_stack_pointer;
-       else
-               sp = (unsigned long *)tsk->thread.sp;
+       unsigned long addr;
 
-       stack = sp;
+       if (regs && user_mode(regs))
+               return;
 
        printk("\nCall trace: ");
 #ifdef CONFIG_KALLSYMS
        printk("\n");
 #endif
 
-       while (!kstack_end(stack)) {
-               addr = *stack++;
-               if (((addr >= (unsigned long)_text) &&
-                    (addr <= (unsigned long)_etext)) ||
-                   ((addr >= module_start) && (addr <= module_end))) {
-                       /*
-                        * For 80-columns display, 6 entry is maximum.
-                        * NOTE: '[<8c00abcd>] ' consumes 13 columns .
-                        */
-#ifndef CONFIG_KALLSYMS
-                       if (i && ((i % 6) == 0))
-                               printk("\n       ");
-#endif
-                       printk("[<%08lx>] ", addr);
-                       print_symbol("%s\n", addr);
-                       i++;
-               }
+       while (!kstack_end(sp)) {
+               addr = *sp++;
+               if (kernel_text_address(addr))
+                       print_ip_sym(addr);
        }
 
        printk("\n");
 }
 
-void show_task(unsigned long *sp)
+void show_stack(struct task_struct *tsk, unsigned long *sp)
 {
-       show_stack(NULL, sp);
+       unsigned long stack;
+
+       if (!tsk)
+               tsk = current;
+       if (tsk == current)
+               sp = (unsigned long *)current_stack_pointer;
+       else
+               sp = (unsigned long *)tsk->thread.sp;
+
+       stack = (unsigned long)sp;
+       dump_mem("Stack: ", stack, THREAD_SIZE +
+                (unsigned long)task_stack_page(tsk));
+       show_trace(tsk, sp, NULL);
 }
 
 void dump_stack(void)
index d08bd036ccb84268aaab9ad386849ab28b5ffc53..7b172160fe0415375d3e5bc1bbbcb00c6ed71105 100644 (file)
@@ -79,7 +79,7 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id)
        /* long to avoid size mismatch warnings from gcc */
        long fd;
        struct mconsole_entry *new;
-       struct mc_request req;
+       static struct mc_request req;   /* that's OK */
 
        fd = (long) dev_id;
        while (mconsole_get_request(fd, &req)){
@@ -91,6 +91,7 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id)
                                mconsole_reply(&req, "Out of memory", 1, 0);
                        else {
                                new->request = req;
+                               new->request.regs = get_irq_regs()->regs;
                                list_add(&new->list, &mc_requests);
                        }
                }
@@ -314,9 +315,21 @@ void mconsole_stop(struct mc_request *req)
 {
        deactivate_fd(req->originating_fd, MCONSOLE_IRQ);
        os_set_fd_block(req->originating_fd, 1);
-       mconsole_reply(req, "", 0, 0);
-       while(mconsole_get_request(req->originating_fd, req)){
-               if(req->cmd->handler == mconsole_go) break;
+       mconsole_reply(req, "stopped", 0, 0);
+       while (mconsole_get_request(req->originating_fd, req)) {
+               if (req->cmd->handler == mconsole_go)
+                       break;
+               if (req->cmd->handler == mconsole_stop) {
+                       mconsole_reply(req, "Already stopped", 1, 0);
+                       continue;
+               }
+               if (req->cmd->handler == mconsole_sysrq) {
+                       struct pt_regs *old_regs;
+                       old_regs = set_irq_regs((struct pt_regs *)&req->regs);
+                       mconsole_sysrq(req);
+                       set_irq_regs(old_regs);
+                       continue;
+               }
                (*req->cmd->handler)(req);
        }
        os_set_fd_block(req->originating_fd, 0);
@@ -673,9 +686,7 @@ static void with_console(struct mc_request *req, void (*proc)(void *),
 static void sysrq_proc(void *arg)
 {
        char *op = arg;
-       struct pt_regs *old_regs = set_irq_regs(&current->thread.regs);
        handle_sysrq(*op, NULL);
-       set_irq_regs(old_regs);
 }
 
 void mconsole_sysrq(struct mc_request *req)
index 17068eb746c0bda5204a8ffd49ee0ab5de16c46a..75aef6f7ef6e22dd9669f55f707021cd4f539d10 100644 (file)
@@ -14,6 +14,7 @@
 #include <sys/un.h>
 #include <unistd.h>
 #include "user.h"
+#include "sysdep/ptrace.h"
 #include "mconsole.h"
 #include "umid.h"
 #include "user_util.h"
index 58f67d3911052de522e01fb053edf2cbedd33549..2666815b6af57130cce633c759f0e8d86ebf9d12 100644 (file)
@@ -61,6 +61,7 @@ struct mc_request
 
        struct mconsole_request request;
        struct mconsole_command *cmd;
+       union uml_pt_regs regs;
 };
 
 extern char mconsole_socket_name[];
index 1c0f18d4f887a574734df7b6302ef8c362b8533d..13972148058dac9cae6c7e2829bf4c5b73b78bd9 100644 (file)
@@ -54,6 +54,10 @@ endif
 cflags-y += $(call cc-option,-funit-at-a-time)
 # prevent gcc from generating any FP code by mistake
 cflags-y += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
+# this works around some issues with generating unwind tables in older gccs
+# newer gccs do it by default
+cflags-y += -maccumulate-outgoing-args
+
 # do binutils support CFI?
 cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
 AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
index 47bfba6e9dc4d3d93ce8110d2eb13bf8b984eecb..0f5d44e86be56d8b3f61a2f204d24a720b6ef92d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.19-rc1
-# Thu Oct  5 13:04:43 2006
+# Linux kernel version: 2.6.19-rc2-git4
+# Sat Oct 21 03:38:52 2006
 #
 CONFIG_X86_64=y
 CONFIG_64BIT=y
@@ -335,8 +335,8 @@ CONFIG_IPV6=y
 # CONFIG_INET6_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET6_XFRM_MODE_BEET is not set
 # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=y
 # CONFIG_IPV6_TUNNEL is not set
-# CONFIG_IPV6_SUBTREES is not set
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
@@ -437,6 +437,13 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 
+#
+# Misc devices
+#
+# CONFIG_IBM_ASM is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+
 #
 # ATA/ATAPI/MFM/RLL support
 #
@@ -1008,6 +1015,7 @@ CONFIG_I2C_ISA=m
 #
 # Dallas's 1-wire bus
 #
+# CONFIG_W1 is not set
 
 #
 # Hardware Monitoring support
@@ -1058,12 +1066,6 @@ CONFIG_SENSORS_SMSC47B397=m
 # CONFIG_SENSORS_HDAPS is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
 
-#
-# Misc devices
-#
-# CONFIG_IBM_ASM is not set
-# CONFIG_TIFM_CORE is not set
-
 #
 # Multimedia devices
 #
@@ -1196,7 +1198,6 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
-# CONFIG_USB_TRANCEVIBRATOR is not set
 
 #
 # USB Imaging devices
@@ -1242,6 +1243,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -1318,6 +1320,7 @@ CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 CONFIG_EXT3_FS_POSIX_ACL=y
 # CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
@@ -1341,6 +1344,7 @@ CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 CONFIG_AUTOFS4_FS=y
 # CONFIG_FUSE_FS is not set
+CONFIG_GENERIC_ACL=y
 
 #
 # CD-ROM/DVD Filesystems
@@ -1418,7 +1422,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
 # CONFIG_9P_FS is not set
-CONFIG_GENERIC_ACL=y
 
 #
 # Partition Types
@@ -1470,10 +1473,6 @@ CONFIG_NLS_ISO8859_15=y
 # CONFIG_NLS_KOI8_U is not set
 CONFIG_NLS_UTF8=y
 
-#
-# Distributed Lock Manager
-#
-
 #
 # Instrumentation Support
 #
@@ -1512,6 +1511,7 @@ CONFIG_DEBUG_FS=y
 CONFIG_UNWIND_INFO=y
 CONFIG_STACK_UNWIND=y
 # CONFIG_FORCED_INLINING is not set
+# CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_LKDTM is not set
 # CONFIG_DEBUG_RODATA is not set
index b3f0908668ece23c11fc4d42675f011aab808821..a75c829c2b02b16bf23ea495a326d0307cd9685b 100644 (file)
@@ -54,13 +54,13 @@ static inline int bad_addr(unsigned long *addrp, unsigned long size)
 
        /* various gunk below that needed for SMP startup */
        if (addr < 0x8000) { 
-               *addrp = 0x8000;
+               *addrp = PAGE_ALIGN(0x8000);
                return 1; 
        }
 
        /* direct mapping tables of the kernel */
        if (last >= table_start<<PAGE_SHIFT && addr < table_end<<PAGE_SHIFT) { 
-               *addrp = table_end << PAGE_SHIFT; 
+               *addrp = PAGE_ALIGN(table_end << PAGE_SHIFT);
                return 1;
        } 
 
@@ -68,18 +68,18 @@ static inline int bad_addr(unsigned long *addrp, unsigned long size)
 #ifdef CONFIG_BLK_DEV_INITRD
        if (LOADER_TYPE && INITRD_START && last >= INITRD_START && 
            addr < INITRD_START+INITRD_SIZE) { 
-               *addrp = INITRD_START + INITRD_SIZE; 
+               *addrp = PAGE_ALIGN(INITRD_START + INITRD_SIZE);
                return 1;
        } 
 #endif
        /* kernel code */
-       if (last >= __pa_symbol(&_text) && last < __pa_symbol(&_end)) {
-               *addrp = __pa_symbol(&_end);
+       if (last >= __pa_symbol(&_text) && addr < __pa_symbol(&_end)) {
+               *addrp = PAGE_ALIGN(__pa_symbol(&_end));
                return 1;
        }
 
        if (last >= ebda_addr && addr < ebda_addr + ebda_size) {
-               *addrp = ebda_addr + ebda_size;
+               *addrp = PAGE_ALIGN(ebda_addr + ebda_size);
                return 1;
        }
 
@@ -152,7 +152,7 @@ unsigned long __init find_e820_area(unsigned long start, unsigned long end, unsi
                        continue; 
                while (bad_addr(&addr, size) && addr+size <= ei->addr+ei->size)
                        ;
-               last = addr + size;
+               last = PAGE_ALIGN(addr) + size;
                if (last > ei->addr + ei->size)
                        continue;
                if (last > end) 
index 208e38a372c107f0704dd16e77f56437c404f1e4..2b1245d8625849de6033eda814ed72b860faf232 100644 (file)
@@ -61,10 +61,11 @@ static void nvidia_bugs(void)
 
 static void ati_bugs(void)
 {
-#if 1 /* for testing */
-       printk("ATI board detected\n");
-#endif
-       /* No bugs right now */
+       if (timer_over_8254 == 1) {
+               timer_over_8254 = 0;
+               printk(KERN_INFO
+               "ATI board detected. Disabling timer routing over 8254.\n");
+       }
 }
 
 struct chipset {
index 38a7b2d528e2e537b78d13bc83e36dbb25f79c10..7d401b00d8227dbd6182524259a402822a903db6 100644 (file)
@@ -315,6 +315,8 @@ tracesys:
        LOAD_ARGS ARGOFFSET  /* reload args from stack in case ptrace changed it */
        RESTORE_REST
        cmpq $__NR_syscall_max,%rax
+       movq $-ENOSYS,%rcx
+       cmova %rcx,%rax
        ja  1f
        movq %r10,%rcx  /* fixup for C */
        call *sys_call_table(,%rax,8)
@@ -535,8 +537,6 @@ END(stub_rt_sigreturn)
 1:     incl    %gs:pda_irqcount
        cmoveq %gs:pda_irqstackptr,%rsp
        push    %rbp                    # backlink for old unwinder
-       CFI_ADJUST_CFA_OFFSET 8
-       CFI_REL_OFFSET rbp,0
        /*
         * We entered an interrupt context - irqs are off:
         */
@@ -980,11 +980,6 @@ ENTRY(kernel_thread)
        call do_fork
        movq %rax,RAX(%rsp)
        xorl %edi,%edi
-       test %rax,%rax
-       jnz  1f
-       /* terminate stack in child */
-       movq %rdi,RIP(%rsp)
-1:
 
        /*
         * It isn't worth to check for reschedule here,
@@ -1176,7 +1171,6 @@ ENTRY(call_softirq)
        incl %gs:pda_irqcount
        cmove %gs:pda_irqstackptr,%rsp
        push  %rbp                      # backlink for old unwinder
-       CFI_ADJUST_CFA_OFFSET    8
        call __do_softirq
        leaveq
        CFI_DEF_CFA_REGISTER    rsp
index 0dfc223c1839c9bbd58473f108b63f517177d2a4..7c01db8fa9d122eaf2adcff1e0927ec98a2e17e3 100644 (file)
@@ -153,7 +153,7 @@ struct genapic apic_flat =  {
 
 static cpumask_t physflat_target_cpus(void)
 {
-       return cpumask_of_cpu(0);
+       return cpu_online_map;
 }
 
 static cpumask_t physflat_vector_allocation_domain(int cpu)
index 49e94f7994c54f29fcc067533ab41563213b00bb..fe429e5d6b29044591f37b3b57e01f0759cbdabd 100644 (file)
@@ -57,13 +57,13 @@ static int no_timer_check;
 
 static int disable_timer_pin_1 __initdata;
 
-int timer_over_8254 __initdata = 0;
+int timer_over_8254 __initdata = 1;
 
 /* Where if anywhere is the i8259 connect in external int mode */
 static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
 
 static DEFINE_SPINLOCK(ioapic_lock);
-static DEFINE_SPINLOCK(vector_lock);
+DEFINE_SPINLOCK(vector_lock);
 
 /*
  * # of IRQ routing registers
@@ -612,15 +612,15 @@ static int __assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result)
         * Also, we've got to be careful not to trash gate
         * 0x80, because int 0x80 is hm, kind of importantish. ;)
         */
-       static struct {
-               int vector;
-               int offset;
-       } pos[NR_CPUS] = { [ 0 ... NR_CPUS - 1] = {FIRST_DEVICE_VECTOR, 0} };
+       static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0;
        int old_vector = -1;
        int cpu;
 
        BUG_ON((unsigned)irq >= NR_IRQ_VECTORS);
 
+       /* Only try and allocate irqs on cpus that are present */
+       cpus_and(mask, mask, cpu_online_map);
+
        if (irq_vector[irq] > 0)
                old_vector = irq_vector[irq];
        if (old_vector > 0) {
@@ -630,15 +630,15 @@ static int __assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result)
        }
 
        for_each_cpu_mask(cpu, mask) {
-               cpumask_t domain;
-               int first, new_cpu;
+               cpumask_t domain, new_mask;
+               int new_cpu;
                int vector, offset;
 
                domain = vector_allocation_domain(cpu);
-               first = first_cpu(domain);
+               cpus_and(new_mask, domain, cpu_online_map);
 
-               vector = pos[first].vector;
-               offset = pos[first].offset;
+               vector = current_vector;
+               offset = current_offset;
 next:
                vector += 8;
                if (vector >= FIRST_SYSTEM_VECTOR) {
@@ -646,24 +646,24 @@ next:
                        offset = (offset + 1) % 8;
                        vector = FIRST_DEVICE_VECTOR + offset;
                }
-               if (unlikely(pos[first].vector == vector))
+               if (unlikely(current_vector == vector))
                        continue;
                if (vector == IA32_SYSCALL_VECTOR)
                        goto next;
-               for_each_cpu_mask(new_cpu, domain)
-                       if (per_cpu(vector_irq, cpu)[vector] != -1)
+               for_each_cpu_mask(new_cpu, new_mask)
+                       if (per_cpu(vector_irq, new_cpu)[vector] != -1)
                                goto next;
                /* Found one! */
-               for_each_cpu_mask(new_cpu, domain) {
-                       pos[cpu].vector = vector;
-                       pos[cpu].offset = offset;
-               }
+               current_vector = vector;
+               current_offset = offset;
                if (old_vector >= 0) {
+                       cpumask_t old_mask;
                        int old_cpu;
-                       for_each_cpu_mask(old_cpu, irq_domain[irq])
+                       cpus_and(old_mask, irq_domain[irq], cpu_online_map);
+                       for_each_cpu_mask(old_cpu, old_mask)
                                per_cpu(vector_irq, old_cpu)[old_vector] = -1;
                }
-               for_each_cpu_mask(new_cpu, domain)
+               for_each_cpu_mask(new_cpu, new_mask)
                        per_cpu(vector_irq, new_cpu)[vector] = irq;
                irq_vector[irq] = vector;
                irq_domain[irq] = domain;
@@ -684,6 +684,32 @@ static int assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result)
        return vector;
 }
 
+void __setup_vector_irq(int cpu)
+{
+       /* Initialize vector_irq on a new cpu */
+       /* This function must be called with vector_lock held */
+       unsigned long flags;
+       int irq, vector;
+
+
+       /* Mark the inuse vectors */
+       for (irq = 0; irq < NR_IRQ_VECTORS; ++irq) {
+               if (!cpu_isset(cpu, irq_domain[irq]))
+                       continue;
+               vector = irq_vector[irq];
+               per_cpu(vector_irq, cpu)[vector] = irq;
+       }
+       /* Mark the free vectors */
+       for (vector = 0; vector < NR_VECTORS; ++vector) {
+               irq = per_cpu(vector_irq, cpu)[vector];
+               if (irq < 0)
+                       continue;
+               if (!cpu_isset(cpu, irq_domain[irq]))
+                       per_cpu(vector_irq, cpu)[vector] = -1;
+       }
+}
+
+
 extern void (*interrupt[NR_IRQS])(void);
 
 static struct irq_chip ioapic_chip;
@@ -1255,12 +1281,15 @@ static int ioapic_retrigger_irq(unsigned int irq)
 {
        cpumask_t mask;
        unsigned vector;
+       unsigned long flags;
 
+       spin_lock_irqsave(&vector_lock, flags);
        vector = irq_vector[irq];
        cpus_clear(mask);
-       cpu_set(vector >> 8, mask);
+       cpu_set(first_cpu(irq_domain[irq]), mask);
 
-       send_IPI_mask(mask, vector & 0xff);
+       send_IPI_mask(mask, vector);
+       spin_unlock_irqrestore(&vector_lock, flags);
 
        return 1;
 }
index b3296cc2f2f2fd3b7ea84bb17abfec30ee877625..37a770859e7180ae38e06c22d6064fbe1a4ebeab 100644 (file)
@@ -52,7 +52,8 @@
 #define ONE_BASED_CHASSIS_NUM   1
 
 /* register offsets inside the host bridge space */
-#define PHB_CSR_OFFSET         0x0110
+#define CALGARY_CONFIG_REG     0x0108
+#define PHB_CSR_OFFSET         0x0110 /* Channel Status */
 #define PHB_PLSSR_OFFSET       0x0120
 #define PHB_CONFIG_RW_OFFSET   0x0160
 #define PHB_IOBASE_BAR_LOW     0x0170
@@ -83,6 +84,8 @@
 #define TAR_VALID              0x0000000000000008UL
 /* CSR (Channel/DMA Status Register) */
 #define CSR_AGENT_MASK         0xffe0ffff
+/* CCR (Calgary Configuration Register) */
+#define CCR_2SEC_TIMEOUT        0x000000000000000EUL
 
 #define MAX_NUM_OF_PHBS                8 /* how many PHBs in total? */
 #define MAX_NUM_CHASSIS                8 /* max number of chassis */
@@ -732,6 +735,38 @@ static void calgary_watchdog(unsigned long data)
        }
 }
 
+static void __init calgary_increase_split_completion_timeout(void __iomem *bbar,
+       unsigned char busnum)
+{
+       u64 val64;
+       void __iomem *target;
+       unsigned long phb_shift = -1;
+       u64 mask;
+
+       switch (busno_to_phbid(busnum)) {
+       case 0: phb_shift = (63 - 19);
+               break;
+       case 1: phb_shift = (63 - 23);
+               break;
+       case 2: phb_shift = (63 - 27);
+               break;
+       case 3: phb_shift = (63 - 35);
+               break;
+       default:
+               BUG_ON(busno_to_phbid(busnum));
+       }
+
+       target = calgary_reg(bbar, CALGARY_CONFIG_REG);
+       val64 = be64_to_cpu(readq(target));
+
+       /* zero out this PHB's timer bits */
+       mask = ~(0xFUL << phb_shift);
+       val64 &= mask;
+       val64 |= (CCR_2SEC_TIMEOUT << phb_shift);
+       writeq(cpu_to_be64(val64), target);
+       readq(target); /* flush */
+}
+
 static void __init calgary_enable_translation(struct pci_dev *dev)
 {
        u32 val32;
@@ -756,6 +791,13 @@ static void __init calgary_enable_translation(struct pci_dev *dev)
        writel(cpu_to_be32(val32), target);
        readl(target); /* flush */
 
+       /*
+        * Give split completion a longer timeout on bus 1 for aic94xx
+        * http://bugzilla.kernel.org/show_bug.cgi?id=7180
+        */
+       if (busnum == 1)
+               calgary_increase_split_completion_timeout(bbar, busnum);
+
        init_timer(&tbl->watchdog_timer);
        tbl->watchdog_timer.function = &calgary_watchdog;
        tbl->watchdog_timer.data = (unsigned long)dev;
index 7b7a6870288ac8dd2ae0188622d353949780c577..62c2e747af58006a917d279150254a280aa9f364 100644 (file)
@@ -581,12 +581,16 @@ void __cpuinit start_secondary(void)
         * smp_call_function().
         */
        lock_ipi_call_lock();
+       spin_lock(&vector_lock);
 
+       /* Setup the per cpu irq handling data structures */
+       __setup_vector_irq(smp_processor_id());
        /*
         * Allow the master to continue.
         */
        cpu_set(smp_processor_id(), cpu_online_map);
        per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
+       spin_unlock(&vector_lock);
        unlock_ipi_call_lock();
 
        cpu_idle();
@@ -799,7 +803,6 @@ static int __cpuinit do_boot_cpu(int cpu, int apicid)
                                cpu, node);
        }
 
-
        alternatives_smp_switch(1);
 
        c_idle.idle = get_idle_for_cpu(cpu);
@@ -1246,8 +1249,10 @@ int __cpu_disable(void)
        local_irq_disable();
        remove_siblinginfo(cpu);
 
+       spin_lock(&vector_lock);
        /* It's now safe to remove this processor from the online map */
        cpu_clear(cpu, cpu_online_map);
+       spin_unlock(&vector_lock);
        remove_cpu_from_maps();
        fixup_irqs(cpu_online_map);
        return 0;
index 1ba5a442ac323a9dc121fabbe92c46527fcb2745..88722f11ca132595cf11704e8e65cdb47e2790f9 100644 (file)
@@ -948,7 +948,7 @@ __cpuinit int unsynchronized_tsc(void)
        if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
 #ifdef CONFIG_ACPI
                /* But TSC doesn't tick in C3 so don't use it there */
-               if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 100)
+               if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 1000)
                        return 1;
 #endif
                return 0;
index b9df2ab6529fc8286b00f41d2081d393bbb2b444..1283614c9b247674ee75fd865744c9a95d902379 100644 (file)
@@ -17,6 +17,7 @@ PHDRS {
        text PT_LOAD FLAGS(5);  /* R_E */
        data PT_LOAD FLAGS(7);  /* RWE */
        user PT_LOAD FLAGS(7);  /* RWE */
+       data.init PT_LOAD FLAGS(7);     /* RWE */
        note PT_NOTE FLAGS(4);  /* R__ */
 }
 SECTIONS
@@ -131,7 +132,7 @@ SECTIONS
   . = ALIGN(8192);             /* init_task */
   .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
        *(.data.init_task)
-  } :data
+  }:data.init
 
   . = ALIGN(4096);
   .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
index 3cc0544e25f5a8569af1a727c3f819b252fe3635..1087e150a21896d1abfaadfccfe7fc4de98728ef 100644 (file)
@@ -207,7 +207,7 @@ static inline int save_add_info(void)
        return hotadd_percent > 0;
 }
 #else
-int update_end_of_memory(unsigned long end) {return 0;}
+int update_end_of_memory(unsigned long end) {return -1;}
 static int hotadd_enough_memory(struct bootnode *nd) {return 1;}
 #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
 static inline int save_add_info(void) {return 1;}
@@ -337,7 +337,7 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
        push_node_boundaries(node, nd->start >> PAGE_SHIFT,
                                                nd->end >> PAGE_SHIFT);
 
-       if (ma->flags.hot_pluggable && !reserve_hotadd(node, start, end) < 0) {
+       if (ma->flags.hot_pluggable && (reserve_hotadd(node, start, end) < 0)) {
                /* Ignore hotadd region. Undo damage */
                printk(KERN_NOTICE "SRAT: Hotplug region ignored\n");
                *nd = oldnode;
index 1eb18f421edff11924187e8242781bd68116a168..149aba05a5b8e70c6abb22dd17e21b1f1994adf4 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Reuse the i386 PCI subsystem
 #
-CFLAGS += -Iarch/i386/pci
+EXTRA_CFLAGS += -Iarch/i386/pci
 
 obj-y          := i386.o
 obj-$(CONFIG_PCI_DIRECT)+= direct.o
index 3f4aa0c99ee4dccaf096330732887bc5be153f79..03f6338acc8fb7223e040078b1f196d28835c444 100644 (file)
@@ -6,6 +6,7 @@ menu "Serial ATA (prod) and Parallel ATA (experimental) drivers"
 
 config ATA
        tristate "ATA device support"
+       depends on BLOCK
        depends on !(M32R || M68K) || BROKEN
        depends on !SUN4 || BROKEN
        select SCSI
index 25929123ffff3fdd6a927aa4113a232c2c074708..cef2e70d64f8d57d2e62bbec19a5fda752e05d40 100644 (file)
@@ -1041,7 +1041,7 @@ static void ahci_host_intr(struct ata_port *ap)
        /* hmmm... a spurious interupt */
 
        /* some devices send D2H reg with I bit set during NCQ command phase */
-       if (ap->sactive && status & PORT_IRQ_D2H_REG_FIS)
+       if (ap->sactive && (status & PORT_IRQ_D2H_REG_FIS))
                return;
 
        /* ignore interim PIO setup fis interrupts */
index 5719704eb0ee5a6d5699399cf2edb3b12f174f18..5250187ffce2a610f456e3814d019bc3a4b656b6 100644 (file)
@@ -432,9 +432,9 @@ static const struct piix_map_db ich8_map_db = {
        .present_shift = 8,
        .map = {
                /* PM   PS   SM   SS       MAP */
-               {  P0,  NA,  P1,  NA }, /* 00b (hardwired) */
+               {  P0,  P2,  P1,  P3 }, /* 00b (hardwired when in AHCI) */
                {  RV,  RV,  RV,  RV },
-               {  RV,  RV,  RV,  RV }, /* 10b (never) */
+               {  IDE,  IDE,  NA,  NA }, /* 10b (IDE mode) */
                {  RV,  RV,  RV,  RV },
        },
 };
index 06daaa3736a2cbcd35efde2e377d0ad90cfc5d98..7645f2b30ccf2f35547025ed3f07e85700dcf9eb 100644 (file)
@@ -981,6 +981,15 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
                mask = (1 << 2) | (1 << 0);
                if ((tmp8 & mask) != mask)
                        legacy_mode = (1 << 3);
+#if defined(CONFIG_NO_ATA_LEGACY)
+               /* Some platforms with PCI limits cannot address compat
+                  port space. In that case we punt if their firmware has
+                  left a device in compatibility mode */
+               if (legacy_mode) {
+                       printk(KERN_ERR "ata: Compatibility mode ATA is not supported on this platform, skipping.\n");
+                       return -EOPNOTSUPP;
+               }
+#endif
        }
 
        rc = pci_request_regions(pdev, DRV_NAME);
index 323592de047b5fecc58c13f382b05e2da985c27e..9fffa7af6db1f5c2feaf448fd7dec744e41ab308 100644 (file)
@@ -2452,8 +2452,8 @@ static int __init amb_module_init (void)
 static void __exit amb_module_exit (void)
 {
   PRINTD (DBG_FLOW|DBG_INIT, "cleanup_module");
-  
-  return pci_unregister_driver(&amb_driver);
+
+  pci_unregister_driver(&amb_driver);
 }
 
 module_init(amb_module_init);
index 40ab9b65fae9ecc57aeea36a35b99cd0b38bedac..697ad82f6634e2f74e4c3298d17f6ac13d0162cc 100644 (file)
@@ -1002,6 +1002,10 @@ static int fs_open(struct atm_vcc *atm_vcc)
                                        r = ROUND_UP;
                                }
                                error = make_rate (pcr, r, &tmc0, NULL);
+                               if (error) {
+                                       kfree(tc);
+                                       return error;
+                               }
                        }
                        fs_dprintk (FS_DEBUG_OPEN, "pcr = %d.\n", pcr);
                }
index f59349206dd29f9a918cad1531dfc26ce07e91a5..4dc10105d61023311586f6f930950d4dc04d44ea 100644 (file)
@@ -1789,7 +1789,7 @@ static inline void CLOCK_IT (const hrz_dev *dev, u32 ctrl)
        WRITE_IT_WAIT(dev, ctrl | SEEPROM_SK);
 }
 
-static u16 __init read_bia (const hrz_dev * dev, u16 addr)
+static u16 __devinit read_bia (const hrz_dev * dev, u16 addr)
 {
   u32 ctrl = rd_regl (dev, CONTROL_0_REG);
   
@@ -2932,8 +2932,8 @@ static int __init hrz_module_init (void) {
 
 static void __exit hrz_module_exit (void) {
   PRINTD (DBG_FLOW, "cleanup_module");
-  
-  return pci_unregister_driver(&hrz_driver);
+
+  pci_unregister_driver(&hrz_driver);
 }
 
 module_init(hrz_module_init);
index 632ede552761cb92c7276b16542e998a5f1d0db5..bd09045948054ab836fe3b14f9f0384a85b08f86 100644 (file)
@@ -2759,7 +2759,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
 {
    ns_dev *card;
    pool_levels pl;
-   int btype;
+   long btype;
    unsigned long flags;
 
    card = dev->dev_data;
@@ -2859,7 +2859,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
       case NS_ADJBUFLEV:
          if (!capable(CAP_NET_ADMIN))
            return -EPERM;
-         btype = (int) arg;    /* an int is the same size as a pointer */
+         btype = (long) arg;   /* a long is the same size as a pointer or bigger */
          switch (btype)
         {
            case NS_BUFTYPE_SMALL:
index dcccaf2782f350cd68efa6fd431a0dc90cd05289..bc6602606fb541726f1537f610cc4d80d340ca2d 100644 (file)
@@ -1923,7 +1923,6 @@ static void cciss_geometry_inquiry(int ctlr, int logvol,
 {
        int return_code;
        unsigned long t;
-       unsigned long rem;
 
        memset(inq_buff, 0, sizeof(InquiryData_struct));
        if (withirq)
@@ -1939,26 +1938,23 @@ static void cciss_geometry_inquiry(int ctlr, int logvol,
                        printk(KERN_WARNING
                               "cciss: reading geometry failed, volume "
                               "does not support reading geometry\n");
-                       drv->block_size = block_size;
-                       drv->nr_blocks = total_size;
                        drv->heads = 255;
                        drv->sectors = 32;      // Sectors per track
-                       t = drv->heads * drv->sectors;
-                       drv->cylinders = total_size;
-                       rem = do_div(drv->cylinders, t);
                } else {
-                       drv->block_size = block_size;
-                       drv->nr_blocks = total_size;
                        drv->heads = inq_buff->data_byte[6];
                        drv->sectors = inq_buff->data_byte[7];
                        drv->cylinders = (inq_buff->data_byte[4] & 0xff) << 8;
                        drv->cylinders += inq_buff->data_byte[5];
                        drv->raid_level = inq_buff->data_byte[8];
-                       t = drv->heads * drv->sectors;
-                       if (t > 1) {
-                               drv->cylinders = total_size;
-                               rem = do_div(drv->cylinders, t);
-                       }
+               }
+               drv->block_size = block_size;
+               drv->nr_blocks = total_size;
+               t = drv->heads * drv->sectors;
+               if (t > 1) {
+                       unsigned rem = sector_div(total_size, t);
+                       if (rem)
+                               total_size++;
+                       drv->cylinders = total_size;
                }
        } else {                /* Get geometry failed */
                printk(KERN_WARNING "cciss: reading geometry failed\n");
index 91b71e750ee15f16a0372a3f7d8559c4fa2d6d72..dffc19382f7eb828f73426e91b7524f5ffce3305 100644 (file)
 static int uninorth_rev;
 static int is_u3;
 
+static char __devinitdata *aperture = NULL;
 
 static int uninorth_fetch_size(void)
 {
-       int i;
-       u32 temp;
-       struct aper_size_info_32 *values;
-
-       pci_read_config_dword(agp_bridge->dev, UNI_N_CFG_GART_BASE, &temp);
-       temp &= ~(0xfffff000);
-       values = A_SIZE_32(agp_bridge->driver->aperture_sizes);
-
-       for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) {
-               if (temp == values[i].size_value) {
-                       agp_bridge->previous_size =
-                           agp_bridge->current_size = (void *) (values + i);
-                       agp_bridge->aperture_size_idx = i;
-                       return values[i].size;
+       int i, size = 0;
+       struct aper_size_info_32 *values =
+           A_SIZE_32(agp_bridge->driver->aperture_sizes);
+
+       if (aperture) {
+               char *save = aperture;
+
+               size = memparse(aperture, &aperture) >> 20;
+               aperture = save;
+
+               for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++)
+                       if (size == values[i].size)
+                               break;
+
+               if (i == agp_bridge->driver->num_aperture_sizes) {
+                       printk(KERN_ERR PFX "Invalid aperture size, using"
+                              " default\n");
+                       size = 0;
+                       aperture = NULL;
                }
        }
 
-       agp_bridge->previous_size =
-           agp_bridge->current_size = (void *) (values + 1);
-       agp_bridge->aperture_size_idx = 1;
-       return values[1].size;
+       if (!size) {
+               for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++)
+                       if (values[i].size == 32)
+                               break;
+       }
 
-       return 0;
+       agp_bridge->previous_size =
+           agp_bridge->current_size = (void *)(values + i);
+       agp_bridge->aperture_size_idx = i;
+       return values[i].size;
 }
 
 static void uninorth_tlbflush(struct agp_memory *mem)
@@ -683,5 +693,11 @@ static void __exit agp_uninorth_cleanup(void)
 module_init(agp_uninorth_init);
 module_exit(agp_uninorth_cleanup);
 
+module_param(aperture, charp, 0);
+MODULE_PARM_DESC(aperture,
+                "Aperture size, must be power of two between 4MB and an\n"
+                "\t\tupper limit specific to the UniNorth revision.\n"
+                "\t\tDefault: 32M");
+
 MODULE_AUTHOR("Ben Herrenschmidt & Paul Mackerras");
 MODULE_LICENSE("GPL");
index 029baea33b628772bb0f238acb3d59392117fa9c..6eafff13dab6b8290ccc788adbbbcc22619c4b9a 100644 (file)
@@ -237,6 +237,8 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset,
 
        list = drm_alloc(sizeof(*list), DRM_MEM_MAPS);
        if (!list) {
+               if (map->type == _DRM_REGISTERS)
+                       drm_ioremapfree(map->handle, map->size, dev);
                drm_free(map, sizeof(*map), DRM_MEM_MAPS);
                return -EINVAL;
        }
@@ -252,6 +254,8 @@ static int drm_addmap_core(drm_device_t * dev, unsigned int offset,
                map->offset;
        ret = drm_map_handle(dev, &list->hash, user_token, 0);
        if (ret) {
+               if (map->type == _DRM_REGISTERS)
+                       drm_ioremapfree(map->handle, map->size, dev);
                drm_free(map, sizeof(*map), DRM_MEM_MAPS);
                drm_free(list, sizeof(*list), DRM_MEM_MAPS);
                mutex_unlock(&dev->struct_mutex);
index 51ad98c685c3d9d102e0a0ae92e7c3c444780d98..ba4b8de83cf0feda86f5d126534a56fd814fd33f 100644 (file)
@@ -42,13 +42,24 @@ static CLASS_ATTR(version, S_IRUGO, version_show, NULL);
 struct class *drm_sysfs_create(struct module *owner, char *name)
 {
        struct class *class;
+       int err;
 
        class = class_create(owner, name);
-       if (!class)
-               return class;
+       if (!class) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+
+       err = class_create_file(class, &class_attr_version);
+       if (err)
+               goto err_out_class;
 
-       class_create_file(class, &class_attr_version);
        return class;
+
+err_out_class:
+       class_destroy(class);
+err_out:
+       return ERR_PTR(err);
 }
 
 /**
@@ -96,20 +107,36 @@ static struct class_device_attribute class_device_attrs[] = {
 struct class_device *drm_sysfs_device_add(struct class *cs, drm_head_t *head)
 {
        struct class_device *class_dev;
-       int i;
+       int i, j, err;
 
        class_dev = class_device_create(cs, NULL,
                                        MKDEV(DRM_MAJOR, head->minor),
                                        &(head->dev->pdev)->dev,
                                        "card%d", head->minor);
-       if (!class_dev)
-               return NULL;
+       if (!class_dev) {
+               err = -ENOMEM;
+               goto err_out;
+       }
 
        class_set_devdata(class_dev, head);
 
-       for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++)
-               class_device_create_file(class_dev, &class_device_attrs[i]);
+       for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++) {
+               err = class_device_create_file(class_dev,
+                                              &class_device_attrs[i]);
+               if (err)
+                       goto err_out_files;
+       }
+
        return class_dev;
+
+err_out_files:
+       if (i > 0)
+               for (j = 0; j < i; j++)
+                       class_device_remove_file(class_dev,
+                                                &class_device_attrs[i]);
+       class_device_unregister(class_dev);
+err_out:
+       return ERR_PTR(err);
 }
 
 /**
index e30f556b79f10b1a82c372c9cd8969d1aabce830..be49dbb9ec3f8530382c194e3d86bf614fd891b5 100644 (file)
@@ -47,6 +47,7 @@ static struct drm_driver driver = {
            DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA |
            DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED |
            DRIVER_IRQ_VBL,
+       .dev_priv_size = sizeof(drm_mga_buf_priv_t),
        .load = mga_driver_load,
        .unload = mga_driver_unload,
        .lastclose = mga_driver_lastclose,
index 26bdf2ca59d759cd581a6a301660c88f0a0364f1..d14477ba3679ef34743c6ba0d25308ea63551170 100644 (file)
@@ -538,6 +538,36 @@ static __inline__ int r300_emit_bitblt_multi(drm_radeon_private_t *dev_priv,
        return 0;
 }
 
+static __inline__ int r300_emit_indx_buffer(drm_radeon_private_t *dev_priv,
+                                            drm_radeon_kcmd_buffer_t *cmdbuf)
+{
+       u32 *cmd = (u32 *) cmdbuf->buf;
+       int count, ret;
+       RING_LOCALS;
+
+       count=(cmd[0]>>16) & 0x3fff;
+
+       if ((cmd[1] & 0x8000ffff) != 0x80000810) {
+               DRM_ERROR("Invalid indx_buffer reg address %08X\n", cmd[1]);
+               return DRM_ERR(EINVAL);
+       }
+       ret = r300_check_offset(dev_priv, cmd[2]);
+       if (ret) {
+               DRM_ERROR("Invalid indx_buffer offset is %08X\n", cmd[2]);
+               return DRM_ERR(EINVAL);
+       }
+
+       BEGIN_RING(count+2);
+       OUT_RING(cmd[0]);
+       OUT_RING_TABLE((int *)(cmdbuf->buf + 4), count + 1);
+       ADVANCE_RING();
+
+       cmdbuf->buf += (count+2)*4;
+       cmdbuf->bufsz -= (count+2)*4;
+
+       return 0;
+}
+
 static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t *dev_priv,
                                            drm_radeon_kcmd_buffer_t *cmdbuf)
 {
@@ -578,10 +608,11 @@ static __inline__ int r300_emit_raw_packet3(drm_radeon_private_t *dev_priv,
        case RADEON_CNTL_BITBLT_MULTI:
                return r300_emit_bitblt_multi(dev_priv, cmdbuf);
 
+       case RADEON_CP_INDX_BUFFER:     /* DRAW_INDX_2 without INDX_BUFFER seems to lock up the gpu */
+               return r300_emit_indx_buffer(dev_priv, cmdbuf);
        case RADEON_CP_3D_DRAW_IMMD_2:  /* triggers drawing using in-packet vertex data */
        case RADEON_CP_3D_DRAW_VBUF_2:  /* triggers drawing of vertex buffers setup elsewhere */
        case RADEON_CP_3D_DRAW_INDX_2:  /* triggers drawing using indices to vertex buffer */
-       case RADEON_CP_INDX_BUFFER:     /* DRAW_INDX_2 without INDX_BUFFER seems to lock up the gpu */
        case RADEON_WAIT_FOR_IDLE:
        case RADEON_CP_NOP:
                /* these packets are safe */
index feac5f005d47be1d56d52819ff8074651ec87e7a..6e04fdd732ac4ab2b0fd36e826e584b4c9b4c1bb 100644 (file)
@@ -275,6 +275,8 @@ static __inline__ int radeon_check_and_fixup_packet3(drm_radeon_private_t *
                                                     unsigned int *cmdsz)
 {
        u32 *cmd = (u32 *) cmdbuf->buf;
+       u32 offset, narrays;
+       int count, i, k;
 
        *cmdsz = 2 + ((cmd[0] & RADEON_CP_PACKET_COUNT_MASK) >> 16);
 
@@ -288,10 +290,106 @@ static __inline__ int radeon_check_and_fixup_packet3(drm_radeon_private_t *
                return DRM_ERR(EINVAL);
        }
 
-       /* Check client state and fix it up if necessary */
-       if (cmd[0] & 0x8000) {  /* MSB of opcode: next DWORD GUI_CNTL */
-               u32 offset;
+       switch(cmd[0] & 0xff00) {
+       /* XXX Are there old drivers needing other packets? */
 
+       case RADEON_3D_DRAW_IMMD:
+       case RADEON_3D_DRAW_VBUF:
+       case RADEON_3D_DRAW_INDX:
+       case RADEON_WAIT_FOR_IDLE:
+       case RADEON_CP_NOP:
+       case RADEON_3D_CLEAR_ZMASK:
+/*     case RADEON_CP_NEXT_CHAR:
+       case RADEON_CP_PLY_NEXTSCAN:
+       case RADEON_CP_SET_SCISSORS: */ /* probably safe but will never need them? */
+               /* these packets are safe */
+               break;
+
+       case RADEON_CP_3D_DRAW_IMMD_2:
+       case RADEON_CP_3D_DRAW_VBUF_2:
+       case RADEON_CP_3D_DRAW_INDX_2:
+       case RADEON_3D_CLEAR_HIZ:
+               /* safe but r200 only */
+               if (dev_priv->microcode_version != UCODE_R200) {
+                       DRM_ERROR("Invalid 3d packet for r100-class chip\n");
+                       return DRM_ERR(EINVAL);
+               }
+               break;
+
+       case RADEON_3D_LOAD_VBPNTR:
+               count = (cmd[0] >> 16) & 0x3fff;
+
+               if (count > 18) { /* 12 arrays max */
+                       DRM_ERROR("Too large payload in 3D_LOAD_VBPNTR (count=%d)\n",
+                                 count);
+                       return DRM_ERR(EINVAL);
+               }
+
+               /* carefully check packet contents */
+               narrays = cmd[1] & ~0xc000;
+               k = 0;
+               i = 2;
+               while ((k < narrays) && (i < (count + 2))) {
+                       i++;            /* skip attribute field */
+                       if (radeon_check_and_fixup_offset(dev_priv, filp_priv, &cmd[i])) {
+                               DRM_ERROR
+                                   ("Invalid offset (k=%d i=%d) in 3D_LOAD_VBPNTR packet.\n",
+                                    k, i);
+                               return DRM_ERR(EINVAL);
+                       }
+                       k++;
+                       i++;
+                       if (k == narrays)
+                               break;
+                       /* have one more to process, they come in pairs */
+                       if (radeon_check_and_fixup_offset(dev_priv, filp_priv, &cmd[i])) {
+                               DRM_ERROR
+                                   ("Invalid offset (k=%d i=%d) in 3D_LOAD_VBPNTR packet.\n",
+                                    k, i);
+                               return DRM_ERR(EINVAL);
+                       }
+                       k++;
+                       i++;
+               }
+               /* do the counts match what we expect ? */
+               if ((k != narrays) || (i != (count + 2))) {
+                       DRM_ERROR
+                           ("Malformed 3D_LOAD_VBPNTR packet (k=%d i=%d narrays=%d count+1=%d).\n",
+                             k, i, narrays, count + 1);
+                       return DRM_ERR(EINVAL);
+               }
+               break;
+
+       case RADEON_3D_RNDR_GEN_INDX_PRIM:
+               if (dev_priv->microcode_version != UCODE_R100) {
+                       DRM_ERROR("Invalid 3d packet for r200-class chip\n");
+                       return DRM_ERR(EINVAL);
+               }
+               if (radeon_check_and_fixup_offset(dev_priv, filp_priv, &cmd[1])) {
+                               DRM_ERROR("Invalid rndr_gen_indx offset\n");
+                               return DRM_ERR(EINVAL);
+               }
+               break;
+
+       case RADEON_CP_INDX_BUFFER:
+               if (dev_priv->microcode_version != UCODE_R200) {
+                       DRM_ERROR("Invalid 3d packet for r100-class chip\n");
+                       return DRM_ERR(EINVAL);
+               }
+               if ((cmd[1] & 0x8000ffff) != 0x80000810) {
+                       DRM_ERROR("Invalid indx_buffer reg address %08X\n", cmd[1]);
+                       return DRM_ERR(EINVAL);
+               }
+               if (radeon_check_and_fixup_offset(dev_priv, filp_priv, &cmd[2])) {
+                       DRM_ERROR("Invalid indx_buffer offset is %08X\n", cmd[2]);
+                       return DRM_ERR(EINVAL);
+               }
+               break;
+
+       case RADEON_CNTL_HOSTDATA_BLT:
+       case RADEON_CNTL_PAINT_MULTI:
+       case RADEON_CNTL_BITBLT_MULTI:
+               /* MSB of opcode: next DWORD GUI_CNTL */
                if (cmd[1] & (RADEON_GMC_SRC_PITCH_OFFSET_CNTL
                              | RADEON_GMC_DST_PITCH_OFFSET_CNTL)) {
                        offset = cmd[2] << 10;
@@ -313,6 +411,11 @@ static __inline__ int radeon_check_and_fixup_packet3(drm_radeon_private_t *
                        }
                        cmd[3] = (cmd[3] & 0xffc00000) | offset >> 10;
                }
+               break;
+
+       default:
+               DRM_ERROR("Invalid packet type %x\n", cmd[0] & 0xff00);
+               return DRM_ERR(EINVAL);
        }
 
        return 0;
index 59c7520bf9a2ab9419910ac10c186322d3b6ffc8..a9a84f88df5e465ce2c9461e97b91bd9c48e074b 100644 (file)
@@ -728,6 +728,7 @@ static int savage_do_init_bci(drm_device_t * dev, drm_savage_init_t * init)
                dev_priv->status = NULL;
        }
        if (dev_priv->dma_type == SAVAGE_DMA_AGP && init->buffers_offset) {
+               dev->agp_buffer_token = init->buffers_offset;
                dev->agp_buffer_map = drm_core_findmap(dev,
                                                       init->buffers_offset);
                if (!dev->agp_buffer_map) {
index ef2581d16146de03a6b9e717b9ba701490918038..1ca1e9cb5a3396be02753a0d584d90e269f5b73c 100644 (file)
@@ -994,7 +994,7 @@ int savage_bci_cmdbuf(DRM_IOCTL_ARGS)
        if (cmdbuf.size) {
                kcmd_addr = drm_alloc(cmdbuf.size * 8, DRM_MEM_DRIVER);
                if (kcmd_addr == NULL)
-                       return ENOMEM;
+                       return DRM_ERR(ENOMEM);
 
                if (DRM_COPY_FROM_USER(kcmd_addr, cmdbuf.cmd_addr,
                                       cmdbuf.size * 8))
index b401383808c26ac4c16ce38f15fc129b4dafd56a..96cb1f07332b68e5fb5b77dfb68a74d6356c6b64 100644 (file)
@@ -130,6 +130,7 @@ static moxa_isa_board_conf moxa_isa_boards[] =
 typedef struct _moxa_pci_devinfo {
        ushort busNum;
        ushort devNum;
+       struct pci_dev *pdev;
 } moxa_pci_devinfo;
 
 typedef struct _moxa_board_conf {
@@ -324,6 +325,9 @@ static int moxa_get_PCI_conf(struct pci_dev *p, int board_type, moxa_board_conf
        board->busType = MOXA_BUS_TYPE_PCI;
        board->pciInfo.busNum = p->bus->number;
        board->pciInfo.devNum = p->devfn >> 3;
+       board->pciInfo.pdev = p;
+       /* don't lose the reference in the next pci_get_device iteration */
+       pci_dev_get(p);
 
        return (0);
 }
@@ -493,6 +497,11 @@ static void __exit moxa_exit(void)
        if (tty_unregister_driver(moxaDriver))
                printk("Couldn't unregister MOXA Intellio family serial driver\n");
        put_tty_driver(moxaDriver);
+
+       for (i = 0; i < MAX_BOARDS; i++)
+               if (moxa_boards[i].busType == MOXA_BUS_TYPE_PCI)
+                       pci_dev_put(moxa_boards[i].pciInfo.pdev);
+
        if (verbose)
                printk("Done\n");
 }
index ee2ddea7a63a838e084f1103f7df5147f2b417f0..23d0681fe491abffeb08795f4028cc017c297b16 100644 (file)
@@ -44,6 +44,7 @@
 **    the host.
 */
 struct Host {
+       struct pci_dev *pdev;
        unsigned char Type;             /* RIO_EISA, RIO_MCA, ... */
        unsigned char Ivec;             /* POLLED or ivec number */
        unsigned char Mode;             /* Control stuff */
index c382df0f82f60957efd73391cc69c17e1577e0b7..7ac68cb3beddfa61df80e8ca0cfb22a3b53cf70b 100644 (file)
@@ -1017,6 +1017,10 @@ static int __init rio_init(void)
                        rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);
 
                        fix_rio_pci(pdev);
+
+                       p->RIOHosts[p->RIONumHosts].pdev = pdev;
+                       pci_dev_get(pdev);
+
                        p->RIOLastPCISearch = 0;
                        p->RIONumHosts++;
                        found++;
@@ -1066,6 +1070,9 @@ static int __init rio_init(void)
                            ((readb(&p->RIOHosts[p->RIONumHosts].Unique[1]) & 0xFF) << 8) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[2]) & 0xFF) << 16) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[3]) & 0xFF) << 24);
                        rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);
 
+                       p->RIOHosts[p->RIONumHosts].pdev = pdev;
+                       pci_dev_get(pdev);
+
                        p->RIOLastPCISearch = 0;
                        p->RIONumHosts++;
                        found++;
@@ -1181,6 +1188,8 @@ static void __exit rio_exit(void)
                }
                /* It is safe/allowed to del_timer a non-active timer */
                del_timer(&hp->timer);
+               if (hp->Type == RIO_PCI)
+                       pci_dev_put(hp->pdev);
        }
 
        if (misc_deregister(&rio_fw_device) < 0) {
index 89e46d6dfc4ef789af2e5cfe3f89631607f4c345..0187b1185323d026395c6afd7b76f0c1355dc0b6 100644 (file)
@@ -13,7 +13,7 @@ config WATCHDOG
          subsequently opening the file and then failing to write to it for
          longer than 1 minute will result in rebooting the machine. This
          could be useful for a networked machine that needs to come back
-         online as fast as possible after a lock-up. There's both a watchdog
+         on-line as fast as possible after a lock-up. There's both a watchdog
          implementation entirely in software (which can sometimes fail to
          reboot the machine) and a driver for hardware watchdog boards, which
          are more robust and can also keep track of the temperature inside
@@ -60,7 +60,7 @@ config SOFT_WATCHDOG
 
 # ARM Architecture
 
-config AT91_WATCHDOG
+config AT91RM9200_WATCHDOG
        tristate "AT91RM9200 watchdog"
        depends on WATCHDOG && ARCH_AT91RM9200
        help
@@ -71,7 +71,7 @@ config 21285_WATCHDOG
        tristate "DC21285 watchdog"
        depends on WATCHDOG && FOOTBRIDGE
        help
-         The Intel Footbridge chip contains a builtin watchdog circuit. Say Y
+         The Intel Footbridge chip contains a built-in watchdog circuit. Say Y
          here if you wish to use this. Alternatively say M to compile the
          driver as a module, which will be called wdt285.
 
@@ -269,11 +269,11 @@ config IB700_WDT
          Most people will say N.
 
 config IBMASR
-        tristate "IBM Automatic Server Restart"
-        depends on WATCHDOG && X86
-        help
+       tristate "IBM Automatic Server Restart"
+       depends on WATCHDOG && X86
+       help
          This is the driver for the IBM Automatic Server Restart watchdog
-         timer builtin into some eServer xSeries machines.
+         timer built-in into some eServer xSeries machines.
 
          To compile this driver as a module, choose M here: the
          module will be called ibmasr.
@@ -316,13 +316,16 @@ config I8XX_TCO
          To compile this driver as a module, choose M here: the
          module will be called i8xx_tco.
 
+         Note: This driver will be removed in the near future. Please
+         use the Intel TCO Timer/Watchdog driver.
+
 config ITCO_WDT
-       tristate "Intel TCO Timer/Watchdog (EXPERIMENTAL)"
-       depends on WATCHDOG && (X86 || IA64) && PCI && EXPERIMENTAL
+       tristate "Intel TCO Timer/Watchdog"
+       depends on WATCHDOG && (X86 || IA64) && PCI
        ---help---
          Hardware driver for the intel TCO timer based watchdog devices.
          These drivers are included in the Intel 82801 I/O Controller
-         Hub family 'from ICH0 up to ICH7) and in the Intel 6300ESB
+         Hub family (from ICH0 up to ICH8) and in the Intel 6300ESB
          controller hub.
 
          The TCO (Total Cost of Ownership) timer is a watchdog timer
@@ -395,6 +398,26 @@ config CPU5_WDT
          To compile this driver as a module, choose M here: the
          module will be called cpu5wdt.
 
+config SMSC37B787_WDT
+       tristate "Winbond SMsC37B787 Watchdog Timer"
+       depends on WATCHDOG && X86
+       ---help---
+         This is the driver for the hardware watchdog component on the
+         Winbond SMsC37B787 chipset as used on the NetRunner Mainboard
+         from Vision Systems and maybe others.
+
+         This watchdog simply watches your kernel to make sure it doesn't
+         freeze, and if it does, it reboots your computer after a certain
+         amount of time.
+
+         Usually a userspace daemon will notify the kernel WDT driver that
+         userspace is still alive, at regular intervals.
+
+         To compile this driver as a module, choose M here: the
+         module will be called smsc37b787_wdt.
+
+         Most people will say N.
+
 config W83627HF_WDT
        tristate "W83627HF Watchdog Timer"
        depends on WATCHDOG && X86
@@ -410,6 +433,21 @@ config W83627HF_WDT
 
          Most people will say N.
 
+config W83697HF_WDT
+       tristate "W83697HF/W83697HG Watchdog Timer"
+       depends on WATCHDOG && X86
+       ---help---
+         This is the driver for the hardware watchdog on the W83697HF/HG
+         chipset as used in Dedibox/VIA motherboards (and likely others).
+         This watchdog simply watches your kernel to make sure it doesn't
+         freeze, and if it does, it reboots your computer after a certain
+         amount of time.
+
+         To compile this driver as a module, choose M here: the
+         module will be called w83697hf_wdt.
+
+         Most people will say N.
+
 config W83877F_WDT
        tristate "W83877F (EMACS) Watchdog Timer"
        depends on WATCHDOG && X86
@@ -443,7 +481,7 @@ config MACHZ_WDT
        depends on WATCHDOG && X86
        ---help---
          If you are using a ZF Micro MachZ processor, say Y here, otherwise
-         N.  This is the driver for the watchdog timer builtin on that
+         N.  This is the driver for the watchdog timer built-in on that
          processor using ZF-Logic interface.  This watchdog simply watches
          your kernel to make sure it doesn't freeze, and if it does, it
          reboots your computer after a certain amount of time.
@@ -472,7 +510,6 @@ config SBC_EPX_C3_WATCHDOG
          To compile this driver as a module, choose M here: the
          module will be called sbc_epx_c3.
 
-
 # PowerPC Architecture
 
 config 8xx_WDT
@@ -502,7 +539,7 @@ config WATCHDOG_RTAS
        help
          This driver adds watchdog support for the RTAS watchdog.
 
-          To compile this driver as a module, choose M here. The module
+         To compile this driver as a module, choose M here. The module
          will be called wdrtas.
 
 # MIPS Architecture
@@ -556,7 +593,7 @@ config SH_WDT_MMAP
        help
          If you say Y here, user applications will be able to mmap the
          WDT/CPG registers.
-#
+
 # SPARC64 Architecture
 
 config WATCHDOG_CP1XXX
index 7f70abad465a3b846d2c1b5558c23496b9ea965c..36440497047c40476011616f4ee71cf651418f2e 100644 (file)
@@ -23,7 +23,7 @@ obj-$(CONFIG_WDTPCI) += wdt_pci.o
 obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o
 
 # ARM Architecture
-obj-$(CONFIG_AT91_WATCHDOG) += at91_wdt.o
+obj-$(CONFIG_AT91RM9200_WATCHDOG) += at91rm9200_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
 obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
 obj-$(CONFIG_977_WATCHDOG) += wdt977.o
@@ -53,7 +53,9 @@ obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o
 obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
 obj-$(CONFIG_SBC8360_WDT) += sbc8360.o
 obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o
+obj-$(CONFIG_SMSC37B787_WDT) += smsc37b787_wdt.o
 obj-$(CONFIG_W83627HF_WDT) += w83627hf_wdt.o
+obj-$(CONFIG_W83697HF_WDT) += w83697hf_wdt.o
 obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o
 obj-$(CONFIG_W83977F_WDT) += w83977f_wdt.o
 obj-$(CONFIG_MACHZ_WDT) += machzwd.o
index aaac94db0d8b7ca9e40e9fd04fc93585c9101192..b6f29cb8bd397bd707a27925e07e80801a3d612a 100644 (file)
  *     82801GDH (ICH7DH)    : document number 307013-002, 307014-009,
  *     82801GBM (ICH7-M)    : document number 307013-002, 307014-009,
  *     82801GHM (ICH7-M DH) : document number 307013-002, 307014-009,
+ *     82801HB  (ICH8)      : document number 313056-002, 313057-004,
+ *     82801HR  (ICH8R)     : document number 313056-002, 313057-004,
+ *     82801HH  (ICH8DH)    : document number 313056-002, 313057-004,
+ *     82801HO  (ICH8DO)    : document number 313056-002, 313057-004,
  *     6300ESB  (6300ESB)   : document number 300641-003
  */
 
@@ -45,7 +49,7 @@
 /* Module and version information */
 #define DRV_NAME        "iTCO_wdt"
 #define DRV_VERSION     "1.00"
-#define DRV_RELDATE     "30-Jul-2006"
+#define DRV_RELDATE     "08-Oct-2006"
 #define PFX            DRV_NAME ": "
 
 /* Includes */
@@ -85,6 +89,9 @@ enum iTCO_chipsets {
        TCO_ICH7,       /* ICH7 & ICH7R */
        TCO_ICH7M,      /* ICH7-M */
        TCO_ICH7MDH,    /* ICH7-M DH */
+       TCO_ICH8,       /* ICH8 & ICH8R */
+       TCO_ICH8DH,     /* ICH8DH */
+       TCO_ICH8DO,     /* ICH8DO */
 };
 
 static struct {
@@ -108,6 +115,9 @@ static struct {
        {"ICH7 or ICH7R", 2},
        {"ICH7-M", 2},
        {"ICH7-M DH", 2},
+       {"ICH8 or ICH8R", 2},
+       {"ICH8DH", 2},
+       {"ICH8DO", 2},
        {NULL,0}
 };
 
@@ -135,6 +145,9 @@ static struct pci_device_id iTCO_wdt_pci_tbl[] = {
        { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7    },
        { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7M   },
        { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH7MDH },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8    },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8DH  },
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3,      PCI_ANY_ID, PCI_ANY_ID, 0, 0, TCO_ICH8DO  },
        { 0, },                 /* End of list */
 };
 MODULE_DEVICE_TABLE (pci, iTCO_wdt_pci_tbl);
@@ -355,7 +368,8 @@ static int iTCO_wdt_get_timeleft (int *time_left)
                spin_unlock(&iTCO_wdt_private.io_lock);
 
                *time_left = (val8 * 6) / 10;
-       }
+       } else
+               return -EINVAL;
        return 0;
 }
 
@@ -426,7 +440,6 @@ static int iTCO_wdt_ioctl (struct inode *inode, struct file *file,
 {
        int new_options, retval = -EINVAL;
        int new_heartbeat;
-       int time_left;
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
        static struct watchdog_info ident = {
@@ -486,6 +499,8 @@ static int iTCO_wdt_ioctl (struct inode *inode, struct file *file,
 
                case WDIOC_GETTIMELEFT:
                {
+                       int time_left;
+
                        if (iTCO_wdt_get_timeleft(&time_left))
                                return -EINVAL;
 
index 68b1ca976d53236f6fa450abddd10a8d520140cb..18cb050c38624b6eb76bc658849c8cecd107c950 100644 (file)
@@ -380,18 +380,21 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
        if (res == NULL) {
                printk(KERN_INFO PFX "failed to get irq resource\n");
+               iounmap(wdt_base);
                return -ENOENT;
        }
 
        ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, pdev);
        if (ret != 0) {
                printk(KERN_INFO PFX "failed to install irq (%d)\n", ret);
+               iounmap(wdt_base);
                return ret;
        }
 
        wdt_clock = clk_get(&pdev->dev, "watchdog");
        if (wdt_clock == NULL) {
                printk(KERN_INFO PFX "failed to find watchdog clock source\n");
+               iounmap(wdt_base);
                return -ENOENT;
        }
 
@@ -415,6 +418,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
        if (ret) {
                printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n",
                        WATCHDOG_MINOR, ret);
+               iounmap(wdt_base);
                return ret;
        }
 
@@ -451,6 +455,7 @@ static int s3c2410wdt_remove(struct platform_device *dev)
                wdt_clock = NULL;
        }
 
+       iounmap(wdt_base);
        misc_deregister(&s3c2410wdt_miscdev);
        return 0;
 }
diff --git a/drivers/char/watchdog/smsc37b787_wdt.c b/drivers/char/watchdog/smsc37b787_wdt.c
new file mode 100644 (file)
index 0000000..9f56913
--- /dev/null
@@ -0,0 +1,627 @@
+/*
+ *     SMsC 37B787 Watchdog Timer driver for Linux 2.6.x.x
+ *
+ *      Based on acquirewdt.c by Alan Cox <alan@redhat.com>
+ *       and some other existing drivers
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License
+ *     as published by the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     The authors do NOT admit liability nor provide warranty for
+ *     any of this software. This material is provided "AS-IS" in
+ *      the hope that it may be useful for others.
+ *
+ *     (C) Copyright 2003-2006  Sven Anders <anders@anduras.de>
+ *
+ *  History:
+ *     2003 - Created version 1.0 for Linux 2.4.x.
+ *     2006 - Ported to Linux 2.6, added nowayout and MAGICCLOSE
+ *             features. Released version 1.1
+ *
+ *  Theory of operation:
+ *
+ *      A Watchdog Timer (WDT) is a hardware circuit that can
+ *      reset the computer system in case of a software fault.
+ *      You probably knew that already.
+ *
+ *      Usually a userspace daemon will notify the kernel WDT driver
+ *      via the /dev/watchdog special device file that userspace is
+ *      still alive, at regular intervals.  When such a notification
+ *      occurs, the driver will usually tell the hardware watchdog
+ *      that everything is in order, and that the watchdog should wait
+ *      for yet another little while to reset the system.
+ *      If userspace fails (RAM error, kernel bug, whatever), the
+ *      notifications cease to occur, and the hardware watchdog will
+ *      reset the system (causing a reboot) after the timeout occurs.
+ *
+ * Create device with:
+ *  mknod /dev/watchdog c 10 130
+ *
+ * For an example userspace keep-alive daemon, see:
+ *   Documentation/watchdog/watchdog.txt
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/delay.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+/* enable support for minutes as units? */
+/* (does not always work correctly, so disabled by default!) */
+#define SMSC_SUPPORT_MINUTES
+#undef SMSC_SUPPORT_MINUTES
+
+#define MAX_TIMEOUT     255
+
+#define UNIT_SECOND     0
+#define UNIT_MINUTE     1
+
+#define MODNAME                "smsc37b787_wdt: "
+#define VERSION         "1.1"
+
+#define IOPORT          0x3F0
+#define IOPORT_SIZE     2
+#define IODEV_NO        8
+
+static int unit = UNIT_SECOND;  /* timer's unit */
+static int timeout = 60;        /* timeout value: default is 60 "units" */
+static unsigned long timer_enabled = 0;   /* is the timer enabled? */
+
+static char expect_close;       /* is the close expected? */
+
+static spinlock_t io_lock;     /* to guard the watchdog from io races */
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+
+/* -- Low level function ----------------------------------------*/
+
+/* unlock the IO chip */
+
+static inline void open_io_config(void)
+{
+        outb(0x55, IOPORT);
+       mdelay(1);
+        outb(0x55, IOPORT);
+}
+
+/* lock the IO chip */
+static inline void close_io_config(void)
+{
+        outb(0xAA, IOPORT);
+}
+
+/* select the IO device */
+static inline void select_io_device(unsigned char devno)
+{
+        outb(0x07, IOPORT);
+        outb(devno, IOPORT+1);
+}
+
+/* write to the control register */
+static inline void write_io_cr(unsigned char reg, unsigned char data)
+{
+        outb(reg, IOPORT);
+        outb(data, IOPORT+1);
+}
+
+/* read from the control register */
+static inline char read_io_cr(unsigned char reg)
+{
+        outb(reg, IOPORT);
+        return inb(IOPORT+1);
+}
+
+/* -- Medium level functions ------------------------------------*/
+
+static inline void gpio_bit12(unsigned char reg)
+{
+       // -- General Purpose I/O Bit 1.2 --
+       // Bit 0,   In/Out: 0 = Output, 1 = Input
+       // Bit 1,   Polarity: 0 = No Invert, 1 = Invert
+       // Bit 2,   Group Enable Intr.: 0 = Disable, 1 = Enable
+       // Bit 3/4, Function select: 00 = GPI/O, 01 = WDT, 10 = P17,
+       //                           11 = Either Edge Triggered Intr. 2
+        // Bit 5/6  (Reserved)
+       // Bit 7,   Output Type: 0 = Push Pull Bit, 1 = Open Drain
+        write_io_cr(0xE2, reg);
+}
+
+static inline void gpio_bit13(unsigned char reg)
+{
+       // -- General Purpose I/O Bit 1.3 --
+       // Bit 0,  In/Out: 0 = Output, 1 = Input
+       // Bit 1,  Polarity: 0 = No Invert, 1 = Invert
+       // Bit 2,  Group Enable Intr.: 0 = Disable, 1 = Enable
+       // Bit 3,  Function select: 0 = GPI/O, 1 = LED
+        // Bit 4-6 (Reserved)
+       // Bit 7,  Output Type: 0 = Push Pull Bit, 1 = Open Drain
+        write_io_cr(0xE3, reg);
+}
+
+static inline void wdt_timer_units(unsigned char new_units)
+{
+       // -- Watchdog timer units --
+       // Bit 0-6 (Reserved)
+       // Bit 7,  WDT Time-out Value Units Select
+       //         (0 = Minutes, 1 = Seconds)
+        write_io_cr(0xF1, new_units);
+}
+
+static inline void wdt_timeout_value(unsigned char new_timeout)
+{
+       // -- Watchdog Timer Time-out Value --
+       // Bit 0-7 Binary coded units (0=Disabled, 1..255)
+        write_io_cr(0xF2, new_timeout);
+}
+
+static inline void wdt_timer_conf(unsigned char conf)
+{
+       // -- Watchdog timer configuration --
+       // Bit 0   Joystick enable: 0* = No Reset, 1 = Reset WDT upon Gameport I/O
+       // Bit 1   Keyboard enable: 0* = No Reset, 1 = Reset WDT upon KBD Intr.
+       // Bit 2   Mouse enable: 0* = No Reset, 1 = Reset WDT upon Mouse Intr.
+        // Bit 3   Reset the timer
+        //         (Wrong in SMsC documentation? Given as: PowerLED Timout Enabled)
+       // Bit 4-7 WDT Interrupt Mapping: (0000* = Disabled,
+       //            0001=IRQ1, 0010=(Invalid), 0011=IRQ3 to 1111=IRQ15)
+        write_io_cr(0xF3, conf);
+}
+
+static inline void wdt_timer_ctrl(unsigned char reg)
+{
+       // -- Watchdog timer control --
+       // Bit 0   Status Bit: 0 = Timer counting, 1 = Timeout occured
+       // Bit 1   Power LED Toggle: 0 = Disable Toggle, 1 = Toggle at 1 Hz
+       // Bit 2   Force Timeout: 1 = Forces WD timeout event (self-cleaning)
+       // Bit 3   P20 Force Timeout enabled:
+       //          0 = P20 activity does not generate the WD timeout event
+       //          1 = P20 Allows rising edge of P20, from the keyboard
+       //              controller, to force the WD timeout event.
+       // Bit 4   (Reserved)
+       // -- Soft power management --
+       // Bit 5   Stop Counter: 1 = Stop software power down counter
+       //            set via register 0xB8, (self-cleaning)
+       //            (Upon read: 0 = Counter running, 1 = Counter stopped)
+       // Bit 6   Restart Counter: 1 = Restart software power down counter
+       //            set via register 0xB8, (self-cleaning)
+       // Bit 7   SPOFF: 1 = Force software power down (self-cleaning)
+
+        write_io_cr(0xF4, reg);
+}
+
+/* -- Higher level functions ------------------------------------*/
+
+/* initialize watchdog */
+
+static void wb_smsc_wdt_initialize(void)
+{
+        unsigned char old;
+
+       spin_lock(&io_lock);
+        open_io_config();
+        select_io_device(IODEV_NO);
+
+       // enable the watchdog
+       gpio_bit13(0x08);  // Select pin 80 = LED not GPIO
+       gpio_bit12(0x0A);  // Set pin 79 = WDT not GPIO/Output/Polarity=Invert
+
+       // disable the timeout
+        wdt_timeout_value(0);
+
+       // reset control register
+        wdt_timer_ctrl(0x00);
+
+       // reset configuration register
+       wdt_timer_conf(0x00);
+
+       // read old (timer units) register
+        old = read_io_cr(0xF1) & 0x7F;
+        if (unit == UNIT_SECOND) old |= 0x80; // set to seconds
+
+       // set the watchdog timer units
+        wdt_timer_units(old);
+
+        close_io_config();
+       spin_unlock(&io_lock);
+}
+
+/* shutdown the watchdog */
+
+static void wb_smsc_wdt_shutdown(void)
+{
+       spin_lock(&io_lock);
+        open_io_config();
+        select_io_device(IODEV_NO);
+
+       // disable the watchdog
+        gpio_bit13(0x09);
+        gpio_bit12(0x09);
+
+       // reset watchdog config register
+       wdt_timer_conf(0x00);
+
+       // reset watchdog control register
+        wdt_timer_ctrl(0x00);
+
+       // disable timeout
+        wdt_timeout_value(0x00);
+
+        close_io_config();
+       spin_unlock(&io_lock);
+}
+
+/* set timeout => enable watchdog */
+
+static void wb_smsc_wdt_set_timeout(unsigned char new_timeout)
+{
+       spin_lock(&io_lock);
+        open_io_config();
+        select_io_device(IODEV_NO);
+
+       // set Power LED to blink, if we enable the timeout
+        wdt_timer_ctrl((new_timeout == 0) ? 0x00 : 0x02);
+
+       // set timeout value
+        wdt_timeout_value(new_timeout);
+
+        close_io_config();
+       spin_unlock(&io_lock);
+}
+
+/* get timeout */
+
+static unsigned char wb_smsc_wdt_get_timeout(void)
+{
+        unsigned char set_timeout;
+
+       spin_lock(&io_lock);
+        open_io_config();
+        select_io_device(IODEV_NO);
+        set_timeout = read_io_cr(0xF2);
+        close_io_config();
+       spin_unlock(&io_lock);
+
+        return set_timeout;
+}
+
+/* disable watchdog */
+
+static void wb_smsc_wdt_disable(void)
+{
+        // set the timeout to 0 to disable the watchdog
+        wb_smsc_wdt_set_timeout(0);
+}
+
+/* enable watchdog by setting the current timeout */
+
+static void wb_smsc_wdt_enable(void)
+{
+        // set the current timeout...
+        wb_smsc_wdt_set_timeout(timeout);
+}
+
+/* reset the timer */
+
+static void wb_smsc_wdt_reset_timer(void)
+{
+       spin_lock(&io_lock);
+        open_io_config();
+        select_io_device(IODEV_NO);
+
+       // reset the timer
+       wdt_timeout_value(timeout);
+       wdt_timer_conf(0x08);
+
+        close_io_config();
+       spin_unlock(&io_lock);
+}
+
+/* return, if the watchdog is enabled (timeout is set...) */
+
+static int wb_smsc_wdt_status(void)
+{
+       return (wb_smsc_wdt_get_timeout() == 0) ? 0 : WDIOF_KEEPALIVEPING;
+}
+
+
+/* -- File operations -------------------------------------------*/
+
+/* open => enable watchdog and set initial timeout */
+
+static int wb_smsc_wdt_open(struct inode *inode, struct file *file)
+{
+       /* /dev/watchdog can only be opened once */
+
+       if (test_and_set_bit(0, &timer_enabled))
+               return -EBUSY;
+
+       if (nowayout)
+               __module_get(THIS_MODULE);
+
+       /* Reload and activate timer */
+       wb_smsc_wdt_enable();
+
+       printk(KERN_INFO MODNAME "Watchdog enabled. Timeout set to %d %s.\n", timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)");
+
+       return nonseekable_open(inode, file);
+}
+
+/* close => shut off the timer */
+
+static int wb_smsc_wdt_release(struct inode *inode, struct file *file)
+{
+       /* Shut off the timer. */
+
+       if (expect_close == 42) {
+               wb_smsc_wdt_disable();
+               printk(KERN_INFO MODNAME "Watchdog disabled, sleeping again...\n");
+       } else {
+               printk(KERN_CRIT MODNAME "Unexpected close, not stopping watchdog!\n");
+               wb_smsc_wdt_reset_timer();
+       }
+
+       clear_bit(0, &timer_enabled);
+       expect_close = 0;
+       return 0;
+}
+
+/* write => update the timer to keep the machine alive */
+
+static ssize_t wb_smsc_wdt_write(struct file *file, const char __user *data,
+                                size_t len, loff_t *ppos)
+{
+       /* See if we got the magic character 'V' and reload the timer */
+       if (len) {
+               if (!nowayout) {
+                       size_t i;
+
+                       /* reset expect flag */
+                       expect_close = 0;
+
+                       /* scan to see whether or not we got the magic character */
+                       for (i = 0; i != len; i++) {
+                               char c;
+                               if (get_user(c, data+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+
+               /* someone wrote to us, we should reload the timer */
+               wb_smsc_wdt_reset_timer();
+       }
+       return len;
+}
+
+/* ioctl => control interface */
+
+static int wb_smsc_wdt_ioctl(struct inode *inode, struct file *file,
+                            unsigned int cmd, unsigned long arg)
+{
+       int new_timeout;
+
+       union {
+               struct watchdog_info __user *ident;
+               int __user *i;
+       } uarg;
+
+       static struct watchdog_info ident = {
+               .options =              WDIOF_KEEPALIVEPING |
+                                       WDIOF_SETTIMEOUT |
+                                       WDIOF_MAGICCLOSE,
+               .firmware_version =     0,
+               .identity =             "SMsC 37B787 Watchdog"
+       };
+
+       uarg.i = (int __user *)arg;
+
+       switch (cmd) {
+               default:
+                       return -ENOTTY;
+
+               case WDIOC_GETSUPPORT:
+                       return copy_to_user(uarg.ident, &ident,
+                               sizeof(ident)) ? -EFAULT : 0;
+
+               case WDIOC_GETSTATUS:
+                       return put_user(wb_smsc_wdt_status(), uarg.i);
+
+               case WDIOC_GETBOOTSTATUS:
+                       return put_user(0, uarg.i);
+
+               case WDIOC_KEEPALIVE:
+                       wb_smsc_wdt_reset_timer();
+                       return 0;
+
+               case WDIOC_SETTIMEOUT:
+                       if (get_user(new_timeout, uarg.i))
+                               return -EFAULT;
+
+                       // the API states this is given in secs
+                       if (unit == UNIT_MINUTE)
+                         new_timeout /= 60;
+
+                       if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
+                               return -EINVAL;
+
+                       timeout = new_timeout;
+                       wb_smsc_wdt_set_timeout(timeout);
+
+                       // fall through and return the new timeout...
+
+               case WDIOC_GETTIMEOUT:
+
+                       new_timeout = timeout;
+
+                       if (unit == UNIT_MINUTE)
+                         new_timeout *= 60;
+
+                       return put_user(new_timeout, uarg.i);
+
+               case WDIOC_SETOPTIONS:
+               {
+                       int options, retval = -EINVAL;
+
+                       if (get_user(options, uarg.i))
+                               return -EFAULT;
+
+                       if (options & WDIOS_DISABLECARD) {
+                               wb_smsc_wdt_disable();
+                               retval = 0;
+                       }
+
+                       if (options & WDIOS_ENABLECARD) {
+                               wb_smsc_wdt_enable();
+                               retval = 0;
+                       }
+
+                       return retval;
+               }
+       }
+}
+
+/* -- Notifier funtions -----------------------------------------*/
+
+static int wb_smsc_wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT)
+       {
+                // set timeout to 0, to avoid possible race-condition
+               timeout = 0;
+               wb_smsc_wdt_disable();
+       }
+       return NOTIFY_DONE;
+}
+
+/* -- Module's structures ---------------------------------------*/
+
+static struct file_operations wb_smsc_wdt_fops =
+{
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = wb_smsc_wdt_write,
+       .ioctl          = wb_smsc_wdt_ioctl,
+       .open           = wb_smsc_wdt_open,
+       .release        = wb_smsc_wdt_release,
+};
+
+static struct notifier_block wb_smsc_wdt_notifier =
+{
+       .notifier_call  = wb_smsc_wdt_notify_sys,
+};
+
+static struct miscdevice wb_smsc_wdt_miscdev =
+{
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &wb_smsc_wdt_fops,
+};
+
+/* -- Module init functions -------------------------------------*/
+
+/* module's "constructor" */
+
+static int __init wb_smsc_wdt_init(void)
+{
+       int ret;
+
+       spin_lock_init(&io_lock);
+
+       printk("SMsC 37B787 watchdog component driver " VERSION " initialising...\n");
+
+       if (!request_region(IOPORT, IOPORT_SIZE, "SMsC 37B787 watchdog")) {
+               printk(KERN_ERR MODNAME "Unable to register IO port %#x\n", IOPORT);
+               ret = -EBUSY;
+               goto out_pnp;
+       }
+
+        // set new maximum, if it's too big
+        if (timeout > MAX_TIMEOUT)
+               timeout = MAX_TIMEOUT;
+
+        // init the watchdog timer
+        wb_smsc_wdt_initialize();
+
+       ret = register_reboot_notifier(&wb_smsc_wdt_notifier);
+       if (ret) {
+               printk(KERN_ERR MODNAME "Unable to register reboot notifier err = %d\n", ret);
+               goto out_io;
+       }
+
+       ret = misc_register(&wb_smsc_wdt_miscdev);
+       if (ret) {
+               printk(KERN_ERR MODNAME "Unable to register miscdev on minor %d\n", WATCHDOG_MINOR);
+               goto out_rbt;
+       }
+
+       // output info
+       printk(KERN_INFO MODNAME "Timeout set to %d %s.\n", timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)");
+       printk(KERN_INFO MODNAME "Watchdog initialized and sleeping (nowayout=%d)...\n", nowayout);
+
+       // ret = 0
+
+out_clean:
+       return ret;
+
+out_rbt:
+       unregister_reboot_notifier(&wb_smsc_wdt_notifier);
+
+out_io:
+       release_region(IOPORT, IOPORT_SIZE);
+
+out_pnp:
+       goto out_clean;
+}
+
+/* module's "destructor" */
+
+static void __exit wb_smsc_wdt_exit(void)
+{
+       /* Stop the timer before we leave */
+       if (!nowayout)
+       {
+               wb_smsc_wdt_shutdown();
+               printk(KERN_INFO MODNAME "Watchdog disabled.\n");
+       }
+
+       misc_deregister(&wb_smsc_wdt_miscdev);
+       unregister_reboot_notifier(&wb_smsc_wdt_notifier);
+       release_region(IOPORT, IOPORT_SIZE);
+
+       printk("SMsC 37B787 watchdog component driver removed.\n");
+}
+
+module_init(wb_smsc_wdt_init);
+module_exit(wb_smsc_wdt_exit);
+
+MODULE_AUTHOR("Sven Anders <anders@anduras.de>");
+MODULE_DESCRIPTION("Driver for SMsC 37B787 watchdog component (Version " VERSION ")");
+MODULE_LICENSE("GPL");
+
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+
+#ifdef SMSC_SUPPORT_MINUTES
+module_param(unit, int, 0);
+MODULE_PARM_DESC(unit, "set unit to use, 0=seconds or 1=minutes, default is 0");
+#endif
+
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "range is 1-255 units, default is 60");
+
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
index b4adc527e687e8c7e43f047be489b0fbc13f0ddf..07d4bff27226b378a6d88d3c1fb0abe9f9f8172a 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/notifier.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
+#include <linux/spinlock.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -44,6 +45,7 @@
 
 static unsigned long wdt_is_open;
 static char expect_close;
+static spinlock_t io_lock;
 
 /* You must set this - there is no sane way to probe for this board. */
 static int wdt_io = 0x2E;
@@ -110,12 +112,16 @@ w83627hf_init(void)
 static void
 wdt_ctrl(int timeout)
 {
+       spin_lock(&io_lock);
+       
        w83627hf_select_wd_register();
 
        outb_p(0xF6, WDT_EFER);    /* Select CRF6 */
        outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF6 */
 
        w83627hf_unselect_wd_register();
+
+       spin_unlock(&io_lock);
 }
 
 static int
@@ -303,6 +309,8 @@ wdt_init(void)
 {
        int ret;
 
+       spin_lock_init(&io_lock);
+
        printk(KERN_INFO "WDT driver for the Winbond(TM) W83627HF Super I/O chip initialising.\n");
 
        if (wdt_set_heartbeat(timeout)) {
diff --git a/drivers/char/watchdog/w83697hf_wdt.c b/drivers/char/watchdog/w83697hf_wdt.c
new file mode 100644 (file)
index 0000000..7768b55
--- /dev/null
@@ -0,0 +1,450 @@
+/*
+ *     w83697hf/hg WDT driver
+ *
+ *     (c) Copyright 2006 Samuel Tardieu <sam@rfc1149.net>
+ *     (c) Copyright 2006 Marcus Junker <junker@anduras.de>
+ *
+ *     Based on w83627hf_wdt.c which is based on advantechwdt.c
+ *     which is based on wdt.c.
+ *     Original copyright messages:
+ *
+ *     (c) Copyright 2003 Pádraig Brady <P@draigBrady.com>
+ *
+ *     (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
+ *
+ *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
+ *                             http://www.redhat.com
+ *
+ *     This program is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License
+ *     as published by the Free Software Foundation; either version
+ *     2 of the License, or (at your option) any later version.
+ *
+ *     Neither Marcus Junker nor ANDURAS AG admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/types.h>
+#include <linux/miscdevice.h>
+#include <linux/watchdog.h>
+#include <linux/fs.h>
+#include <linux/ioport.h>
+#include <linux/notifier.h>
+#include <linux/reboot.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+
+#define WATCHDOG_NAME "w83697hf/hg WDT"
+#define PFX WATCHDOG_NAME ": "
+#define WATCHDOG_TIMEOUT 60            /* 60 sec default timeout */
+
+static unsigned long wdt_is_open;
+static char expect_close;
+static spinlock_t io_lock;
+
+/* You must set this - there is no sane way to probe for this board. */
+static int wdt_io = 0x2e;
+module_param(wdt_io, int, 0);
+MODULE_PARM_DESC(wdt_io, "w83697hf/hg WDT io port (default 0x2e, 0 = autodetect)");
+
+static int timeout = WATCHDOG_TIMEOUT; /* in seconds */
+module_param(timeout, int, 0);
+MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
+
+static int nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
+
+/*
+ *     Kernel methods.
+ */
+
+#define W83697HF_EFER (wdt_io+0)       /* Extended Function Enable Register */
+#define W83697HF_EFIR (wdt_io+0)       /* Extended Function Index Register (same as EFER) */
+#define W83697HF_EFDR (wdt_io+1)       /* Extended Function Data Register */
+
+static inline void
+w83697hf_unlock(void)
+{
+       outb_p(0x87, W83697HF_EFER);    /* Enter extended function mode */
+       outb_p(0x87, W83697HF_EFER);    /* Again according to manual */
+}
+
+static inline void
+w83697hf_lock(void)
+{
+       outb_p(0xAA, W83697HF_EFER);    /* Leave extended function mode */
+}
+
+/*
+ *     The three functions w83697hf_get_reg(), w83697hf_set_reg() and
+ *     w83697hf_write_timeout() must be called with the device unlocked.
+ */
+
+static unsigned char
+w83697hf_get_reg(unsigned char reg)
+{
+       outb_p(reg, W83697HF_EFIR);
+       return inb_p(W83697HF_EFDR);
+}
+
+static void
+w83697hf_set_reg(unsigned char reg, unsigned char data)
+{
+       outb_p(reg, W83697HF_EFIR);
+       outb_p(data, W83697HF_EFDR);
+}
+
+static void
+w83697hf_write_timeout(int timeout)
+{
+       w83697hf_set_reg(0xF4, timeout);        /* Write Timeout counter to CRF4 */
+}
+
+static void
+w83697hf_select_wdt(void)
+{
+       w83697hf_unlock();
+       w83697hf_set_reg(0x07, 0x08);   /* Switch to logic device 8 (GPIO2) */
+}
+
+static inline void
+w83697hf_deselect_wdt(void)
+{
+       w83697hf_lock();
+}
+
+static void
+w83697hf_init(void)
+{
+       unsigned char bbuf;
+
+       w83697hf_select_wdt();
+
+       bbuf = w83697hf_get_reg(0x29);
+       bbuf &= ~0x60;
+       bbuf |= 0x20;
+       w83697hf_set_reg(0x29, bbuf);   /* Set pin 119 to WDTO# mode (= CR29, WDT0) */
+
+       bbuf = w83697hf_get_reg(0xF3);
+       bbuf &= ~0x04;
+       w83697hf_set_reg(0xF3, bbuf);   /* Count mode is seconds */
+
+       w83697hf_deselect_wdt();
+}
+
+static int
+wdt_ping(void)
+{
+       spin_lock(&io_lock);
+       w83697hf_select_wdt();
+
+       w83697hf_write_timeout(timeout);
+
+       w83697hf_deselect_wdt();
+       spin_unlock(&io_lock);
+       return 0;
+}
+
+static int
+wdt_enable(void)
+{
+       spin_lock(&io_lock);
+       w83697hf_select_wdt();
+
+       w83697hf_write_timeout(timeout);
+       w83697hf_set_reg(0x30, 1);      /* Enable timer */
+
+       w83697hf_deselect_wdt();
+       spin_unlock(&io_lock);
+       return 0;
+}
+
+static int
+wdt_disable(void)
+{
+       spin_lock(&io_lock);
+       w83697hf_select_wdt();
+
+       w83697hf_set_reg(0x30, 0);      /* Disable timer */
+       w83697hf_write_timeout(0);
+
+       w83697hf_deselect_wdt();
+       spin_unlock(&io_lock);
+       return 0;
+}
+
+static int
+wdt_set_heartbeat(int t)
+{
+       if ((t < 1) || (t > 255))
+               return -EINVAL;
+
+       timeout = t;
+       return 0;
+}
+
+static ssize_t
+wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
+{
+       if (count) {
+               if (!nowayout) {
+                       size_t i;
+
+                       expect_close = 0;
+
+                       for (i = 0; i != count; i++) {
+                               char c;
+                               if (get_user(c, buf+i))
+                                       return -EFAULT;
+                               if (c == 'V')
+                                       expect_close = 42;
+                       }
+               }
+               wdt_ping();
+       }
+       return count;
+}
+
+static int
+wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+         unsigned long arg)
+{
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
+       int new_timeout;
+       static struct watchdog_info ident = {
+               .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+               .firmware_version = 1,
+               .identity = "W83697HF WDT",
+       };
+
+       switch (cmd) {
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &ident, sizeof(ident)))
+                       return -EFAULT;
+               break;
+
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
+
+       case WDIOC_KEEPALIVE:
+               wdt_ping();
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, p))
+                       return -EFAULT;
+               if (wdt_set_heartbeat(new_timeout))
+                       return -EINVAL;
+               wdt_ping();
+               /* Fall */
+
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, p);
+
+       case WDIOC_SETOPTIONS:
+       {
+               int options, retval = -EINVAL;
+
+               if (get_user(options, p))
+                       return -EFAULT;
+
+               if (options & WDIOS_DISABLECARD) {
+                       wdt_disable();
+                       retval = 0;
+               }
+
+               if (options & WDIOS_ENABLECARD) {
+                       wdt_enable();
+                       retval = 0;
+               }
+
+               return retval;
+       }
+
+       default:
+               return -ENOTTY;
+       }
+       return 0;
+}
+
+static int
+wdt_open(struct inode *inode, struct file *file)
+{
+       if (test_and_set_bit(0, &wdt_is_open))
+               return -EBUSY;
+       /*
+        *      Activate
+        */
+
+       wdt_enable();
+       return nonseekable_open(inode, file);
+}
+
+static int
+wdt_close(struct inode *inode, struct file *file)
+{
+       if (expect_close == 42) {
+               wdt_disable();
+       } else {
+               printk (KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
+               wdt_ping();
+       }
+       expect_close = 0;
+       clear_bit(0, &wdt_is_open);
+       return 0;
+}
+
+/*
+ *     Notifier for system down
+ */
+
+static int
+wdt_notify_sys(struct notifier_block *this, unsigned long code,
+       void *unused)
+{
+       if (code == SYS_DOWN || code == SYS_HALT) {
+               /* Turn the WDT off */
+               wdt_disable();
+       }
+       return NOTIFY_DONE;
+}
+
+/*
+ *     Kernel Interfaces
+ */
+
+static struct file_operations wdt_fops = {
+       .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
+       .write          = wdt_write,
+       .ioctl          = wdt_ioctl,
+       .open           = wdt_open,
+       .release        = wdt_close,
+};
+
+static struct miscdevice wdt_miscdev = {
+       .minor = WATCHDOG_MINOR,
+       .name = "watchdog",
+       .fops = &wdt_fops,
+};
+
+/*
+ *     The WDT needs to learn about soft shutdowns in order to
+ *     turn the timebomb registers off.
+ */
+
+static struct notifier_block wdt_notifier = {
+       .notifier_call = wdt_notify_sys,
+};
+
+static int
+w83697hf_check_wdt(void)
+{
+       if (!request_region(wdt_io, 2, WATCHDOG_NAME)) {
+               printk (KERN_ERR PFX "I/O address 0x%x already in use\n", wdt_io);
+               return -EIO;
+       }
+
+       printk (KERN_DEBUG PFX "Looking for watchdog at address 0x%x\n", wdt_io);
+       w83697hf_unlock();
+       if (w83697hf_get_reg(0x20) == 0x60) {
+               printk (KERN_INFO PFX "watchdog found at address 0x%x\n", wdt_io);
+               w83697hf_lock();
+               return 0;
+       }
+       w83697hf_lock();        /* Reprotect in case it was a compatible device */
+
+       printk (KERN_INFO PFX "watchdog not found at address 0x%x\n", wdt_io);
+       release_region(wdt_io, 2);
+       return -EIO;
+}
+
+static int w83697hf_ioports[] = { 0x2e, 0x4e, 0x00 };
+
+static int __init
+wdt_init(void)
+{
+       int ret, i, found = 0;
+
+       spin_lock_init(&io_lock);
+
+       printk (KERN_INFO PFX "WDT driver for W83697HF/HG initializing\n");
+
+       if (wdt_io == 0) {
+               /* we will autodetect the W83697HF/HG watchdog */
+               for (i = 0; ((!found) && (w83697hf_ioports[i] != 0)); i++) {
+                       wdt_io = w83697hf_ioports[i];
+                       if (!w83697hf_check_wdt())
+                               found++;
+               }
+       } else {
+               if (!w83697hf_check_wdt())
+                       found++;
+       }
+
+       if (!found) {
+               printk (KERN_ERR PFX "No W83697HF/HG could be found\n");
+               ret = -EIO;
+               goto out;
+       }
+
+       w83697hf_init();
+       wdt_disable();  /* Disable watchdog until first use */
+
+       if (wdt_set_heartbeat(timeout)) {
+               wdt_set_heartbeat(WATCHDOG_TIMEOUT);
+               printk (KERN_INFO PFX "timeout value must be 1<=timeout<=255, using %d\n",
+                       WATCHDOG_TIMEOUT);
+       }
+
+       ret = register_reboot_notifier(&wdt_notifier);
+       if (ret != 0) {
+               printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       ret);
+               goto unreg_regions;
+       }
+
+       ret = misc_register(&wdt_miscdev);
+       if (ret != 0) {
+               printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       WATCHDOG_MINOR, ret);
+               goto unreg_reboot;
+       }
+
+       printk (KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n",
+               timeout, nowayout);
+
+out:
+       return ret;
+unreg_reboot:
+       unregister_reboot_notifier(&wdt_notifier);
+unreg_regions:
+       release_region(wdt_io, 2);
+       goto out;
+}
+
+static void __exit
+wdt_exit(void)
+{
+       misc_deregister(&wdt_miscdev);
+       unregister_reboot_notifier(&wdt_notifier);
+       release_region(wdt_io, 2);
+}
+
+module_init(wdt_init);
+module_exit(wdt_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Marcus Junker <junker@anduras.de>, Samuel Tardieu <sam@rfc1149.net>");
+MODULE_DESCRIPTION("w83697hf/hg WDT driver");
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
index 7ad3be8c0f49e4f0bfc1722418ba377e9712de74..7fcb77a9d0111855948d5a02003c2845e8f5a8b3 100644 (file)
@@ -54,8 +54,8 @@ static cycle_t acpi_pm_read_verified(void)
                v1 = read_pmtmr();
                v2 = read_pmtmr();
                v3 = read_pmtmr();
-       } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1)
-                       || (v3 > v1 && v3 < v2));
+       } while (unlikely((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1)
+                         || (v3 > v1 && v3 < v2)));
 
        return (cycle_t)v2;
 }
@@ -138,6 +138,8 @@ static void __devinit acpi_pm_check_graylist(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0,
                        acpi_pm_check_graylist);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_LE,
+                       acpi_pm_check_graylist);
 #endif
 
 
index 22d17474755f73ac86660c499e486750132f3c60..ca4e67a022d0eaa56edf97a1da2fbe63a1d70d3b 100644 (file)
@@ -70,9 +70,9 @@
 
 #define FCP_CMND(SCpnt) ((fcp_cmnd *)&(SCpnt->SCp))
 #define FC_SCMND(SCpnt) ((fc_channel *)(SCpnt->device->host->hostdata[0]))
-#define SC_FCMND(fcmnd) ((Scsi_Cmnd *)((long)fcmnd - (long)&(((Scsi_Cmnd *)0)->SCp)))
+#define SC_FCMND(fcmnd)        ((struct scsi_cmnd *)((long)fcmnd - (long)&(((struct scsi_cmnd *)0)->SCp)))
 
-static int fcp_scsi_queue_it(fc_channel *, Scsi_Cmnd *, fcp_cmnd *, int);
+static int fcp_scsi_queue_it(fc_channel *, struct scsi_cmnd *, fcp_cmnd *, int);
 void fcp_queue_empty(fc_channel *);
 
 static void fcp_scsi_insert_queue (fc_channel *fc, fcp_cmnd *fcmd)
@@ -378,14 +378,14 @@ void fcp_register(fc_channel *fc, u8 type, int unregister)
                printk ("FC: %segistering unknown type %02x\n", unregister ? "Unr" : "R", type);
 }
 
-static void fcp_scsi_done(Scsi_Cmnd *SCpnt);
+static void fcp_scsi_done(struct scsi_cmnd *SCpnt);
 
 static inline void fcp_scsi_receive(fc_channel *fc, int token, int status, fc_hdr *fch)
 {
        fcp_cmnd *fcmd;
        fcp_rsp  *rsp;
        int host_status;
-       Scsi_Cmnd *SCpnt;
+       struct scsi_cmnd *SCpnt;
        int sense_len;
        int rsp_status;
 
@@ -757,13 +757,14 @@ void fcp_release(fc_channel *fcchain, int count)  /* count must > 0 */
 }
 
 
-static void fcp_scsi_done (Scsi_Cmnd *SCpnt)
+static void fcp_scsi_done(struct scsi_cmnd *SCpnt)
 {
        if (FCP_CMND(SCpnt)->done)
                FCP_CMND(SCpnt)->done(SCpnt);
 }
 
-static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, int prepare)
+static int fcp_scsi_queue_it(fc_channel *fc, struct scsi_cmnd *SCpnt,
+                            fcp_cmnd *fcmd, int prepare)
 {
        long i;
        fcp_cmd *cmd;
@@ -837,7 +838,8 @@ static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, i
        return 0;
 }
 
-int fcp_scsi_queuecommand(Scsi_Cmnd *SCpnt, void (* done)(Scsi_Cmnd *))
+int fcp_scsi_queuecommand(struct scsi_cmnd *SCpnt,
+                         void (* done)(struct scsi_cmnd *))
 {
        fcp_cmnd *fcmd = FCP_CMND(SCpnt);
        fc_channel *fc = FC_SCMND(SCpnt);
@@ -873,7 +875,7 @@ void fcp_queue_empty(fc_channel *fc)
        }
 }
 
-int fcp_scsi_abort(Scsi_Cmnd *SCpnt)
+int fcp_scsi_abort(struct scsi_cmnd *SCpnt)
 {
        /* Internal bookkeeping only. Lose 1 cmd_slots slot. */
        fcp_cmnd *fcmd = FCP_CMND(SCpnt);
@@ -910,7 +912,7 @@ int fcp_scsi_abort(Scsi_Cmnd *SCpnt)
 }
 
 #if 0
-void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)
+void fcp_scsi_reset_done(struct scsi_cmnd *SCpnt)
 {
        fc_channel *fc = FC_SCMND(SCpnt);
 
@@ -921,7 +923,7 @@ void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)
 
 #define FCP_RESET_TIMEOUT (2*HZ)
 
-int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
+int fcp_scsi_dev_reset(struct scsi_cmnd *SCpnt)
 {
 #if 0 /* broken junk, but if davem wants to compile this driver, let him.. */
        unsigned long flags;
@@ -931,7 +933,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
         DECLARE_MUTEX_LOCKED(sem);
 
        if (!fc->rst_pkt) {
-               fc->rst_pkt = (Scsi_Cmnd *) kmalloc(sizeof(SCpnt), GFP_KERNEL);
+               fc->rst_pkt = (struct scsi_cmnd *) kmalloc(sizeof(SCpnt), GFP_KERNEL);
                if (!fc->rst_pkt) return FAILED;
                
                fcmd = FCP_CMND(fc->rst_pkt);
@@ -999,7 +1001,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
        return SUCCESS;
 }
 
-static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
+static int __fcp_scsi_host_reset(struct scsi_cmnd *SCpnt)
 {
        fc_channel *fc = FC_SCMND(SCpnt);
        fcp_cmnd *fcmd = FCP_CMND(SCpnt);
@@ -1020,7 +1022,7 @@ static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
        else return FAILED;
 }
 
-int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
+int fcp_scsi_host_reset(struct scsi_cmnd *SCpnt)
 {
        unsigned long flags;
        int rc;
index c397c84bef635668f4e3e8c79e51de0695d43812..1ac61330592e7ff162fba2b4f46898659df0b02e 100644 (file)
@@ -39,7 +39,7 @@ struct _fc_channel;
 typedef struct fcp_cmnd {
        struct fcp_cmnd         *next;
        struct fcp_cmnd         *prev;
-       void                    (*done)(Scsi_Cmnd *);
+       void                    (*done)(struct scsi_cmnd *);
        unsigned short          proto;
        unsigned short          token;
        unsigned int            did;
@@ -94,14 +94,14 @@ typedef struct _fc_channel {
        long                    *scsi_bitmap;
        long                    scsi_bitmap_end;
        int                     scsi_free;
-       int                     (*encode_addr)(Scsi_Cmnd *, u16 *, struct _fc_channel *, fcp_cmnd *);
+       int                     (*encode_addr)(struct scsi_cmnd *, u16 *, struct _fc_channel *, fcp_cmnd *);
        fcp_cmnd                *scsi_que;
        char                    scsi_name[4];
        fcp_cmnd                **cmd_slots;
        int                     channels;
        int                     targets;
        long                    *ages;
-       Scsi_Cmnd               *rst_pkt;
+       struct scsi_cmnd        *rst_pkt;
        fcp_posmap              *posmap;
        /* LOGIN stuff */
        fcp_cmnd                *login;
@@ -155,9 +155,10 @@ int fc_do_prli(fc_channel *, unsigned char);
        for_each_fc_channel(fc)                         \
                if (fc->state == FC_STATE_ONLINE)
 
-int fcp_scsi_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
-int fcp_scsi_abort(Scsi_Cmnd *);
-int fcp_scsi_dev_reset(Scsi_Cmnd *);
-int fcp_scsi_host_reset(Scsi_Cmnd *);
+int fcp_scsi_queuecommand(struct scsi_cmnd *,
+                         void (* done) (struct scsi_cmnd *));
+int fcp_scsi_abort(struct scsi_cmnd *);
+int fcp_scsi_dev_reset(struct scsi_cmnd *);
+int fcp_scsi_host_reset(struct scsi_cmnd *);
 
 #endif /* !(_FCP_SCSI_H) */
index b8b596d5778dbe03295395eccbad2176a25c3bfa..37deee6c0c1cc5aa4ca575797dea77d6ad792243 100644 (file)
@@ -326,6 +326,26 @@ char *dmi_get_system_info(int field)
 }
 EXPORT_SYMBOL(dmi_get_system_info);
 
+
+/**
+ *     dmi_name_in_vendors - Check if string is anywhere in the DMI vendor information.
+ *     @str:   Case sensitive Name
+ */
+int dmi_name_in_vendors(char *str)
+{
+       static int fields[] = { DMI_BIOS_VENDOR, DMI_BIOS_VERSION, DMI_SYS_VENDOR,
+                               DMI_PRODUCT_NAME, DMI_PRODUCT_VERSION, DMI_BOARD_VENDOR,
+                               DMI_BOARD_NAME, DMI_BOARD_VERSION, DMI_NONE };
+       int i;
+       for (i = 0; fields[i] != DMI_NONE; i++) {
+               int f = fields[i];
+               if (dmi_ident[f] && strstr(dmi_ident[f], str))
+                       return 1;
+       }
+       return 0;
+}
+EXPORT_SYMBOL(dmi_name_in_vendors);
+
 /**
  *     dmi_find_device - find onboard device by type/name
  *     @type: device type or %DMI_DEV_TYPE_ANY to match all device types
index 5b77a5bcbf0c113b7a95f8ffc04bfa302292677a..ad418ce882cae837a77537fc8e54f2b909bfac7f 100644 (file)
 
 static int ide_generic_all;            /* Set to claim all devices */
 
+/*
+ * the module_param_named() was added for the modular case
+ * the __setup() is left as compatibility for existing setups
+ */
+#ifndef MODULE
+static int __init ide_generic_all_on(char *unused)
+{
+       ide_generic_all = 1;
+       printk(KERN_INFO "IDE generic will claim all unknown PCI IDE storage controllers.");
+       return 1;
+}
+__setup("all-generic-ide", ide_generic_all_on);
+#endif
 module_param_named(all_generic_ide, ide_generic_all, bool, 0444);
 MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers.");
 
index e31c6c55b2e2158a8723fc33ccf581ba601198c6..58fca316786c274a8d5ef473abd7ad12414b4642 100644 (file)
@@ -6,7 +6,7 @@
 #include <asm/io.h>
 #include <asm/delay.h>
 #include <asm/adc.h>
-#include <asm/hp6xx/hp6xx.h>
+#include <asm/hp6xx.h>
 
 #define MODNAME "hp680_ts_input"
 
index d47d38ac71b16f31f530d1bfd9656eb0e288f401..d6f614738bbd732e24cd039af3a05ffb01e01373 100644 (file)
@@ -536,7 +536,7 @@ static int bitmap_read_sb(struct bitmap *bitmap)
                printk(KERN_INFO "%s: bitmap file is out of date (%llu < %llu) "
                        "-- forcing full recovery\n", bmname(bitmap), events,
                        (unsigned long long) bitmap->mddev->events);
-               sb->state |= BITMAP_STALE;
+               sb->state |= cpu_to_le32(BITMAP_STALE);
        }
 success:
        /* assign fields using values from superblock */
@@ -544,11 +544,11 @@ success:
        bitmap->daemon_sleep = daemon_sleep;
        bitmap->daemon_lastrun = jiffies;
        bitmap->max_write_behind = write_behind;
-       bitmap->flags |= sb->state;
+       bitmap->flags |= le32_to_cpu(sb->state);
        if (le32_to_cpu(sb->version) == BITMAP_MAJOR_HOSTENDIAN)
                bitmap->flags |= BITMAP_HOSTENDIAN;
        bitmap->events_cleared = le64_to_cpu(sb->events_cleared);
-       if (sb->state & BITMAP_STALE)
+       if (sb->state & cpu_to_le32(BITMAP_STALE))
                bitmap->events_cleared = bitmap->mddev->events;
        err = 0;
 out:
@@ -578,9 +578,9 @@ static void bitmap_mask_state(struct bitmap *bitmap, enum bitmap_state bits,
        spin_unlock_irqrestore(&bitmap->lock, flags);
        sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0);
        switch (op) {
-               case MASK_SET: sb->state |= bits;
+               case MASK_SET: sb->state |= cpu_to_le32(bits);
                                break;
-               case MASK_UNSET: sb->state &= ~bits;
+               case MASK_UNSET: sb->state &= cpu_to_le32(~bits);
                                break;
                default: BUG();
        }
index f7f19088f3be4f05aada21cd33873cda2d91d56b..7daa7b1e145f32d3736a48e7e9ee6e81f94c5bb8 100644 (file)
@@ -974,12 +974,13 @@ static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev)
  * version 1 superblock
  */
 
-static unsigned int calc_sb_1_csum(struct mdp_superblock_1 * sb)
+static __le32 calc_sb_1_csum(struct mdp_superblock_1 * sb)
 {
-       unsigned int disk_csum, csum;
+       __le32 disk_csum;
+       u32 csum;
        unsigned long long newcsum;
        int size = 256 + le32_to_cpu(sb->max_dev)*2;
-       unsigned int *isuper = (unsigned int*)sb;
+       __le32 *isuper = (__le32*)sb;
        int i;
 
        disk_csum = sb->sb_csum;
@@ -989,7 +990,7 @@ static unsigned int calc_sb_1_csum(struct mdp_superblock_1 * sb)
                newcsum += le32_to_cpu(*isuper++);
 
        if (size == 2)
-               newcsum += le16_to_cpu(*(unsigned short*) isuper);
+               newcsum += le16_to_cpu(*(__le16*) isuper);
 
        csum = (newcsum & 0xffffffff) + (newcsum >> 32);
        sb->sb_csum = disk_csum;
@@ -1106,7 +1107,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
        if (le32_to_cpu(sb->chunksize))
                rdev->size &= ~((sector_t)le32_to_cpu(sb->chunksize)/2 - 1);
 
-       if (le32_to_cpu(sb->size) > rdev->size*2)
+       if (le64_to_cpu(sb->size) > rdev->size*2)
                return -EINVAL;
        return ret;
 }
@@ -1228,7 +1229,7 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
        else
                sb->resync_offset = cpu_to_le64(0);
 
-       sb->cnt_corrected_read = atomic_read(&rdev->corrected_errors);
+       sb->cnt_corrected_read = cpu_to_le32(atomic_read(&rdev->corrected_errors));
 
        sb->raid_disks = cpu_to_le32(mddev->raid_disks);
        sb->size = cpu_to_le64(mddev->size<<1);
index 171ff41b52b053e7acdc2f6c78e0ef34ed2bd695..a6260f0e3b9e57bf756ac32c8e75f15c37d47f12 100644 (file)
@@ -501,7 +501,7 @@ static int multipath_run (mddev_t *mddev)
                        mdname(mddev));
                goto out_free_conf;
        }
-       mddev->degraded = conf->raid_disks = conf->working_disks;
+       mddev->degraded = conf->raid_disks - conf->working_disks;
 
        conf->pool = mempool_create_kzalloc_pool(NR_RESERVED_BUFS,
                                                 sizeof(struct multipath_bh));
index 1250f0eab4afaf7b2c946a3c3767c25efc062bfc..74f17a9a6ebb78cca440a4c08b317b3f74a414a3 100644 (file)
@@ -2079,7 +2079,7 @@ static int run(mddev_t *mddev)
                disk = conf->mirrors + i;
 
                if (!disk->rdev ||
-                   !test_bit(In_sync, &rdev->flags)) {
+                   !test_bit(In_sync, &disk->rdev->flags)) {
                        disk->head_position = 0;
                        mddev->degraded++;
                }
index c537d71c18e42721632c4fb15493659525a74ad6..a4afad4ecab23ef09ac190a5e33fdb6554cdce54 100644 (file)
@@ -75,8 +75,8 @@
 #define COPYRIGHT      "Copyright (c) 1999-2005 " MODULEAUTHOR
 #endif
 
-#define MPT_LINUX_VERSION_COMMON       "3.04.01"
-#define MPT_LINUX_PACKAGE_NAME         "@(#)mptlinux-3.04.01"
+#define MPT_LINUX_VERSION_COMMON       "3.04.02"
+#define MPT_LINUX_PACKAGE_NAME         "@(#)mptlinux-3.04.02"
 #define WHAT_MAGIC_STRING              "@" "(" "#" ")"
 
 #define show_mptmod_ver(s,ver)  \
index e57bb035a021e8e8ebe9d6be48e1f9acea473c97..1dd491773150f9f63089923f8eb40f5caa95ee4f 100644 (file)
@@ -96,6 +96,10 @@ static int mptfc_qcmd(struct scsi_cmnd *SCpnt,
 static void mptfc_target_destroy(struct scsi_target *starget);
 static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout);
 static void __devexit mptfc_remove(struct pci_dev *pdev);
+static int mptfc_abort(struct scsi_cmnd *SCpnt);
+static int mptfc_dev_reset(struct scsi_cmnd *SCpnt);
+static int mptfc_bus_reset(struct scsi_cmnd *SCpnt);
+static int mptfc_host_reset(struct scsi_cmnd *SCpnt);
 
 static struct scsi_host_template mptfc_driver_template = {
        .module                         = THIS_MODULE,
@@ -110,10 +114,10 @@ static struct scsi_host_template mptfc_driver_template = {
        .target_destroy                 = mptfc_target_destroy,
        .slave_destroy                  = mptscsih_slave_destroy,
        .change_queue_depth             = mptscsih_change_queue_depth,
-       .eh_abort_handler               = mptscsih_abort,
-       .eh_device_reset_handler        = mptscsih_dev_reset,
-       .eh_bus_reset_handler           = mptscsih_bus_reset,
-       .eh_host_reset_handler          = mptscsih_host_reset,
+       .eh_abort_handler               = mptfc_abort,
+       .eh_device_reset_handler        = mptfc_dev_reset,
+       .eh_bus_reset_handler           = mptfc_bus_reset,
+       .eh_host_reset_handler          = mptfc_host_reset,
        .bios_param                     = mptscsih_bios_param,
        .can_queue                      = MPT_FC_CAN_QUEUE,
        .this_id                        = -1,
@@ -171,6 +175,77 @@ static struct fc_function_template mptfc_transport_functions = {
        .show_host_symbolic_name = 1,
 };
 
+static int
+mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
+                         int (*func)(struct scsi_cmnd *SCpnt),
+                         const char *caller)
+{
+       struct scsi_device      *sdev = SCpnt->device;
+       struct Scsi_Host        *shost = sdev->host;
+       struct fc_rport         *rport = starget_to_rport(scsi_target(sdev));
+       unsigned long           flags;
+       int                     ready;
+
+       spin_lock_irqsave(shost->host_lock, flags);
+       while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY) {
+               spin_unlock_irqrestore(shost->host_lock, flags);
+               dfcprintk ((MYIOC_s_INFO_FMT
+                       "mptfc_block_error_handler.%d: %d:%d, port status is "
+                       "DID_IMM_RETRY, deferring %s recovery.\n",
+                       ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
+                       ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
+                       SCpnt->device->id,SCpnt->device->lun,caller));
+               msleep(1000);
+               spin_lock_irqsave(shost->host_lock, flags);
+       }
+       spin_unlock_irqrestore(shost->host_lock, flags);
+
+       if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata) {
+               dfcprintk ((MYIOC_s_INFO_FMT
+                       "%s.%d: %d:%d, failing recovery, "
+                       "port state %d, vdev %p.\n", caller,
+                       ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
+                       ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
+                       SCpnt->device->id,SCpnt->device->lun,ready,
+                       SCpnt->device->hostdata));
+               return FAILED;
+       }
+       dfcprintk ((MYIOC_s_INFO_FMT
+               "%s.%d: %d:%d, executing recovery.\n", caller,
+               ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
+               ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
+               SCpnt->device->id,SCpnt->device->lun));
+       return (*func)(SCpnt);
+}
+
+static int
+mptfc_abort(struct scsi_cmnd *SCpnt)
+{
+       return
+           mptfc_block_error_handler(SCpnt, mptscsih_abort, __FUNCTION__);
+}
+
+static int
+mptfc_dev_reset(struct scsi_cmnd *SCpnt)
+{
+       return
+           mptfc_block_error_handler(SCpnt, mptscsih_dev_reset, __FUNCTION__);
+}
+
+static int
+mptfc_bus_reset(struct scsi_cmnd *SCpnt)
+{
+       return
+           mptfc_block_error_handler(SCpnt, mptscsih_bus_reset, __FUNCTION__);
+}
+
+static int
+mptfc_host_reset(struct scsi_cmnd *SCpnt)
+{
+       return
+           mptfc_block_error_handler(SCpnt, mptscsih_host_reset, __FUNCTION__);
+}
+
 static void
 mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
 {
@@ -562,6 +637,12 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
                return 0;
        }
 
+       if (!SCpnt->device->hostdata) { /* vdev */
+               SCpnt->result = DID_NO_CONNECT << 16;
+               done(SCpnt);
+               return 0;
+       }
+
        /* dd_data is null until finished adding target */
        ri = *((struct mptfc_rport_info **)rport->dd_data);
        if (unlikely(!ri)) {
index 91f95d172ca54097a0b2b14d767b11aa179fed74..01a5a702b037e9c12e22fd1ef43ebd211b8f4204 100644 (file)
@@ -127,7 +127,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, struct i2o_message *msg,
        DECLARE_WAIT_QUEUE_HEAD(wq);
        struct i2o_exec_wait *wait;
        static u32 tcntxt = 0x80000000;
-       long flags;
+       unsigned long flags;
        int rc = 0;
 
        wait = i2o_exec_wait_alloc();
index b6c045dc97b4e1331e426323aa4010daffe67e0f..00db31c314e0d9d30a8287eed91cea12de375665 100644 (file)
@@ -30,6 +30,7 @@ config IBM_ASM
 
 config SGI_IOC4
        tristate "SGI IOC4 Base IO support"
+       depends on PCI
        ---help---
          This option enables basic support for the IOC4 chip on certain
          SGI IO controller cards (IO9, IO10, and PCI-RT).  This option
index 1c3c14a3839cff9d7a0f2a990ef0fa683b8d83d5..79354bbbbd6a12c8ae0e22de5b73cda47da8fde8 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/ktime.h>
 #include <linux/mutex.h>
 #include <linux/time.h>
+#include <asm/io.h>
 
 /***************
  * Definitions *
index 2bacff60913dc293e291fc7088004e9c52221d18..0fdc55b08a6daa72cb60ccdd8fc981e0cc648f7b 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/mmc/protocol.h>
 #include <linux/mmc/host.h>
 #include <linux/highmem.h>
+#include <asm/io.h>
 
 #define DRIVER_NAME "tifm_sd"
 #define DRIVER_VERSION "0.6"
index e2ed24918a589fd7f0d0414597f8cc974a4d48fc..e38846eb51faa95e606b3f5e555e0a54137fb63d 100644 (file)
@@ -2717,6 +2717,7 @@ config PPP_MPPE
        select CRYPTO
        select CRYPTO_SHA1
        select CRYPTO_ARC4
+       select CRYPTO_ECB
        ---help---
          Support for the MPPE Encryption protocol, as employed by the
         Microsoft Point-to-Point Tunneling Protocol.
index ea16078cfe98bd95169e626b203a77194a935ace..d1105e569a41260b3187ef81ca9588807e59dffb 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/list.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
+#include <linux/dma-mapping.h>
 #include <linux/linkage.h>
 #include <asm/atomic.h>
 
index 8f882690994d9944a947edfbdac794b2a4017680..74c0eac083e46a19d5026c385350268b6fa39047 100644 (file)
@@ -107,6 +107,10 @@ zfcp_address_to_sg(void *address, struct scatterlist *list)
        (ZFCP_MAX_SBALS_PER_REQ * ZFCP_MAX_SBALES_PER_SBAL - 2)
         /* request ID + QTCB in SBALE 0 + 1 of first SBAL in chain */
 
+#define ZFCP_MAX_SECTORS (ZFCP_MAX_SBALES_PER_REQ * 8)
+        /* max. number of (data buffer) SBALEs in largest SBAL chain
+           multiplied with number of sectors per 4k block */
+
 /* FIXME(tune): free space should be one max. SBAL chain plus what? */
 #define ZFCP_QDIO_PCI_INTERVAL         (QDIO_MAX_BUFFERS_PER_Q \
                                          - (ZFCP_MAX_SBALS_PER_REQ + 4))
index 4d2bc7981324b4fc5abe939fbcca0f26895e0c91..452d96f92a1482a5611a79e5712a2c53f04d31ad 100644 (file)
@@ -58,6 +58,7 @@ struct zfcp_data zfcp_data = {
                .cmd_per_lun            = 1,
                .use_clustering         = 1,
                .sdev_attrs             = zfcp_sysfs_sdev_attrs,
+               .max_sectors            = ZFCP_MAX_SECTORS,
        },
        .driver_version = ZFCP_VERSION,
 };
index df3346b5caf8a722fe14c2b137401ab5a3978da3..170a4344cbb2a62ee9446dd57e40339a1b7d98ff 100644 (file)
@@ -53,14 +53,6 @@ struct ahd_platform_data;
 struct scb_platform_data;
 
 /****************************** Useful Macros *********************************/
-#ifndef MAX
-#define MAX(a,b) (((a) > (b)) ? (a) : (b))
-#endif
-
-#ifndef MIN
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
 #ifndef TRUE
 #define TRUE 1
 #endif
@@ -972,8 +964,6 @@ int         ahd_read_seeprom(struct ahd_softc *ahd, uint16_t *buf,
 
 int            ahd_write_seeprom(struct ahd_softc *ahd, uint16_t *buf,
                                  u_int start_addr, u_int count);
-int            ahd_wait_seeprom(struct ahd_softc *ahd);
-int            ahd_verify_vpd_cksum(struct vpd_config *vpd);
 int            ahd_verify_cksum(struct seeprom_config *sc);
 int            ahd_acquire_seeprom(struct ahd_softc *ahd);
 void           ahd_release_seeprom(struct ahd_softc *ahd);
@@ -1320,8 +1310,6 @@ struct ahd_pci_identity {
        char                    *name;
        ahd_device_setup_t      *setup;
 };
-extern struct ahd_pci_identity ahd_pci_ident_table [];
-extern const u_int ahd_num_pci_devs;
 
 /***************************** VL/EISA Declarations ***************************/
 struct aic7770_identity {
@@ -1339,15 +1327,6 @@ extern const int ahd_num_aic7770_devs;
 /*************************** Function Declarations ****************************/
 /******************************************************************************/
 void                   ahd_reset_cmds_pending(struct ahd_softc *ahd);
-u_int                  ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl);
-void                   ahd_busy_tcl(struct ahd_softc *ahd,
-                                    u_int tcl, u_int busyid);
-static __inline void   ahd_unbusy_tcl(struct ahd_softc *ahd, u_int tcl);
-static __inline void
-ahd_unbusy_tcl(struct ahd_softc *ahd, u_int tcl)
-{
-       ahd_busy_tcl(ahd, tcl, SCB_LIST_NULL);
-}
 
 /***************************** PCI Front End *********************************/
 struct ahd_pci_identity *ahd_find_pci_device(ahd_dev_softc_t);
@@ -1356,7 +1335,6 @@ int                         ahd_pci_config(struct ahd_softc *,
 int    ahd_pci_test_register_access(struct ahd_softc *);
 
 /************************** SCB and SCB queue management **********************/
-int            ahd_probe_scbs(struct ahd_softc *);
 void           ahd_qinfifo_requeue_tail(struct ahd_softc *ahd,
                                         struct scb *scb);
 int            ahd_match_scb(struct ahd_softc *ahd, struct scb *scb,
@@ -1374,33 +1352,20 @@ int                      ahd_parse_vpddata(struct ahd_softc *ahd,
 int                     ahd_parse_cfgdata(struct ahd_softc *ahd,
                                           struct seeprom_config *sc);
 void                    ahd_intr_enable(struct ahd_softc *ahd, int enable);
-void                    ahd_update_coalescing_values(struct ahd_softc *ahd,
-                                                     u_int timer,
-                                                     u_int maxcmds,
-                                                     u_int mincmds);
-void                    ahd_enable_coalescing(struct ahd_softc *ahd,
-                                              int enable);
 void                    ahd_pause_and_flushwork(struct ahd_softc *ahd);
 int                     ahd_suspend(struct ahd_softc *ahd); 
-int                     ahd_resume(struct ahd_softc *ahd);
 void                    ahd_set_unit(struct ahd_softc *, int);
 void                    ahd_set_name(struct ahd_softc *, char *);
 struct scb             *ahd_get_scb(struct ahd_softc *ahd, u_int col_idx);
 void                    ahd_free_scb(struct ahd_softc *ahd, struct scb *scb);
-void                    ahd_alloc_scbs(struct ahd_softc *ahd);
 void                    ahd_free(struct ahd_softc *ahd);
 int                     ahd_reset(struct ahd_softc *ahd, int reinit);
-void                    ahd_shutdown(void *arg);
 int                     ahd_write_flexport(struct ahd_softc *ahd,
                                            u_int addr, u_int value);
 int                     ahd_read_flexport(struct ahd_softc *ahd, u_int addr,
                                           uint8_t *value);
-int                     ahd_wait_flexport(struct ahd_softc *ahd);
 
 /*************************** Interrupt Services *******************************/
-void                   ahd_pci_intr(struct ahd_softc *ahd);
-void                   ahd_clear_intstat(struct ahd_softc *ahd);
-void                   ahd_flush_qoutfifo(struct ahd_softc *ahd);
 void                   ahd_run_qoutfifo(struct ahd_softc *ahd);
 #ifdef AHD_TARGET_MODE
 void                   ahd_run_tqinfifo(struct ahd_softc *ahd, int paused);
@@ -1409,7 +1374,6 @@ void                      ahd_handle_hwerrint(struct ahd_softc *ahd);
 void                   ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat);
 void                   ahd_handle_scsiint(struct ahd_softc *ahd,
                                           u_int intstat);
-void                   ahd_clear_critical_section(struct ahd_softc *ahd);
 
 /***************************** Error Recovery *********************************/
 typedef enum {
@@ -1426,23 +1390,9 @@ int                      ahd_search_disc_list(struct ahd_softc *ahd, int target,
                                             char channel, int lun, u_int tag,
                                             int stop_on_first, int remove,
                                             int save_state);
-void                   ahd_freeze_devq(struct ahd_softc *ahd, struct scb *scb);
 int                    ahd_reset_channel(struct ahd_softc *ahd, char channel,
                                          int initiate_reset);
-int                    ahd_abort_scbs(struct ahd_softc *ahd, int target,
-                                      char channel, int lun, u_int tag,
-                                      role_t role, uint32_t status);
-void                   ahd_restart(struct ahd_softc *ahd);
-void                   ahd_clear_fifo(struct ahd_softc *ahd, u_int fifo);
-void                   ahd_handle_scb_status(struct ahd_softc *ahd,
-                                             struct scb *scb);
-void                   ahd_handle_scsi_status(struct ahd_softc *ahd,
-                                              struct scb *scb);
-void                   ahd_calc_residual(struct ahd_softc *ahd,
-                                         struct scb *scb);
 /*************************** Utility Functions ********************************/
-struct ahd_phase_table_entry*
-                       ahd_lookup_phase_entry(int phase);
 void                   ahd_compile_devinfo(struct ahd_devinfo *devinfo,
                                            u_int our_id, u_int target,
                                            u_int lun, char channel,
@@ -1450,14 +1400,6 @@ void                     ahd_compile_devinfo(struct ahd_devinfo *devinfo,
 /************************** Transfer Negotiation ******************************/
 void                   ahd_find_syncrate(struct ahd_softc *ahd, u_int *period,
                                          u_int *ppr_options, u_int maxsync);
-void                   ahd_validate_offset(struct ahd_softc *ahd,
-                                           struct ahd_initiator_tinfo *tinfo,
-                                           u_int period, u_int *offset,
-                                           int wide, role_t role);
-void                   ahd_validate_width(struct ahd_softc *ahd,
-                                          struct ahd_initiator_tinfo *tinfo,
-                                          u_int *bus_width,
-                                          role_t role);
 /*
  * Negotiation types.  These are used to qualify if we should renegotiate
  * even if our goal and current transport parameters are identical.
@@ -1486,11 +1428,6 @@ typedef enum {
        AHD_QUEUE_TAGGED
 } ahd_queue_alg;
 
-void                   ahd_set_tags(struct ahd_softc *ahd,
-                                    struct scsi_cmnd *cmd,
-                                    struct ahd_devinfo *devinfo,
-                                    ahd_queue_alg alg);
-
 /**************************** Target Mode *************************************/
 #ifdef AHD_TARGET_MODE
 void           ahd_send_lstate_events(struct ahd_softc *,
@@ -1528,10 +1465,8 @@ extern uint32_t ahd_debug;
 #define AHD_SHOW_INT_COALESCING        0x10000
 #define AHD_DEBUG_SEQUENCER    0x20000
 #endif
-void                   ahd_print_scb(struct scb *scb);
 void                   ahd_print_devinfo(struct ahd_softc *ahd,
                                          struct ahd_devinfo *devinfo);
-void                   ahd_dump_sglist(struct scb *scb);
 void                   ahd_dump_card_state(struct ahd_softc *ahd);
 int                    ahd_print_register(ahd_reg_parse_entry_t *table,
                                           u_int num_entries,
@@ -1540,5 +1475,4 @@ int                       ahd_print_register(ahd_reg_parse_entry_t *table,
                                           u_int value,
                                           u_int *cur_column,
                                           u_int wrap_point);
-void                   ahd_dump_scbs(struct ahd_softc *ahd);
 #endif /* _AIC79XX_H_ */
index 653818d2f80255d824fd3deb79b029af6c54931f..07a86a30f676c4d2c64afec835ce44f01201a697 100644 (file)
@@ -52,7 +52,7 @@
 
 
 /***************************** Lookup Tables **********************************/
-char *ahd_chip_names[] =
+static char *ahd_chip_names[] =
 {
        "NONE",
        "aic7901",
@@ -237,10 +237,33 @@ static int                ahd_handle_target_cmd(struct ahd_softc *ahd,
                                              struct target_cmd *cmd);
 #endif
 
+static int             ahd_abort_scbs(struct ahd_softc *ahd, int target,
+                                      char channel, int lun, u_int tag,
+                                      role_t role, uint32_t status);
+static void            ahd_alloc_scbs(struct ahd_softc *ahd);
+static void            ahd_busy_tcl(struct ahd_softc *ahd, u_int tcl,
+                                    u_int scbid);
+static void            ahd_calc_residual(struct ahd_softc *ahd,
+                                         struct scb *scb);
+static void            ahd_clear_critical_section(struct ahd_softc *ahd);
+static void            ahd_clear_intstat(struct ahd_softc *ahd);
+static void            ahd_enable_coalescing(struct ahd_softc *ahd,
+                                             int enable);
+static u_int           ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl);
+static void            ahd_freeze_devq(struct ahd_softc *ahd,
+                                       struct scb *scb);
+static void            ahd_handle_scb_status(struct ahd_softc *ahd,
+                                             struct scb *scb);
+static struct ahd_phase_table_entry* ahd_lookup_phase_entry(int phase);
+static void            ahd_shutdown(void *arg);
+static void            ahd_update_coalescing_values(struct ahd_softc *ahd,
+                                                    u_int timer,
+                                                    u_int maxcmds,
+                                                    u_int mincmds);
+static int             ahd_verify_vpd_cksum(struct vpd_config *vpd);
+static int             ahd_wait_seeprom(struct ahd_softc *ahd);
+
 /******************************** Private Inlines *****************************/
-static __inline void   ahd_assert_atn(struct ahd_softc *ahd);
-static __inline int    ahd_currently_packetized(struct ahd_softc *ahd);
-static __inline int    ahd_set_active_fifo(struct ahd_softc *ahd);
 
 static __inline void
 ahd_assert_atn(struct ahd_softc *ahd)
@@ -294,11 +317,44 @@ ahd_set_active_fifo(struct ahd_softc *ahd)
        }
 }
 
+static __inline void
+ahd_unbusy_tcl(struct ahd_softc *ahd, u_int tcl)
+{
+       ahd_busy_tcl(ahd, tcl, SCB_LIST_NULL);
+}
+
+/*
+ * Determine whether the sequencer reported a residual
+ * for this SCB/transaction.
+ */
+static __inline void
+ahd_update_residual(struct ahd_softc *ahd, struct scb *scb)
+{
+       uint32_t sgptr;
+
+       sgptr = ahd_le32toh(scb->hscb->sgptr);
+       if ((sgptr & SG_STATUS_VALID) != 0)
+               ahd_calc_residual(ahd, scb);
+}
+
+static __inline void
+ahd_complete_scb(struct ahd_softc *ahd, struct scb *scb)
+{
+       uint32_t sgptr;
+
+       sgptr = ahd_le32toh(scb->hscb->sgptr);
+       if ((sgptr & SG_STATUS_VALID) != 0)
+               ahd_handle_scb_status(ahd, scb);
+       else
+               ahd_done(ahd, scb);
+}
+
+
 /************************* Sequencer Execution Control ************************/
 /*
  * Restart the sequencer program from address zero
  */
-void
+static void
 ahd_restart(struct ahd_softc *ahd)
 {
 
@@ -342,7 +398,7 @@ ahd_restart(struct ahd_softc *ahd)
        ahd_unpause(ahd);
 }
 
-void
+static void
 ahd_clear_fifo(struct ahd_softc *ahd, u_int fifo)
 {
        ahd_mode_state   saved_modes;
@@ -366,7 +422,7 @@ ahd_clear_fifo(struct ahd_softc *ahd, u_int fifo)
  * Flush and completed commands that are sitting in the command
  * complete queues down on the chip but have yet to be dma'ed back up.
  */
-void
+static void
 ahd_flush_qoutfifo(struct ahd_softc *ahd)
 {
        struct          scb *scb;
@@ -905,6 +961,51 @@ ahd_handle_hwerrint(struct ahd_softc *ahd)
        ahd_free(ahd);
 }
 
+#ifdef AHD_DEBUG
+static void
+ahd_dump_sglist(struct scb *scb)
+{
+       int i;
+
+       if (scb->sg_count > 0) {
+               if ((scb->ahd_softc->flags & AHD_64BIT_ADDRESSING) != 0) {
+                       struct ahd_dma64_seg *sg_list;
+
+                       sg_list = (struct ahd_dma64_seg*)scb->sg_list;
+                       for (i = 0; i < scb->sg_count; i++) {
+                               uint64_t addr;
+                               uint32_t len;
+
+                               addr = ahd_le64toh(sg_list[i].addr);
+                               len = ahd_le32toh(sg_list[i].len);
+                               printf("sg[%d] - Addr 0x%x%x : Length %d%s\n",
+                                      i,
+                                      (uint32_t)((addr >> 32) & 0xFFFFFFFF),
+                                      (uint32_t)(addr & 0xFFFFFFFF),
+                                      sg_list[i].len & AHD_SG_LEN_MASK,
+                                      (sg_list[i].len & AHD_DMA_LAST_SEG)
+                                    ? " Last" : "");
+                       }
+               } else {
+                       struct ahd_dma_seg *sg_list;
+
+                       sg_list = (struct ahd_dma_seg*)scb->sg_list;
+                       for (i = 0; i < scb->sg_count; i++) {
+                               uint32_t len;
+
+                               len = ahd_le32toh(sg_list[i].len);
+                               printf("sg[%d] - Addr 0x%x%x : Length %d%s\n",
+                                      i,
+                                      (len & AHD_SG_HIGH_ADDR_MASK) >> 24,
+                                      ahd_le32toh(sg_list[i].addr),
+                                      len & AHD_SG_LEN_MASK,
+                                      len & AHD_DMA_LAST_SEG ? " Last" : "");
+                       }
+               }
+       }
+}
+#endif  /*  AHD_DEBUG  */
+
 void
 ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
 {
@@ -1053,10 +1154,12 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
                         * If a target takes us into the command phase
                         * assume that it has been externally reset and
                         * has thus lost our previous packetized negotiation
-                        * agreement.
-                        * Revert to async/narrow transfers until we
-                        * can renegotiate with the device and notify
-                        * the OSM about the reset.
+                        * agreement.  Since we have not sent an identify
+                        * message and may not have fully qualified the
+                        * connection, we change our command to TUR, assert
+                        * ATN and ABORT the task when we go to message in
+                        * phase.  The OSM will see the REQUEUE_REQUEST
+                        * status and retry the command.
                         */
                        scbid = ahd_get_scbptr(ahd);
                        scb = ahd_lookup_scb(ahd, scbid);
@@ -1083,7 +1186,28 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
                        ahd_set_syncrate(ahd, &devinfo, /*period*/0,
                                         /*offset*/0, /*ppr_options*/0,
                                         AHD_TRANS_ACTIVE, /*paused*/TRUE);
-                       scb->flags |= SCB_EXTERNAL_RESET;
+                       /* Hand-craft TUR command */
+                       ahd_outb(ahd, SCB_CDB_STORE, 0);
+                       ahd_outb(ahd, SCB_CDB_STORE+1, 0);
+                       ahd_outb(ahd, SCB_CDB_STORE+2, 0);
+                       ahd_outb(ahd, SCB_CDB_STORE+3, 0);
+                       ahd_outb(ahd, SCB_CDB_STORE+4, 0);
+                       ahd_outb(ahd, SCB_CDB_STORE+5, 0);
+                       ahd_outb(ahd, SCB_CDB_LEN, 6);
+                       scb->hscb->control &= ~(TAG_ENB|SCB_TAG_TYPE);
+                       scb->hscb->control |= MK_MESSAGE;
+                       ahd_outb(ahd, SCB_CONTROL, scb->hscb->control);
+                       ahd_outb(ahd, MSG_OUT, HOST_MSG);
+                       ahd_outb(ahd, SAVED_SCSIID, scb->hscb->scsiid);
+                       /*
+                        * The lun is 0, regardless of the SCB's lun
+                        * as we have not sent an identify message.
+                        */
+                       ahd_outb(ahd, SAVED_LUN, 0);
+                       ahd_outb(ahd, SEQ_FLAGS, 0);
+                       ahd_assert_atn(ahd);
+                       scb->flags &= ~SCB_PACKETIZED;
+                       scb->flags |= SCB_ABORT|SCB_EXTERNAL_RESET;
                        ahd_freeze_devq(ahd, scb);
                        ahd_set_transaction_status(scb, CAM_REQUEUE_REQ);
                        ahd_freeze_scb(scb);
@@ -1519,8 +1643,10 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat)
        /*
         * Ignore external resets after a bus reset.
         */
-       if (((status & SCSIRSTI) != 0) && (ahd->flags & AHD_BUS_RESET_ACTIVE))
+       if (((status & SCSIRSTI) != 0) && (ahd->flags & AHD_BUS_RESET_ACTIVE)) {
+               ahd_outb(ahd, CLRSINT1, CLRSCSIRSTI);
                return;
+       }
 
        /*
         * Clear bus reset flag
@@ -2200,6 +2326,22 @@ ahd_handle_nonpkt_busfree(struct ahd_softc *ahd)
                        if (sent_msg == MSG_ABORT_TAG)
                                tag = SCB_GET_TAG(scb);
 
+                       if ((scb->flags & SCB_EXTERNAL_RESET) != 0) {
+                               /*
+                                * This abort is in response to an
+                                * unexpected switch to command phase
+                                * for a packetized connection.  Since
+                                * the identify message was never sent,
+                                * "saved lun" is 0.  We really want to
+                                * abort only the SCB that encountered
+                                * this error, which could have a different
+                                * lun.  The SCB will be retried so the OS
+                                * will see the UA after renegotiating to
+                                * packetized.
+                                */
+                               tag = SCB_GET_TAG(scb);
+                               saved_lun = scb->hscb->lun;
+                       }
                        found = ahd_abort_scbs(ahd, target, 'A', saved_lun,
                                               tag, ROLE_INITIATOR,
                                               CAM_REQ_ABORTED);
@@ -2523,7 +2665,7 @@ ahd_force_renegotiation(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
 }
 
 #define AHD_MAX_STEPS 2000
-void
+static void
 ahd_clear_critical_section(struct ahd_softc *ahd)
 {
        ahd_mode_state  saved_modes;
@@ -2646,7 +2788,7 @@ ahd_clear_critical_section(struct ahd_softc *ahd)
 /*
  * Clear any pending interrupt status.
  */
-void
+static void
 ahd_clear_intstat(struct ahd_softc *ahd)
 {
        AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK),
@@ -2677,6 +2819,8 @@ ahd_clear_intstat(struct ahd_softc *ahd)
 #ifdef AHD_DEBUG
 uint32_t ahd_debug = AHD_DEBUG_OPTS;
 #endif
+
+#if 0
 void
 ahd_print_scb(struct scb *scb)
 {
@@ -2701,49 +2845,7 @@ ahd_print_scb(struct scb *scb)
               SCB_GET_TAG(scb));
        ahd_dump_sglist(scb);
 }
-
-void
-ahd_dump_sglist(struct scb *scb)
-{
-       int i;
-
-       if (scb->sg_count > 0) {
-               if ((scb->ahd_softc->flags & AHD_64BIT_ADDRESSING) != 0) {
-                       struct ahd_dma64_seg *sg_list;
-
-                       sg_list = (struct ahd_dma64_seg*)scb->sg_list;
-                       for (i = 0; i < scb->sg_count; i++) {
-                               uint64_t addr;
-                               uint32_t len;
-
-                               addr = ahd_le64toh(sg_list[i].addr);
-                               len = ahd_le32toh(sg_list[i].len);
-                               printf("sg[%d] - Addr 0x%x%x : Length %d%s\n",
-                                      i,
-                                      (uint32_t)((addr >> 32) & 0xFFFFFFFF),
-                                      (uint32_t)(addr & 0xFFFFFFFF),
-                                      sg_list[i].len & AHD_SG_LEN_MASK,
-                                      (sg_list[i].len & AHD_DMA_LAST_SEG)
-                                    ? " Last" : "");
-                       }
-               } else {
-                       struct ahd_dma_seg *sg_list;
-
-                       sg_list = (struct ahd_dma_seg*)scb->sg_list;
-                       for (i = 0; i < scb->sg_count; i++) {
-                               uint32_t len;
-
-                               len = ahd_le32toh(sg_list[i].len);
-                               printf("sg[%d] - Addr 0x%x%x : Length %d%s\n",
-                                      i,
-                                      (len & AHD_SG_HIGH_ADDR_MASK) >> 24,
-                                      ahd_le32toh(sg_list[i].addr),
-                                      len & AHD_SG_LEN_MASK,
-                                      len & AHD_DMA_LAST_SEG ? " Last" : "");
-                       }
-               }
-       }
-}
+#endif  /*  0  */
 
 /************************* Transfer Negotiation *******************************/
 /*
@@ -2850,14 +2952,14 @@ ahd_devlimited_syncrate(struct ahd_softc *ahd,
                transinfo = &tinfo->goal;
        *ppr_options &= (transinfo->ppr_options|MSG_EXT_PPR_PCOMP_EN);
        if (transinfo->width == MSG_EXT_WDTR_BUS_8_BIT) {
-               maxsync = MAX(maxsync, AHD_SYNCRATE_ULTRA2);
+               maxsync = max(maxsync, (u_int)AHD_SYNCRATE_ULTRA2);
                *ppr_options &= ~MSG_EXT_PPR_DT_REQ;
        }
        if (transinfo->period == 0) {
                *period = 0;
                *ppr_options = 0;
        } else {
-               *period = MAX(*period, transinfo->period);
+               *period = max(*period, (u_int)transinfo->period);
                ahd_find_syncrate(ahd, period, ppr_options, maxsync);
        }
 }
@@ -2906,7 +3008,7 @@ ahd_find_syncrate(struct ahd_softc *ahd, u_int *period,
  * Truncate the given synchronous offset to a value the
  * current adapter type and syncrate are capable of.
  */
-void
+static void
 ahd_validate_offset(struct ahd_softc *ahd,
                    struct ahd_initiator_tinfo *tinfo,
                    u_int period, u_int *offset, int wide,
@@ -2924,12 +3026,12 @@ ahd_validate_offset(struct ahd_softc *ahd,
                        maxoffset = MAX_OFFSET_PACED;
        } else
                maxoffset = MAX_OFFSET_NON_PACED;
-       *offset = MIN(*offset, maxoffset);
+       *offset = min(*offset, maxoffset);
        if (tinfo != NULL) {
                if (role == ROLE_TARGET)
-                       *offset = MIN(*offset, tinfo->user.offset);
+                       *offset = min(*offset, (u_int)tinfo->user.offset);
                else
-                       *offset = MIN(*offset, tinfo->goal.offset);
+                       *offset = min(*offset, (u_int)tinfo->goal.offset);
        }
 }
 
@@ -2937,7 +3039,7 @@ ahd_validate_offset(struct ahd_softc *ahd,
  * Truncate the given transfer width parameter to a value the
  * current adapter type is capable of.
  */
-void
+static void
 ahd_validate_width(struct ahd_softc *ahd, struct ahd_initiator_tinfo *tinfo,
                   u_int *bus_width, role_t role)
 {
@@ -2955,9 +3057,9 @@ ahd_validate_width(struct ahd_softc *ahd, struct ahd_initiator_tinfo *tinfo,
        }
        if (tinfo != NULL) {
                if (role == ROLE_TARGET)
-                       *bus_width = MIN(tinfo->user.width, *bus_width);
+                       *bus_width = min((u_int)tinfo->user.width, *bus_width);
                else
-                       *bus_width = MIN(tinfo->goal.width, *bus_width);
+                       *bus_width = min((u_int)tinfo->goal.width, *bus_width);
        }
 }
 
@@ -3210,7 +3312,7 @@ ahd_set_width(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
 /*
  * Update the current state of tagged queuing for a given target.
  */
-void
+static void
 ahd_set_tags(struct ahd_softc *ahd, struct scsi_cmnd *cmd,
             struct ahd_devinfo *devinfo, ahd_queue_alg alg)
 {
@@ -3466,7 +3568,7 @@ ahd_print_devinfo(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
               devinfo->target, devinfo->lun);
 }
 
-struct ahd_phase_table_entry*
+static struct ahd_phase_table_entry*
 ahd_lookup_phase_entry(int phase)
 {
        struct ahd_phase_table_entry *entry;
@@ -5351,7 +5453,7 @@ ahd_free(struct ahd_softc *ahd)
        return;
 }
 
-void
+static void
 ahd_shutdown(void *arg)
 {
        struct  ahd_softc *ahd;
@@ -5480,7 +5582,7 @@ ahd_reset(struct ahd_softc *ahd, int reinit)
 /*
  * Determine the number of SCBs available on the controller
  */
-int
+static int
 ahd_probe_scbs(struct ahd_softc *ahd) {
        int i;
 
@@ -5929,7 +6031,7 @@ ahd_free_scb(struct ahd_softc *ahd, struct scb *scb)
        ahd_platform_scb_free(ahd, scb);
 }
 
-void
+static void
 ahd_alloc_scbs(struct ahd_softc *ahd)
 {
        struct scb_data *scb_data;
@@ -6057,9 +6159,9 @@ ahd_alloc_scbs(struct ahd_softc *ahd)
 #endif
        }
 
-       newcount = MIN(scb_data->sense_left, scb_data->scbs_left);
-       newcount = MIN(newcount, scb_data->sgs_left);
-       newcount = MIN(newcount, (AHD_SCB_MAX_ALLOC - scb_data->numscbs));
+       newcount = min(scb_data->sense_left, scb_data->scbs_left);
+       newcount = min(newcount, scb_data->sgs_left);
+       newcount = min(newcount, (AHD_SCB_MAX_ALLOC - scb_data->numscbs));
        for (i = 0; i < newcount; i++) {
                struct scb_platform_data *pdata;
                u_int col_tag;
@@ -6982,7 +7084,7 @@ ahd_intr_enable(struct ahd_softc *ahd, int enable)
        ahd_outb(ahd, HCNTRL, hcntrl);
 }
 
-void
+static void
 ahd_update_coalescing_values(struct ahd_softc *ahd, u_int timer, u_int maxcmds,
                             u_int mincmds)
 {
@@ -7000,7 +7102,7 @@ ahd_update_coalescing_values(struct ahd_softc *ahd, u_int timer, u_int maxcmds,
        ahd_outb(ahd, INT_COALESCING_MINCMDS, -mincmds);
 }
 
-void
+static void
 ahd_enable_coalescing(struct ahd_softc *ahd, int enable)
 {
 
@@ -7070,6 +7172,7 @@ ahd_pause_and_flushwork(struct ahd_softc *ahd)
        ahd->flags &= ~AHD_ALL_INTERRUPTS;
 }
 
+#if 0
 int
 ahd_suspend(struct ahd_softc *ahd)
 {
@@ -7083,7 +7186,9 @@ ahd_suspend(struct ahd_softc *ahd)
        ahd_shutdown(ahd);
        return (0);
 }
+#endif  /*  0  */
 
+#if 0
 int
 ahd_resume(struct ahd_softc *ahd)
 {
@@ -7093,6 +7198,7 @@ ahd_resume(struct ahd_softc *ahd)
        ahd_restart(ahd);
        return (0);
 }
+#endif  /*  0  */
 
 /************************** Busy Target Table *********************************/
 /*
@@ -7125,7 +7231,7 @@ ahd_index_busy_tcl(struct ahd_softc *ahd, u_int *saved_scbid, u_int tcl)
 /*
  * Return the untagged transaction id for a given target/channel lun.
  */
-u_int
+static u_int
 ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl)
 {
        u_int scbid;
@@ -7138,7 +7244,7 @@ ahd_find_busy_tcl(struct ahd_softc *ahd, u_int tcl)
        return (scbid);
 }
 
-void
+static void
 ahd_busy_tcl(struct ahd_softc *ahd, u_int tcl, u_int scbid)
 {
        u_int scb_offset;
@@ -7186,7 +7292,7 @@ ahd_match_scb(struct ahd_softc *ahd, struct scb *scb, int target,
        return match;
 }
 
-void
+static void
 ahd_freeze_devq(struct ahd_softc *ahd, struct scb *scb)
 {
        int     target;
@@ -7690,7 +7796,7 @@ ahd_add_scb_to_free_list(struct ahd_softc *ahd, u_int scbid)
  * been modified from CAM_REQ_INPROG.  This routine assumes that the sequencer
  * is paused before it is called.
  */
-int
+static int
 ahd_abort_scbs(struct ahd_softc *ahd, int target, char channel,
               int lun, u_int tag, role_t role, uint32_t status)
 {
@@ -7919,6 +8025,11 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset)
        ahd_clear_fifo(ahd, 0);
        ahd_clear_fifo(ahd, 1);
 
+       /*
+        * Clear SCSI interrupt status
+        */
+       ahd_outb(ahd, CLRSINT1, CLRSCSIRSTI);
+
        /*
         * Reenable selections
         */
@@ -7952,10 +8063,6 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset)
                }
        }
 #endif
-       /* Notify the XPT that a bus reset occurred */
-       ahd_send_async(ahd, devinfo.channel, CAM_TARGET_WILDCARD,
-                      CAM_LUN_WILDCARD, AC_BUS_RESET);
-
        /*
         * Revert to async/narrow transfers until we renegotiate.
         */
@@ -7977,6 +8084,10 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset)
                }
        }
 
+       /* Notify the XPT that a bus reset occurred */
+       ahd_send_async(ahd, devinfo.channel, CAM_TARGET_WILDCARD,
+                      CAM_LUN_WILDCARD, AC_BUS_RESET);
+
        ahd_restart(ahd);
 
        return (found);
@@ -8019,18 +8130,8 @@ ahd_stat_timer(void *arg)
 }
 
 /****************************** Status Processing *****************************/
-void
-ahd_handle_scb_status(struct ahd_softc *ahd, struct scb *scb)
-{
-       if (scb->hscb->shared_data.istatus.scsi_status != 0) {
-               ahd_handle_scsi_status(ahd, scb);
-       } else {
-               ahd_calc_residual(ahd, scb);
-               ahd_done(ahd, scb);
-       }
-}
 
-void
+static void
 ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb)
 {
        struct  hardware_scb *hscb;
@@ -8238,10 +8339,21 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb)
        }
 }
 
+static void
+ahd_handle_scb_status(struct ahd_softc *ahd, struct scb *scb)
+{
+       if (scb->hscb->shared_data.istatus.scsi_status != 0) {
+               ahd_handle_scsi_status(ahd, scb);
+       } else {
+               ahd_calc_residual(ahd, scb);
+               ahd_done(ahd, scb);
+       }
+}
+
 /*
  * Calculate the residual for a just completed SCB.
  */
-void
+static void
 ahd_calc_residual(struct ahd_softc *ahd, struct scb *scb)
 {
        struct hardware_scb *hscb;
@@ -8668,7 +8780,7 @@ ahd_resolve_seqaddr(struct ahd_softc *ahd, u_int address)
                if (skip_addr > i) {
                        int end_addr;
 
-                       end_addr = MIN(address, skip_addr);
+                       end_addr = min(address, skip_addr);
                        address_offset += end_addr - i;
                        i = skip_addr;
                } else {
@@ -9092,6 +9204,7 @@ ahd_dump_card_state(struct ahd_softc *ahd)
                ahd_unpause(ahd);
 }
 
+#if 0
 void
 ahd_dump_scbs(struct ahd_softc *ahd)
 {
@@ -9117,6 +9230,7 @@ ahd_dump_scbs(struct ahd_softc *ahd)
        ahd_set_scbptr(ahd, saved_scb_index);
        ahd_restore_modes(ahd, saved_modes);
 }
+#endif  /*  0  */
 
 /**************************** Flexport Logic **********************************/
 /*
@@ -9219,7 +9333,7 @@ ahd_write_seeprom(struct ahd_softc *ahd, uint16_t *buf,
 /*
  * Wait ~100us for the serial eeprom to satisfy our request.
  */
-int
+static int
 ahd_wait_seeprom(struct ahd_softc *ahd)
 {
        int cnt;
@@ -9237,7 +9351,7 @@ ahd_wait_seeprom(struct ahd_softc *ahd)
  * Validate the two checksums in the per_channel
  * vital product data struct.
  */
-int
+static int
 ahd_verify_vpd_cksum(struct vpd_config *vpd)
 {
        int i;
@@ -9316,6 +9430,24 @@ ahd_release_seeprom(struct ahd_softc *ahd)
        /* Currently a no-op */
 }
 
+/*
+ * Wait at most 2 seconds for flexport arbitration to succeed.
+ */
+static int
+ahd_wait_flexport(struct ahd_softc *ahd)
+{
+       int cnt;
+
+       AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
+       cnt = 1000000 * 2 / 5;
+       while ((ahd_inb(ahd, BRDCTL) & FLXARBACK) == 0 && --cnt)
+               ahd_delay(5);
+
+       if (cnt == 0)
+               return (ETIMEDOUT);
+       return (0);
+}
+
 int
 ahd_write_flexport(struct ahd_softc *ahd, u_int addr, u_int value)
 {
@@ -9357,24 +9489,6 @@ ahd_read_flexport(struct ahd_softc *ahd, u_int addr, uint8_t *value)
        return (0);
 }
 
-/*
- * Wait at most 2 seconds for flexport arbitration to succeed.
- */
-int
-ahd_wait_flexport(struct ahd_softc *ahd)
-{
-       int cnt;
-
-       AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK);
-       cnt = 1000000 * 2 / 5;
-       while ((ahd_inb(ahd, BRDCTL) & FLXARBACK) == 0 && --cnt)
-               ahd_delay(5);
-
-       if (cnt == 0)
-               return (ETIMEDOUT);
-       return (0);
-}
-
 /************************* Target Mode ****************************************/
 #ifdef AHD_TARGET_MODE
 cam_status
index a3266e066c00ca707a856f6035aca10198779433..2ceb67f4af2a6ab1cfb7dac81fe3e86b4a2d5c2d 100644 (file)
@@ -418,10 +418,6 @@ ahd_targetcmd_offset(struct ahd_softc *ahd, u_int index)
 }
 
 /*********************** Miscelaneous Support Functions ***********************/
-static __inline void   ahd_complete_scb(struct ahd_softc *ahd,
-                                        struct scb *scb);
-static __inline void   ahd_update_residual(struct ahd_softc *ahd,
-                                           struct scb *scb);
 static __inline struct ahd_initiator_tinfo *
                        ahd_fetch_transinfo(struct ahd_softc *ahd,
                                            char channel, u_int our_id,
@@ -467,32 +463,6 @@ static __inline uint32_t
                        ahd_get_sense_bufaddr(struct ahd_softc *ahd,
                                              struct scb *scb);
 
-static __inline void
-ahd_complete_scb(struct ahd_softc *ahd, struct scb *scb)
-{
-       uint32_t sgptr;
-
-       sgptr = ahd_le32toh(scb->hscb->sgptr);
-       if ((sgptr & SG_STATUS_VALID) != 0)
-               ahd_handle_scb_status(ahd, scb);
-       else
-               ahd_done(ahd, scb);
-}
-
-/*
- * Determine whether the sequencer reported a residual
- * for this SCB/transaction.
- */
-static __inline void
-ahd_update_residual(struct ahd_softc *ahd, struct scb *scb)
-{
-       uint32_t sgptr;
-
-       sgptr = ahd_le32toh(scb->hscb->sgptr);
-       if ((sgptr & SG_STATUS_VALID) != 0)
-               ahd_calc_residual(ahd, scb);
-}
-
 /*
  * Return pointers to the transfer negotiation information
  * for the specified our_id/remote_id pair.
index f8e60486167da6c110111ac919543cde54e19820..9bfcca5ede088c0c78a8645525376e3b1cf0eb45 100644 (file)
@@ -293,7 +293,7 @@ static uint32_t aic79xx_seltime;
  * force all outstanding transactions to be serviced prior to a new
  * transaction.
  */
-uint32_t aic79xx_periodic_otag;
+static uint32_t aic79xx_periodic_otag;
 
 /* Some storage boxes are using an LSI chip which has a bug making it
  * impossible to use aic79xx Rev B chip in 320 speeds.  The following
@@ -773,6 +773,7 @@ struct scsi_host_template aic79xx_driver_template = {
 #endif
        .can_queue              = AHD_MAX_QUEUE,
        .this_id                = -1,
+       .max_sectors            = 8192,
        .cmd_per_lun            = 2,
        .use_clustering         = ENABLE_CLUSTERING,
        .slave_alloc            = ahd_linux_slave_alloc,
@@ -1813,9 +1814,9 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
                        u_int sense_offset;
 
                        if (scb->flags & SCB_SENSE) {
-                               sense_size = MIN(sizeof(struct scsi_sense_data)
+                               sense_size = min(sizeof(struct scsi_sense_data)
                                               - ahd_get_sense_residual(scb),
-                                                sizeof(cmd->sense_buffer));
+                                                (u_long)sizeof(cmd->sense_buffer));
                                sense_offset = 0;
                        } else {
                                /*
@@ -1824,7 +1825,8 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
                                 */
                                siu = (struct scsi_status_iu_header *)
                                    scb->sense_data;
-                               sense_size = MIN(scsi_4btoul(siu->sense_length),
+                               sense_size = min_t(size_t,
+                                               scsi_4btoul(siu->sense_length),
                                                sizeof(cmd->sense_buffer));
                                sense_offset = SIU_SENSE_OFFSET(siu);
                        }
@@ -2634,8 +2636,22 @@ static void ahd_linux_set_pcomp_en(struct scsi_target *starget, int pcomp)
                       pcomp ? "Enable" : "Disable");
 #endif
 
-       if (pcomp)
+       if (pcomp) {
+               uint8_t precomp;
+
+               if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) {
+                       struct ahd_linux_iocell_opts *iocell_opts;
+
+                       iocell_opts = &aic79xx_iocell_info[ahd->unit];
+                       precomp = iocell_opts->precomp;
+               } else {
+                       precomp = AIC79XX_DEFAULT_PRECOMP;
+               }
                ppr_options |= MSG_EXT_PPR_PCOMP_EN;
+               AHD_SET_PRECOMP(ahd, precomp);
+       } else {
+               AHD_SET_PRECOMP(ahd, 0);
+       }
 
        ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
                            starget->channel + 'A', ROLE_INITIATOR);
@@ -2678,7 +2694,25 @@ static void ahd_linux_set_hold_mcs(struct scsi_target *starget, int hold)
        ahd_unlock(ahd, &flags);
 }
 
+static void ahd_linux_get_signalling(struct Scsi_Host *shost)
+{
+       struct ahd_softc *ahd = *(struct ahd_softc **)shost->hostdata;
+       unsigned long flags;
+       u8 mode;
+
+       ahd_lock(ahd, &flags);
+       ahd_pause(ahd);
+       mode = ahd_inb(ahd, SBLKCTL);
+       ahd_unpause(ahd);
+       ahd_unlock(ahd, &flags);
 
+       if (mode & ENAB40)
+               spi_signalling(shost) = SPI_SIGNAL_LVD;
+       else if (mode & ENAB20)
+               spi_signalling(shost) = SPI_SIGNAL_SE;
+       else
+               spi_signalling(shost) = SPI_SIGNAL_UNKNOWN;
+}
 
 static struct spi_function_template ahd_linux_transport_functions = {
        .set_offset     = ahd_linux_set_offset,
@@ -2703,6 +2737,7 @@ static struct spi_function_template ahd_linux_transport_functions = {
        .show_pcomp_en  = 1,
        .set_hold_mcs   = ahd_linux_set_hold_mcs,
        .show_hold_mcs  = 1,
+       .get_signalling = ahd_linux_get_signalling,
 };
 
 static int __init
index fb3d4dd54413a3c09a9dc6fc68c89271db500a52..3a67fc578d78051f6f43b4643e26e54eb4b356b2 100644 (file)
@@ -506,9 +506,6 @@ struct info_str {
        int pos;
 };
 
-void   ahd_format_transinfo(struct info_str *info,
-                            struct ahd_transinfo *tinfo);
-
 /******************************** Locking *************************************/
 static __inline void
 ahd_lockinit(struct ahd_softc *ahd)
@@ -582,8 +579,6 @@ ahd_unlock(struct ahd_softc *ahd, unsigned long *flags)
 #define PCIXM_STATUS_MAXCRDS   0x1C00  /* Maximum Cumulative Read Size */
 #define PCIXM_STATUS_RCVDSCEM  0x2000  /* Received a Split Comp w/Error msg */
 
-extern struct pci_driver aic79xx_pci_driver;
-
 typedef enum
 {
        AHD_POWER_STATE_D0,
index 4b53542018073c3dd1bd17f003648cbbc451d9e5..2001fe890e71651ed36eb5cdc701fcf28ee74e02 100644 (file)
@@ -82,7 +82,7 @@ static struct pci_device_id ahd_linux_pci_id_table[] = {
 
 MODULE_DEVICE_TABLE(pci, ahd_linux_pci_id_table);
 
-struct pci_driver aic79xx_pci_driver = {
+static struct pci_driver aic79xx_pci_driver = {
        .name           = "aic79xx",
        .probe          = ahd_linux_pci_dev_probe,
        .remove         = ahd_linux_pci_dev_remove,
index 14850f31aafa53cdafd3817936a7d6b22906613a..c07735819cd1d1aba2f3cabe9085d9d4e0dc6414 100644 (file)
@@ -97,7 +97,7 @@ static ahd_device_setup_t ahd_aic7901A_setup;
 static ahd_device_setup_t ahd_aic7902_setup;
 static ahd_device_setup_t ahd_aic790X_setup;
 
-struct ahd_pci_identity ahd_pci_ident_table [] =
+static struct ahd_pci_identity ahd_pci_ident_table [] =
 {
        /* aic7901 based controllers */
        {
@@ -201,7 +201,7 @@ struct ahd_pci_identity ahd_pci_ident_table [] =
        }
 };
 
-const u_int ahd_num_pci_devs = ARRAY_SIZE(ahd_pci_ident_table);
+static const u_int ahd_num_pci_devs = ARRAY_SIZE(ahd_pci_ident_table);
                
 #define        DEVCONFIG               0x40
 #define                PCIXINITPAT     0x0000E000ul
@@ -245,6 +245,7 @@ static int  ahd_check_extport(struct ahd_softc *ahd);
 static void    ahd_configure_termination(struct ahd_softc *ahd,
                                          u_int adapter_control);
 static void    ahd_pci_split_intr(struct ahd_softc *ahd, u_int intstat);
+static void    ahd_pci_intr(struct ahd_softc *ahd);
 
 struct ahd_pci_identity *
 ahd_find_pci_device(ahd_dev_softc_t pci)
@@ -757,7 +758,7 @@ static const char *pci_status_strings[] =
        "%s: Address or Write Phase Parity Error Detected in %s.\n"
 };
 
-void
+static void
 ahd_pci_intr(struct ahd_softc *ahd)
 {
        uint8_t         pci_status[8];
index c5f0ee59150963a0f7a564cd9b3ec51f9a345d75..6b28bebcbca0fffb4021fd517e5cf93254be6d07 100644 (file)
@@ -136,7 +136,7 @@ copy_info(struct info_str *info, char *fmt, ...)
        return (len);
 }
 
-void
+static void
 ahd_format_transinfo(struct info_str *info, struct ahd_transinfo *tinfo)
 {
        u_int speed;
index 62ff8c3dc2bb44479b1dcf3c1fe8f100df9e0b2f..954c7c24501d3e85a1ee70121755b86b61999588 100644 (file)
@@ -54,14 +54,6 @@ struct scb_platform_data;
 struct seeprom_descriptor;
 
 /****************************** Useful Macros *********************************/
-#ifndef MAX
-#define MAX(a,b) (((a) > (b)) ? (a) : (b))
-#endif
-
-#ifndef MIN
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
 #ifndef TRUE
 #define TRUE 1
 #endif
@@ -1135,8 +1127,6 @@ struct ahc_pci_identity {
        char                    *name;
        ahc_device_setup_t      *setup;
 };
-extern struct ahc_pci_identity ahc_pci_ident_table[];
-extern const u_int ahc_num_pci_devs;
 
 /***************************** VL/EISA Declarations ***************************/
 struct aic7770_identity {
@@ -1289,6 +1279,7 @@ typedef enum {
 } ahc_queue_alg;
 
 void                   ahc_set_tags(struct ahc_softc *ahc,
+                                    struct scsi_cmnd *cmd,
                                     struct ahc_devinfo *devinfo,
                                     ahc_queue_alg alg);
 
index 93e4e40944b6d42b1a36398500e1c03dfe529719..50ef785224defd6e79f2d938f7ee5961a6cbbaaa 100644 (file)
@@ -1671,7 +1671,7 @@ ahc_devlimited_syncrate(struct ahc_softc *ahc,
                transinfo = &tinfo->goal;
        *ppr_options &= transinfo->ppr_options;
        if (transinfo->width == MSG_EXT_WDTR_BUS_8_BIT) {
-               maxsync = MAX(maxsync, AHC_SYNCRATE_ULTRA2);
+               maxsync = max(maxsync, (u_int)AHC_SYNCRATE_ULTRA2);
                *ppr_options &= ~MSG_EXT_PPR_DT_REQ;
        }
        if (transinfo->period == 0) {
@@ -1679,7 +1679,7 @@ ahc_devlimited_syncrate(struct ahc_softc *ahc,
                *ppr_options = 0;
                return (NULL);
        }
-       *period = MAX(*period, transinfo->period);
+       *period = max(*period, (u_int)transinfo->period);
        return (ahc_find_syncrate(ahc, period, ppr_options, maxsync));
 }
 
@@ -1804,12 +1804,12 @@ ahc_validate_offset(struct ahc_softc *ahc,
                else
                        maxoffset = MAX_OFFSET_8BIT;
        }
-       *offset = MIN(*offset, maxoffset);
+       *offset = min(*offset, maxoffset);
        if (tinfo != NULL) {
                if (role == ROLE_TARGET)
-                       *offset = MIN(*offset, tinfo->user.offset);
+                       *offset = min(*offset, (u_int)tinfo->user.offset);
                else
-                       *offset = MIN(*offset, tinfo->goal.offset);
+                       *offset = min(*offset, (u_int)tinfo->goal.offset);
        }
 }
 
@@ -1835,9 +1835,9 @@ ahc_validate_width(struct ahc_softc *ahc, struct ahc_initiator_tinfo *tinfo,
        }
        if (tinfo != NULL) {
                if (role == ROLE_TARGET)
-                       *bus_width = MIN(tinfo->user.width, *bus_width);
+                       *bus_width = min((u_int)tinfo->user.width, *bus_width);
                else
-                       *bus_width = MIN(tinfo->goal.width, *bus_width);
+                       *bus_width = min((u_int)tinfo->goal.width, *bus_width);
        }
 }
 
@@ -1986,7 +1986,7 @@ ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
                tinfo->curr.ppr_options = ppr_options;
 
                ahc_send_async(ahc, devinfo->channel, devinfo->target,
-                              CAM_LUN_WILDCARD, AC_TRANSFER_NEG, NULL);
+                              CAM_LUN_WILDCARD, AC_TRANSFER_NEG);
                if (bootverbose) {
                        if (offset != 0) {
                                printf("%s: target %d synchronous at %sMHz%s, "
@@ -2056,7 +2056,7 @@ ahc_set_width(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
                tinfo->curr.width = width;
 
                ahc_send_async(ahc, devinfo->channel, devinfo->target,
-                              CAM_LUN_WILDCARD, AC_TRANSFER_NEG, NULL);
+                              CAM_LUN_WILDCARD, AC_TRANSFER_NEG);
                if (bootverbose) {
                        printf("%s: target %d using %dbit transfers\n",
                               ahc_name(ahc), devinfo->target,
@@ -2074,12 +2074,14 @@ ahc_set_width(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
  * Update the current state of tagged queuing for a given target.
  */
 void
-ahc_set_tags(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
-            ahc_queue_alg alg)
+ahc_set_tags(struct ahc_softc *ahc, struct scsi_cmnd *cmd,
+            struct ahc_devinfo *devinfo, ahc_queue_alg alg)
 {
-       ahc_platform_set_tags(ahc, devinfo, alg);
+       struct scsi_device *sdev = cmd->device;
+
+       ahc_platform_set_tags(ahc, sdev, devinfo, alg);
        ahc_send_async(ahc, devinfo->channel, devinfo->target,
-                      devinfo->lun, AC_TRANSFER_NEG, &alg);
+                      devinfo->lun, AC_TRANSFER_NEG);
 }
 
 /*
@@ -3489,7 +3491,7 @@ ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
                        printf("(%s:%c:%d:%d): refuses tagged commands.  "
                               "Performing non-tagged I/O\n", ahc_name(ahc),
                               devinfo->channel, devinfo->target, devinfo->lun);
-                       ahc_set_tags(ahc, devinfo, AHC_QUEUE_NONE);
+                       ahc_set_tags(ahc, scb->io_ctx, devinfo, AHC_QUEUE_NONE);
                        mask = ~0x23;
                } else {
                        printf("(%s:%c:%d:%d): refuses %s tagged commands.  "
@@ -3497,7 +3499,7 @@ ahc_handle_msg_reject(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
                               ahc_name(ahc), devinfo->channel, devinfo->target,
                               devinfo->lun, tag_type == MSG_ORDERED_TASK
                               ? "ordered" : "head of queue");
-                       ahc_set_tags(ahc, devinfo, AHC_QUEUE_BASIC);
+                       ahc_set_tags(ahc, scb->io_ctx, devinfo, AHC_QUEUE_BASIC);
                        mask = ~0x03;
                }
 
@@ -3763,7 +3765,7 @@ ahc_handle_devreset(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
        
        if (status != CAM_SEL_TIMEOUT)
                ahc_send_async(ahc, devinfo->channel, devinfo->target,
-                              CAM_LUN_WILDCARD, AC_SENT_BDR, NULL);
+                              CAM_LUN_WILDCARD, AC_SENT_BDR);
 
        if (message != NULL
         && (verbose_level <= bootverbose))
@@ -4406,7 +4408,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc)
        physaddr = sg_map->sg_physaddr;
 
        newcount = (PAGE_SIZE / (AHC_NSEG * sizeof(struct ahc_dma_seg)));
-       newcount = MIN(newcount, (AHC_SCB_MAX_ALLOC - scb_data->numscbs));
+       newcount = min(newcount, (AHC_SCB_MAX_ALLOC - scb_data->numscbs));
        for (i = 0; i < newcount; i++) {
                struct scb_platform_data *pdata;
 #ifndef __linux__
@@ -6018,7 +6020,7 @@ ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset)
 #endif
        /* Notify the XPT that a bus reset occurred */
        ahc_send_async(ahc, devinfo.channel, CAM_TARGET_WILDCARD,
-                      CAM_LUN_WILDCARD, AC_BUS_RESET, NULL);
+                      CAM_LUN_WILDCARD, AC_BUS_RESET);
 
        /*
         * Revert to async/narrow transfers until we renegotiate.
@@ -6442,7 +6444,7 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, uint8_t *dconsts)
                        if (skip_addr > i) {
                                int end_addr;
 
-                               end_addr = MIN(address, skip_addr);
+                               end_addr = min(address, skip_addr);
                                address_offset += end_addr - i;
                                i = skip_addr;
                        } else {
index 43ab753d2739a3d28353f4387ca6916213fcaeb6..660f26e23a38387e4c34120c118ddb709dca9ea4 100644 (file)
@@ -328,7 +328,7 @@ static uint32_t aic7xxx_seltime;
  * force all outstanding transactions to be serviced prior to a new
  * transaction.
  */
-uint32_t aic7xxx_periodic_otag;
+static uint32_t aic7xxx_periodic_otag;
 
 /*
  * Module information and settable options.
@@ -512,7 +512,6 @@ ahc_linux_target_alloc(struct scsi_target *starget)
        struct seeprom_config *sc = ahc->seep_config;
        unsigned long flags;
        struct scsi_target **ahc_targp = ahc_linux_target_in_softc(starget);
-       struct ahc_linux_target *targ = scsi_transport_target_data(starget);
        unsigned short scsirate;
        struct ahc_devinfo devinfo;
        struct ahc_initiator_tinfo *tinfo;
@@ -533,7 +532,6 @@ ahc_linux_target_alloc(struct scsi_target *starget)
        BUG_ON(*ahc_targp != NULL);
 
        *ahc_targp = starget;
-       memset(targ, 0, sizeof(*targ));
 
        if (sc) {
                int maxsync = AHC_SYNCRATE_DT;
@@ -594,14 +592,11 @@ ahc_linux_slave_alloc(struct scsi_device *sdev)
        struct  ahc_softc *ahc =
                *((struct ahc_softc **)sdev->host->hostdata);
        struct scsi_target *starget = sdev->sdev_target;
-       struct ahc_linux_target *targ = scsi_transport_target_data(starget);
        struct ahc_linux_device *dev;
 
        if (bootverbose)
                printf("%s: Slave Alloc %d\n", ahc_name(ahc), sdev->id);
 
-       BUG_ON(targ->sdev[sdev->lun] != NULL);
-
        dev = scsi_transport_device_data(sdev);
        memset(dev, 0, sizeof(*dev));
 
@@ -618,8 +613,6 @@ ahc_linux_slave_alloc(struct scsi_device *sdev)
         */
        dev->maxtags = 0;
        
-       targ->sdev[sdev->lun] = sdev;
-
        spi_period(starget) = 0;
 
        return 0;
@@ -644,22 +637,6 @@ ahc_linux_slave_configure(struct scsi_device *sdev)
        return 0;
 }
 
-static void
-ahc_linux_slave_destroy(struct scsi_device *sdev)
-{
-       struct  ahc_softc *ahc;
-       struct  ahc_linux_device *dev = scsi_transport_device_data(sdev);
-       struct  ahc_linux_target *targ = scsi_transport_target_data(sdev->sdev_target);
-
-       ahc = *((struct ahc_softc **)sdev->host->hostdata);
-       if (bootverbose)
-               printf("%s: Slave Destroy %d\n", ahc_name(ahc), sdev->id);
-
-       BUG_ON(dev->active);
-
-       targ->sdev[sdev->lun] = NULL;
-}
-
 #if defined(__i386__)
 /*
  * Return the disk geometry for the given SCSI device.
@@ -777,11 +754,11 @@ struct scsi_host_template aic7xxx_driver_template = {
 #endif
        .can_queue              = AHC_MAX_QUEUE,
        .this_id                = -1,
+       .max_sectors            = 8192,
        .cmd_per_lun            = 2,
        .use_clustering         = ENABLE_CLUSTERING,
        .slave_alloc            = ahc_linux_slave_alloc,
        .slave_configure        = ahc_linux_slave_configure,
-       .slave_destroy          = ahc_linux_slave_destroy,
        .target_alloc           = ahc_linux_target_alloc,
        .target_destroy         = ahc_linux_target_destroy,
 };
@@ -1203,21 +1180,13 @@ void
 ahc_platform_free(struct ahc_softc *ahc)
 {
        struct scsi_target *starget;
-       int i, j;
+       int i;
 
        if (ahc->platform_data != NULL) {
                /* destroy all of the device and target objects */
                for (i = 0; i < AHC_NUM_TARGETS; i++) {
                        starget = ahc->platform_data->starget[i];
                        if (starget != NULL) {
-                               for (j = 0; j < AHC_NUM_LUNS; j++) {
-                                       struct ahc_linux_target *targ =
-                                               scsi_transport_target_data(starget);
-
-                                       if (targ->sdev[j] == NULL)
-                                               continue;
-                                       targ->sdev[j] = NULL;
-                               }
                                ahc->platform_data->starget[i] = NULL;
                        }
                }
@@ -1251,24 +1220,13 @@ ahc_platform_freeze_devq(struct ahc_softc *ahc, struct scb *scb)
 }
 
 void
-ahc_platform_set_tags(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
-                     ahc_queue_alg alg)
+ahc_platform_set_tags(struct ahc_softc *ahc, struct scsi_device *sdev,
+                     struct ahc_devinfo *devinfo, ahc_queue_alg alg)
 {
-       struct scsi_target *starget;
-       struct ahc_linux_target *targ;
        struct ahc_linux_device *dev;
-       struct scsi_device *sdev;
-       u_int target_offset;
        int was_queuing;
        int now_queuing;
 
-       target_offset = devinfo->target;
-       if (devinfo->channel != 'A')
-               target_offset += 8;
-       starget = ahc->platform_data->starget[target_offset];
-       targ = scsi_transport_target_data(starget);
-       BUG_ON(targ == NULL);
-       sdev = targ->sdev[devinfo->lun];
        if (sdev == NULL)
                return;
        dev = scsi_transport_device_data(sdev);
@@ -1401,11 +1359,15 @@ ahc_linux_device_queue_depth(struct scsi_device *sdev)
        tags = ahc_linux_user_tagdepth(ahc, &devinfo);
        if (tags != 0 && sdev->tagged_supported != 0) {
 
-               ahc_set_tags(ahc, &devinfo, AHC_QUEUE_TAGGED);
+               ahc_platform_set_tags(ahc, sdev, &devinfo, AHC_QUEUE_TAGGED);
+               ahc_send_async(ahc, devinfo.channel, devinfo.target,
+                              devinfo.lun, AC_TRANSFER_NEG);
                ahc_print_devinfo(ahc, &devinfo);
                printf("Tagged Queuing enabled.  Depth %d\n", tags);
        } else {
-               ahc_set_tags(ahc, &devinfo, AHC_QUEUE_NONE);
+               ahc_platform_set_tags(ahc, sdev, &devinfo, AHC_QUEUE_NONE);
+               ahc_send_async(ahc, devinfo.channel, devinfo.target,
+                              devinfo.lun, AC_TRANSFER_NEG);
        }
 }
 
@@ -1629,7 +1591,7 @@ ahc_platform_flushwork(struct ahc_softc *ahc)
 
 void
 ahc_send_async(struct ahc_softc *ahc, char channel,
-              u_int target, u_int lun, ac_code code, void *arg)
+              u_int target, u_int lun, ac_code code)
 {
        switch (code) {
        case AC_TRANSFER_NEG:
@@ -1875,9 +1837,9 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
                if (scb->flags & SCB_SENSE) {
                        u_int sense_size;
 
-                       sense_size = MIN(sizeof(struct scsi_sense_data)
+                       sense_size = min(sizeof(struct scsi_sense_data)
                                       - ahc_get_sense_residual(scb),
-                                        sizeof(cmd->sense_buffer));
+                                        (u_long)sizeof(cmd->sense_buffer));
                        memcpy(cmd->sense_buffer,
                               ahc_get_sense_buf(ahc, scb), sense_size);
                        if (sense_size < sizeof(cmd->sense_buffer))
@@ -1946,7 +1908,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
                        }
                        ahc_set_transaction_status(scb, CAM_REQUEUE_REQ);
                        ahc_set_scsi_status(scb, SCSI_STATUS_OK);
-                       ahc_platform_set_tags(ahc, &devinfo,
+                       ahc_platform_set_tags(ahc, sdev, &devinfo,
                                     (dev->flags & AHC_DEV_Q_BASIC)
                                   ? AHC_QUEUE_BASIC : AHC_QUEUE_TAGGED);
                        break;
@@ -1957,7 +1919,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
                 */
                dev->openings = 1;
                ahc_set_scsi_status(scb, SCSI_STATUS_BUSY);
-               ahc_platform_set_tags(ahc, &devinfo,
+               ahc_platform_set_tags(ahc, sdev, &devinfo,
                             (dev->flags & AHC_DEV_Q_BASIC)
                           ? AHC_QUEUE_BASIC : AHC_QUEUE_TAGGED);
                break;
@@ -2599,8 +2561,6 @@ ahc_linux_init(void)
        if (!ahc_linux_transport_template)
                return -ENODEV;
 
-       scsi_transport_reserve_target(ahc_linux_transport_template,
-                                     sizeof(struct ahc_linux_target));
        scsi_transport_reserve_device(ahc_linux_transport_template,
                                      sizeof(struct ahc_linux_device));
 
index a87a4ce090df18c16ce56979299ecc51ebedd820..85ae5d836fa4f0e715fd2794c7ed923edf1c2e01 100644 (file)
@@ -256,7 +256,6 @@ typedef enum {
        AHC_DEV_PERIODIC_OTAG    = 0x40, /* Send OTAG to prevent starvation */
 } ahc_linux_dev_flags;
 
-struct ahc_linux_target;
 struct ahc_linux_device {
        /*
         * The number of transactions currently
@@ -329,12 +328,6 @@ struct ahc_linux_device {
 #define AHC_OTAG_THRESH        500
 };
 
-struct ahc_linux_target {
-       struct scsi_device       *sdev[AHC_NUM_LUNS];
-       struct ahc_transinfo      last_tinfo;
-       struct ahc_softc         *ahc;
-};
-
 /********************* Definitions Required by the Core ***********************/
 /*
  * Number of SG segments we require.  So long as the S/G segments for
@@ -533,8 +526,6 @@ ahc_unlock(struct ahc_softc *ahc, unsigned long *flags)
 #define PCIR_SUBVEND_0 0x2c
 #define PCIR_SUBDEV_0  0x2e
 
-extern struct pci_driver aic7xxx_pci_driver;
-
 typedef enum
 {
        AHC_POWER_STATE_D0,
@@ -824,7 +815,7 @@ ahc_freeze_scb(struct scb *scb)
         }
 }
 
-void   ahc_platform_set_tags(struct ahc_softc *ahc,
+void   ahc_platform_set_tags(struct ahc_softc *ahc, struct scsi_device *sdev,
                              struct ahc_devinfo *devinfo, ahc_queue_alg);
 int    ahc_platform_abort_scbs(struct ahc_softc *ahc, int target,
                                char channel, int lun, u_int tag,
@@ -834,7 +825,7 @@ irqreturn_t
 void   ahc_platform_flushwork(struct ahc_softc *ahc);
 void   ahc_done(struct ahc_softc*, struct scb*);
 void   ahc_send_async(struct ahc_softc *, char channel,
-                      u_int target, u_int lun, ac_code, void *);
+                      u_int target, u_int lun, ac_code);
 void   ahc_print_path(struct ahc_softc *, struct scb *);
 void   ahc_platform_dump_card_state(struct ahc_softc *ahc);
 
index d20ca514e9f36f11ba120dbe132338fa9c7f8ce6..ea5687df732dac83f9de009c33da14b461c621db 100644 (file)
@@ -130,7 +130,7 @@ static struct pci_device_id ahc_linux_pci_id_table[] = {
 
 MODULE_DEVICE_TABLE(pci, ahc_linux_pci_id_table);
 
-struct pci_driver aic7xxx_pci_driver = {
+static struct pci_driver aic7xxx_pci_driver = {
        .name           = "aic7xxx",
        .probe          = ahc_linux_pci_dev_probe,
        .remove         = ahc_linux_pci_dev_remove,
index 63cab2d74552043094ef7713dea2311252fe7922..09c8172c9e5ec82e3b049d11702fcddbfd613fae 100644 (file)
@@ -168,7 +168,7 @@ static ahc_device_setup_t ahc_aha394XX_setup;
 static ahc_device_setup_t ahc_aha494XX_setup;
 static ahc_device_setup_t ahc_aha398XX_setup;
 
-struct ahc_pci_identity ahc_pci_ident_table [] =
+static struct ahc_pci_identity ahc_pci_ident_table [] =
 {
        /* aic7850 based controllers */
        {
@@ -559,7 +559,7 @@ struct ahc_pci_identity ahc_pci_ident_table [] =
        }
 };
 
-const u_int ahc_num_pci_devs = ARRAY_SIZE(ahc_pci_ident_table);
+static const u_int ahc_num_pci_devs = ARRAY_SIZE(ahc_pci_ident_table);
                
 #define AHC_394X_SLOT_CHANNEL_A        4
 #define AHC_394X_SLOT_CHANNEL_B        5
index 5914b4aa4a8f6295d7eec68da7a26bcf76a2d62b..99e5443e75352cecf9383c247b5d8107dfd109fe 100644 (file)
@@ -182,7 +182,6 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
                      u_int our_id, char channel, u_int target_id,
                      u_int target_offset)
 {
-       struct  ahc_linux_target *targ;
        struct  scsi_target *starget;
        struct  ahc_initiator_tinfo *tinfo;
        struct  ahc_tmode_tstate *tstate;
@@ -198,7 +197,6 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
        starget = ahc->platform_data->starget[target_offset];
        if (!starget)
                return;
-       targ = scsi_transport_target_data(starget);
 
        copy_info(info, "\tGoal: ");
        ahc_format_transinfo(info, &tinfo->goal);
@@ -208,7 +206,7 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
        for (lun = 0; lun < AHC_NUM_LUNS; lun++) {
                struct scsi_device *sdev;
 
-               sdev = targ->sdev[lun];
+               sdev = scsi_device_lookup_by_target(starget, lun);
 
                if (sdev == NULL)
                        continue;
@@ -383,11 +381,11 @@ ahc_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
        }
        copy_info(&info, "\n");
 
-       max_targ = 15;
+       max_targ = 16;
        if ((ahc->features & (AHC_WIDE|AHC_TWIN)) == 0)
-               max_targ = 7;
+               max_targ = 8;
 
-       for (i = 0; i <= max_targ; i++) {
+       for (i = 0; i < max_targ; i++) {
                u_int our_id;
                u_int target_id;
                char channel;
index bcd7fffab9074fbb2ab5fab1768bd5ec686657a5..46eed10b25d95db126f5bbe38be66c52d8791407 100644 (file)
@@ -2646,7 +2646,7 @@ static void aic7xxx_done_cmds_complete(struct aic7xxx_host *p)
 
        while (p->completeq.head != NULL) {
                cmd = p->completeq.head;
-               p->completeq.head = (struct scsi_Cmnd *) cmd->host_scribble;
+               p->completeq.head = (struct scsi_cmnd *) cmd->host_scribble;
                cmd->host_scribble = NULL;
                cmd->scsi_done(cmd);
        }
index 14319d1d680449dc1a3797492a7dbfea882bdd8e..7b6aca02cf701f916b44a25c3c621e2db9f115cb 100644 (file)
@@ -46,6 +46,7 @@
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR10 0x410
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR12 0x412
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR1E 0x41E
+#define PCI_DEVICE_ID_ADAPTEC2_RAZOR1F 0x41F
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR30 0x430
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR32 0x432
 #define PCI_DEVICE_ID_ADAPTEC2_RAZOR3E 0x43E
index 99743ca29ca147df75dacd12396be71da90266c9..a4cc432bbdabe3839edd794fb7c76b05aa881a84 100644 (file)
@@ -814,6 +814,8 @@ static const struct pci_device_id aic94xx_pci_table[] __devinitdata = {
         0, 0, 1},
        {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1E),
         0, 0, 1},
+       {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR1F),
+        0, 0, 1},
        {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR30),
         0, 0, 2},
        {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_RAZOR32),
index 83574b5b4e6948f0a30804d44e471763f1d72df1..de7c04d4254d50a7eb07a90de89d28ef43aba2f4 100644 (file)
@@ -630,10 +630,6 @@ static int asd_flash_getid(struct asd_ha_struct *asd_ha)
 
        reg = asd_read_reg_dword(asd_ha, EXSICNFGR);
 
-       if (!(reg & FLASHEX)) {
-               ASD_DPRINTK("flash doesn't exist\n");
-               return -ENOENT;
-       }
        if (pci_read_config_dword(asd_ha->pcidev, PCI_CONF_FLSH_BAR,
                                  &asd_ha->hw_prof.flash.bar)) {
                asd_printk("couldn't read PCI_CONF_FLSH_BAR of %s\n",
index 65e6e7b7ba07e5ab0ed0b1f5211ecb8e44b7198a..5d4ea6f77953f2fdeabf19d22eba31551bc2fae6 100644 (file)
@@ -387,6 +387,7 @@ static void __iomem *    bios_mem;
 static int               bios_major;
 static int               bios_minor;
 static int               PCI_bus;
+static struct pci_dev  *PCI_dev;
 static int               Quantum;      /* Quantum board variant */
 static int               interrupt_level;
 static volatile int      in_command;
@@ -812,9 +813,10 @@ static int fdomain_pci_bios_detect( int *irq, int *iobase, struct pci_dev **ret_
           PCI_DEVICE_ID_FD_36C70 );
 #endif 
 
-   if ((pdev = pci_find_device(PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70, pdev)) == NULL)
+   if ((pdev = pci_get_device(PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70, pdev)) == NULL)
                return 0;
-   if (pci_enable_device(pdev)) return 0;
+   if (pci_enable_device(pdev))
+       goto fail;
        
 #if DEBUG_DETECT
    printk( "scsi: <fdomain> TMC-3260 detect:"
@@ -831,7 +833,7 @@ static int fdomain_pci_bios_detect( int *irq, int *iobase, struct pci_dev **ret_
    pci_irq = pdev->irq;
 
    if (!request_region( pci_base, 0x10, "fdomain" ))
-       return 0;
+       goto fail;
 
    /* Now we have the I/O base address and interrupt from the PCI
       configuration registers. */
@@ -848,17 +850,22 @@ static int fdomain_pci_bios_detect( int *irq, int *iobase, struct pci_dev **ret_
    if (!fdomain_is_valid_port(pci_base)) {
       printk(KERN_ERR "scsi: <fdomain> PCI card detected, but driver not loaded (invalid port)\n" );
       release_region(pci_base, 0x10);
-      return 0;
+      goto fail;
    }
 
                                /* Fill in a few global variables.  Ugh. */
    bios_major = bios_minor = -1;
    PCI_bus    = 1;
+   PCI_dev    = pdev;
    Quantum    = 0;
    bios_base  = 0;
    
    return 1;
+fail:
+   pci_dev_put(pdev);
+   return 0;
 }
+
 #endif
 
 struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt )
@@ -909,8 +916,7 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt )
       if (setup_called) {
         printk(KERN_ERR "scsi: <fdomain> Bad LILO/INSMOD parameters?\n");
       }
-      release_region(port_base, 0x10);
-      return NULL;
+      goto fail;
    }
 
    if (this_id) {
@@ -942,8 +948,7 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt )
    /* Log IRQ with kernel */   
    if (!interrupt_level) {
       printk(KERN_ERR "scsi: <fdomain> Card Detected, but driver not loaded (no IRQ)\n" );
-      release_region(port_base, 0x10);
-      return NULL;
+      goto fail;
    } else {
       /* Register the IRQ with the kernel */
 
@@ -964,11 +969,14 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt )
            printk(KERN_ERR "                Send mail to faith@acm.org\n" );
         }
         printk(KERN_ERR "scsi: <fdomain> Detected, but driver not loaded (IRQ)\n" );
-         release_region(port_base, 0x10);
-        return NULL;
+        goto fail;
       }
    }
    return shpnt;
+fail:
+   pci_dev_put(pdev);
+   release_region(port_base, 0x10);
+   return NULL;
 }
 
 static int fdomain_16x0_detect(struct scsi_host_template *tpnt)
@@ -1714,6 +1722,8 @@ static int fdomain_16x0_release(struct Scsi_Host *shpnt)
                free_irq(shpnt->irq, shpnt);
        if (shpnt->io_port && shpnt->n_io_port)
                release_region(shpnt->io_port, shpnt->n_io_port);
+       if (PCI_bus)
+               pci_dev_put(PCI_dev);
        return 0;
 }
 
index 669ea4fff166096496f7f998cfb83448f80be985..fbc1d5c3b0a793a9800a326c35d293a4368e9979 100644 (file)
@@ -1213,7 +1213,7 @@ void ibmvscsi_handle_crq(struct viosrp_crq *crq,
                               "ibmvscsi: Re-enabling adapter!\n");
                        purge_requests(hostdata, DID_REQUEUE);
                        if ((ibmvscsi_reenable_crq_queue(&hostdata->queue,
-                                                       hostdata) == 0) ||
+                                                       hostdata)) ||
                            (ibmvscsi_send_crq(hostdata,
                                               0xC001000000000000LL, 0))) {
                                        atomic_set(&hostdata->request_limit,
index c542d0e95e682ed4432baafb8f5a54770f2dbc58..2865ebd557ef9d17f57dd2df72f54b2e1246658f 100644 (file)
@@ -481,8 +481,8 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
                        break;
                case ISCSI_OP_ASYNC_EVENT:
                        conn->exp_statsn = be32_to_cpu(hdr->statsn) + 1;
-                       /* we need sth like iscsi_async_event_rsp() */
-                       rc = ISCSI_ERR_BAD_OPCODE;
+                       if (iscsi_recv_pdu(conn->cls_conn, hdr, data, datalen))
+                               rc = ISCSI_ERR_CONN_FAILED;
                        break;
                default:
                        rc = ISCSI_ERR_BAD_OPCODE;
@@ -578,6 +578,27 @@ void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err)
 }
 EXPORT_SYMBOL_GPL(iscsi_conn_failure);
 
+static int iscsi_xmit_imm_task(struct iscsi_conn *conn)
+{
+       struct iscsi_hdr *hdr = conn->mtask->hdr;
+       int rc, was_logout = 0;
+
+       if ((hdr->opcode & ISCSI_OPCODE_MASK) == ISCSI_OP_LOGOUT) {
+               conn->session->state = ISCSI_STATE_IN_RECOVERY;
+               iscsi_block_session(session_to_cls(conn->session));
+               was_logout = 1;
+       }
+       rc = conn->session->tt->xmit_mgmt_task(conn, conn->mtask);
+       if (rc)
+               return rc;
+
+       if (was_logout) {
+               set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx);
+               return -ENODATA;
+       }
+       return 0;
+}
+
 /**
  * iscsi_data_xmit - xmit any command into the scheduled connection
  * @conn: iscsi connection
@@ -623,7 +644,7 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
                conn->ctask = NULL;
        }
        if (conn->mtask) {
-               rc = tt->xmit_mgmt_task(conn, conn->mtask);
+               rc = iscsi_xmit_imm_task(conn);
                if (rc)
                        goto again;
                /* done with this in-progress mtask */
@@ -638,7 +659,7 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
                        list_add_tail(&conn->mtask->running,
                                      &conn->mgmt_run_list);
                        spin_unlock_bh(&conn->session->lock);
-                       rc = tt->xmit_mgmt_task(conn, conn->mtask);
+                       rc = iscsi_xmit_imm_task(conn);
                        if (rc)
                                goto again;
                }
@@ -661,8 +682,6 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
                spin_unlock_bh(&conn->session->lock);
 
                rc = tt->xmit_cmd_task(conn, conn->ctask);
-               if (rc)
-                       goto again;
 
                spin_lock_bh(&conn->session->lock);
                __iscsi_put_ctask(conn->ctask);
@@ -778,6 +797,10 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
        }
 
        conn = session->leadconn;
+       if (!conn) {
+               reason = FAILURE_SESSION_FREED;
+               goto fault;
+       }
 
        if (!__kfifo_get(session->cmdpool.queue, (void*)&ctask,
                         sizeof(void*))) {
@@ -1377,7 +1400,6 @@ iscsi_session_setup(struct iscsi_transport *iscsit,
        }
 
        spin_lock_init(&session->lock);
-       INIT_LIST_HEAD(&session->connections);
 
        /* initialize immediate command pool */
        if (iscsi_pool_init(&session->mgmtpool, session->mgmtpool_max,
@@ -1580,16 +1602,11 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
        kfree(conn->persistent_address);
        __kfifo_put(session->mgmtpool.queue, (void*)&conn->login_mtask,
                    sizeof(void*));
-       list_del(&conn->item);
-       if (list_empty(&session->connections))
+       if (session->leadconn == conn) {
                session->leadconn = NULL;
-       if (session->leadconn && session->leadconn == conn)
-               session->leadconn = container_of(session->connections.next,
-                       struct iscsi_conn, item);
-
-       if (session->leadconn == NULL)
                /* no connections exits.. reset sequencing */
                session->cmdsn = session->max_cmdsn = session->exp_cmdsn = 1;
+       }
        spin_unlock_bh(&session->lock);
 
        kfifo_free(conn->immqueue);
@@ -1777,32 +1794,12 @@ int iscsi_conn_bind(struct iscsi_cls_session *cls_session,
                    struct iscsi_cls_conn *cls_conn, int is_leading)
 {
        struct iscsi_session *session = class_to_transport_session(cls_session);
-       struct iscsi_conn *tmp = ERR_PTR(-EEXIST), *conn = cls_conn->dd_data;
+       struct iscsi_conn *conn = cls_conn->dd_data;
 
-       /* lookup for existing connection */
        spin_lock_bh(&session->lock);
-       list_for_each_entry(tmp, &session->connections, item) {
-               if (tmp == conn) {
-                       if (conn->c_stage != ISCSI_CONN_STOPPED ||
-                           conn->stop_stage == STOP_CONN_TERM) {
-                               printk(KERN_ERR "iscsi: can't bind "
-                                      "non-stopped connection (%d:%d)\n",
-                                      conn->c_stage, conn->stop_stage);
-                               spin_unlock_bh(&session->lock);
-                               return -EIO;
-                       }
-                       break;
-               }
-       }
-       if (tmp != conn) {
-               /* bind new iSCSI connection to session */
-               conn->session = session;
-               list_add(&conn->item, &session->connections);
-       }
-       spin_unlock_bh(&session->lock);
-
        if (is_leading)
                session->leadconn = conn;
+       spin_unlock_bh(&session->lock);
 
        /*
         * Unblock xmitworker(), Login Phase will pass through.
index 9496e87c135ea2fcd8ee56afe1b603f703806da7..2a4e02e7a39211d83960c8522417d1b89f2d9be4 100644 (file)
@@ -594,7 +594,8 @@ lpfc_soft_wwpn_show(struct class_device *cdev, char *buf)
 {
        struct Scsi_Host *host = class_to_shost(cdev);
        struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
-       return snprintf(buf, PAGE_SIZE, "0x%llx\n", phba->cfg_soft_wwpn);
+       return snprintf(buf, PAGE_SIZE, "0x%llx\n",
+                       (unsigned long long)phba->cfg_soft_wwpn);
 }
 
 
index 1b53afb1cb5768c4946e889987cd58ab1691be39..3add7c237859d66347ff5ea69d19a3969d3da72e 100644 (file)
@@ -188,7 +188,8 @@ lpfc_alloc_ct_rsp(struct lpfc_hba * phba, int cmdcode, struct ulp_bde64 * bpl,
 
                if (!mp->virt) {
                        kfree(mp);
-                       lpfc_free_ct_rsp(phba, mlist);
+                       if (mlist)
+                               lpfc_free_ct_rsp(phba, mlist);
                        return NULL;
                }
 
index b1d3460495255ba1155176fd887ce52fb62c15c6..f2d79c3f0b8eef641fbaf42187133782c8101fee 100644 (file)
@@ -183,7 +183,7 @@ static void nsp_cs_dmessage(const char *func, int line, int mask, char *fmt, ...
  * Clenaup parameters and call done() functions.
  * You must be set SCpnt->result before call this function.
  */
-static void nsp_scsi_done(Scsi_Cmnd *SCpnt)
+static void nsp_scsi_done(struct scsi_cmnd *SCpnt)
 {
        nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
 
@@ -192,7 +192,8 @@ static void nsp_scsi_done(Scsi_Cmnd *SCpnt)
        SCpnt->scsi_done(SCpnt);
 }
 
-static int nsp_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
+static int nsp_queuecommand(struct scsi_cmnd *SCpnt,
+                           void (*done)(struct scsi_cmnd *))
 {
 #ifdef NSP_DEBUG
        /*unsigned int host_id = SCpnt->device->host->this_id;*/
@@ -365,7 +366,7 @@ static int nsphw_init(nsp_hw_data *data)
 /*
  * Start selection phase
  */
-static int nsphw_start_selection(Scsi_Cmnd *SCpnt)
+static int nsphw_start_selection(struct scsi_cmnd *SCpnt)
 {
        unsigned int  host_id    = SCpnt->device->host->this_id;
        unsigned int  base       = SCpnt->device->host->io_port;
@@ -446,7 +447,7 @@ static struct nsp_sync_table nsp_sync_table_20M[] = {
 /*
  * setup synchronous data transfer mode
  */
-static int nsp_analyze_sdtr(Scsi_Cmnd *SCpnt)
+static int nsp_analyze_sdtr(struct scsi_cmnd *SCpnt)
 {
        unsigned char          target = scmd_id(SCpnt);
 //     unsigned char          lun    = SCpnt->device->lun;
@@ -504,7 +505,7 @@ static int nsp_analyze_sdtr(Scsi_Cmnd *SCpnt)
 /*
  * start ninja hardware timer
  */
-static void nsp_start_timer(Scsi_Cmnd *SCpnt, int time)
+static void nsp_start_timer(struct scsi_cmnd *SCpnt, int time)
 {
        unsigned int base = SCpnt->device->host->io_port;
        nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
@@ -517,7 +518,8 @@ static void nsp_start_timer(Scsi_Cmnd *SCpnt, int time)
 /*
  * wait for bus phase change
  */
-static int nsp_negate_signal(Scsi_Cmnd *SCpnt, unsigned char mask, char *str)
+static int nsp_negate_signal(struct scsi_cmnd *SCpnt, unsigned char mask,
+                            char *str)
 {
        unsigned int  base = SCpnt->device->host->io_port;
        unsigned char reg;
@@ -544,9 +546,9 @@ static int nsp_negate_signal(Scsi_Cmnd *SCpnt, unsigned char mask, char *str)
 /*
  * expect Ninja Irq
  */
-static int nsp_expect_signal(Scsi_Cmnd    *SCpnt,
-                            unsigned char  current_phase,
-                            unsigned char  mask)
+static int nsp_expect_signal(struct scsi_cmnd *SCpnt,
+                            unsigned char current_phase,
+                            unsigned char mask)
 {
        unsigned int  base       = SCpnt->device->host->io_port;
        int           time_out;
@@ -579,7 +581,7 @@ static int nsp_expect_signal(Scsi_Cmnd         *SCpnt,
 /*
  * transfer SCSI message
  */
-static int nsp_xfer(Scsi_Cmnd *SCpnt, int phase)
+static int nsp_xfer(struct scsi_cmnd *SCpnt, int phase)
 {
        unsigned int  base = SCpnt->device->host->io_port;
        nsp_hw_data  *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
@@ -619,7 +621,7 @@ static int nsp_xfer(Scsi_Cmnd *SCpnt, int phase)
 /*
  * get extra SCSI data from fifo
  */
-static int nsp_dataphase_bypass(Scsi_Cmnd *SCpnt)
+static int nsp_dataphase_bypass(struct scsi_cmnd *SCpnt)
 {
        nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
        unsigned int count;
@@ -651,7 +653,7 @@ static int nsp_dataphase_bypass(Scsi_Cmnd *SCpnt)
 /*
  * accept reselection
  */
-static int nsp_reselected(Scsi_Cmnd *SCpnt)
+static int nsp_reselected(struct scsi_cmnd *SCpnt)
 {
        unsigned int  base    = SCpnt->device->host->io_port;
        unsigned int  host_id = SCpnt->device->host->this_id;
@@ -690,7 +692,7 @@ static int nsp_reselected(Scsi_Cmnd *SCpnt)
 /*
  * count how many data transferd
  */
-static int nsp_fifo_count(Scsi_Cmnd *SCpnt)
+static int nsp_fifo_count(struct scsi_cmnd *SCpnt)
 {
        unsigned int base = SCpnt->device->host->io_port;
        unsigned int count;
@@ -717,7 +719,7 @@ static int nsp_fifo_count(Scsi_Cmnd *SCpnt)
 /*
  * read data in DATA IN phase
  */
-static void nsp_pio_read(Scsi_Cmnd *SCpnt)
+static void nsp_pio_read(struct scsi_cmnd *SCpnt)
 {
        unsigned int  base      = SCpnt->device->host->io_port;
        unsigned long mmio_base = SCpnt->device->host->base;
@@ -812,7 +814,7 @@ static void nsp_pio_read(Scsi_Cmnd *SCpnt)
 /*
  * write data in DATA OUT phase
  */
-static void nsp_pio_write(Scsi_Cmnd *SCpnt)
+static void nsp_pio_write(struct scsi_cmnd *SCpnt)
 {
        unsigned int  base      = SCpnt->device->host->io_port;
        unsigned long mmio_base = SCpnt->device->host->base;
@@ -905,7 +907,7 @@ static void nsp_pio_write(Scsi_Cmnd *SCpnt)
 /*
  * setup synchronous/asynchronous data transfer mode
  */
-static int nsp_nexus(Scsi_Cmnd *SCpnt)
+static int nsp_nexus(struct scsi_cmnd *SCpnt)
 {
        unsigned int   base   = SCpnt->device->host->io_port;
        unsigned char  target = scmd_id(SCpnt);
@@ -952,7 +954,7 @@ static irqreturn_t nspintr(int irq, void *dev_id)
 {
        unsigned int   base;
        unsigned char  irq_status, irq_phase, phase;
-       Scsi_Cmnd     *tmpSC;
+       struct scsi_cmnd *tmpSC;
        unsigned char  target, lun;
        unsigned int  *sync_neg;
        int            i, tmp;
@@ -1530,7 +1532,7 @@ nsp_proc_info(
 /*---------------------------------------------------------------*/
 
 /*
-static int nsp_eh_abort(Scsi_Cmnd *SCpnt)
+static int nsp_eh_abort(struct scsi_cmnd *SCpnt)
 {
        nsp_dbg(NSP_DEBUG_BUSRESET, "SCpnt=0x%p", SCpnt);
 
@@ -1558,7 +1560,7 @@ static int nsp_bus_reset(nsp_hw_data *data)
        return SUCCESS;
 }
 
-static int nsp_eh_bus_reset(Scsi_Cmnd *SCpnt)
+static int nsp_eh_bus_reset(struct scsi_cmnd *SCpnt)
 {
        nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
 
@@ -1567,7 +1569,7 @@ static int nsp_eh_bus_reset(Scsi_Cmnd *SCpnt)
        return nsp_bus_reset(data);
 }
 
-static int nsp_eh_host_reset(Scsi_Cmnd *SCpnt)
+static int nsp_eh_host_reset(struct scsi_cmnd *SCpnt)
 {
        nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
 
index a88714f4c05b2d87ccee5915e1368ed50279ad8b..625ca97da52d526893e690a85c805b88f5d2817c 100644 (file)
@@ -266,7 +266,7 @@ typedef struct _nsp_hw_data {
 
        int           TimerCount;
        int           SelectionTimeOut;
-       Scsi_Cmnd    *CurrentSC;
+       struct scsi_cmnd *CurrentSC;
        //int           CurrnetTarget;
 
        int           FifoCount;
@@ -319,30 +319,34 @@ static        int        nsp_proc_info  (
                                         int     hostno,
 #endif
                                         int     inout);
-static        int        nsp_queuecommand(Scsi_Cmnd *SCpnt, void (* done)(Scsi_Cmnd *SCpnt));
+static int nsp_queuecommand(struct scsi_cmnd *SCpnt,
+                           void (* done)(struct scsi_cmnd *SCpnt));
 
 /* Error handler */
-/*static int nsp_eh_abort       (Scsi_Cmnd *SCpnt);*/
-/*static int nsp_eh_device_reset(Scsi_Cmnd *SCpnt);*/
-static int nsp_eh_bus_reset    (Scsi_Cmnd *SCpnt);
-static int nsp_eh_host_reset   (Scsi_Cmnd *SCpnt);
+/*static int nsp_eh_abort       (struct scsi_cmnd *SCpnt);*/
+/*static int nsp_eh_device_reset(struct scsi_cmnd *SCpnt);*/
+static int nsp_eh_bus_reset    (struct scsi_cmnd *SCpnt);
+static int nsp_eh_host_reset   (struct scsi_cmnd *SCpnt);
 static int nsp_bus_reset       (nsp_hw_data *data);
 
 /* */
 static int  nsphw_init           (nsp_hw_data *data);
-static int  nsphw_start_selection(Scsi_Cmnd *SCpnt);
-static void nsp_start_timer      (Scsi_Cmnd *SCpnt, int time);
-static int  nsp_fifo_count       (Scsi_Cmnd *SCpnt);
-static void nsp_pio_read         (Scsi_Cmnd *SCpnt);
-static void nsp_pio_write        (Scsi_Cmnd *SCpnt);
-static int  nsp_nexus            (Scsi_Cmnd *SCpnt);
-static void nsp_scsi_done        (Scsi_Cmnd *SCpnt);
-static int  nsp_analyze_sdtr     (Scsi_Cmnd *SCpnt);
-static int  nsp_negate_signal    (Scsi_Cmnd *SCpnt, unsigned char mask, char *str);
-static int  nsp_expect_signal    (Scsi_Cmnd *SCpnt, unsigned char current_phase, unsigned char  mask);
-static int  nsp_xfer             (Scsi_Cmnd *SCpnt, int phase);
-static int  nsp_dataphase_bypass (Scsi_Cmnd *SCpnt);
-static int  nsp_reselected       (Scsi_Cmnd *SCpnt);
+static int  nsphw_start_selection(struct scsi_cmnd *SCpnt);
+static void nsp_start_timer      (struct scsi_cmnd *SCpnt, int time);
+static int  nsp_fifo_count       (struct scsi_cmnd *SCpnt);
+static void nsp_pio_read         (struct scsi_cmnd *SCpnt);
+static void nsp_pio_write        (struct scsi_cmnd *SCpnt);
+static int  nsp_nexus            (struct scsi_cmnd *SCpnt);
+static void nsp_scsi_done        (struct scsi_cmnd *SCpnt);
+static int  nsp_analyze_sdtr     (struct scsi_cmnd *SCpnt);
+static int  nsp_negate_signal    (struct scsi_cmnd *SCpnt,
+                                 unsigned char mask, char *str);
+static int  nsp_expect_signal    (struct scsi_cmnd *SCpnt,
+                                 unsigned char current_phase,
+                                 unsigned char  mask);
+static int  nsp_xfer             (struct scsi_cmnd *SCpnt, int phase);
+static int  nsp_dataphase_bypass (struct scsi_cmnd *SCpnt);
+static int  nsp_reselected       (struct scsi_cmnd *SCpnt);
 static struct Scsi_Host *nsp_detect(struct scsi_host_template *sht);
 
 /* Interrupt handler */
@@ -355,8 +359,8 @@ static void __exit nsp_cs_exit(void);
 
 /* Debug */
 #ifdef NSP_DEBUG
-static void show_command (Scsi_Cmnd *SCpnt);
-static void show_phase   (Scsi_Cmnd *SCpnt);
+static void show_command (struct scsi_cmnd *SCpnt);
+static void show_phase   (struct scsi_cmnd *SCpnt);
 static void show_busphase(unsigned char stat);
 static void show_message (nsp_hw_data *data);
 #else
index 62e5c60067fdfdabadf9fd1d133dfbf6a5406683..2f75fe6e35a732d5eb10d3f2f174207c2f56add4 100644 (file)
@@ -138,12 +138,12 @@ static void print_commandk (unsigned char *command)
        printk("\n");
 }
 
-static void show_command(Scsi_Cmnd *SCpnt)
+static void show_command(struct scsi_cmnd *SCpnt)
 {
        print_commandk(SCpnt->cmnd);
 }
 
-static void show_phase(Scsi_Cmnd *SCpnt)
+static void show_phase(struct scsi_cmnd *SCpnt)
 {
        int i = SCpnt->SCp.phase;
 
index d7057737ff3405849f27060c450647adef6604a3..ef593b70d0f061d50902e0301439d0a3c01bae02 100644 (file)
@@ -8,7 +8,7 @@
 
 /* $Id: nsp_message.c,v 1.6 2003/07/26 14:21:09 elca Exp $ */
 
-static void nsp_message_in(Scsi_Cmnd *SCpnt)
+static void nsp_message_in(struct scsi_cmnd *SCpnt)
 {
        unsigned int  base = SCpnt->device->host->io_port;
        nsp_hw_data  *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
@@ -50,7 +50,7 @@ static void nsp_message_in(Scsi_Cmnd *SCpnt)
 
 }
 
-static void nsp_message_out(Scsi_Cmnd *SCpnt)
+static void nsp_message_out(struct scsi_cmnd *SCpnt)
 {
        nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
        int ret = 1;
index a720c9265e6637c5cbc5b330ec1cf060a43e6b2a..ac0419e2714ae2df0edee98aa45a2915b84c08da 100644 (file)
@@ -87,11 +87,11 @@ typedef struct
        {
        USHORT           ports[13];
        OUR_DEVICE       device[8];
-       Scsi_Cmnd       *pSCmnd;
+       struct scsi_cmnd *pSCmnd;
        IDE_STRUCT       ide;
        ULONG            startSector;
        USHORT           sectorCount;
-       Scsi_Cmnd       *SCpnt;
+       struct scsi_cmnd *SCpnt;
        VOID            *buffer;
        USHORT           expectingIRQ;
        }       ADAPTER240I, *PADAPTER240I;
@@ -253,12 +253,12 @@ static ULONG DecodeError (struct Scsi_Host *pshost, UCHAR status)
  ****************************************************************/
 static void Irq_Handler (int irq, void *dev_id)
        {
-       struct Scsi_Host   *shost;                      // Pointer to host data block
-       PADAPTER240I            padapter;               // Pointer to adapter control structure
-       USHORT                     *pports;                     // I/O port array
-       Scsi_Cmnd                  *SCpnt;
-       UCHAR                           status;
-       int                                     z;
+       struct Scsi_Host *shost;        // Pointer to host data block
+       PADAPTER240I padapter;          // Pointer to adapter control structure
+       USHORT *pports;                 // I/O port array
+       struct scsi_cmnd *SCpnt;
+       UCHAR status;
+       int z;
 
        DEB(printk ("\npsi240i received interrupt\n"));
 
@@ -389,12 +389,17 @@ static irqreturn_t do_Irq_Handler (int irq, void *dev_id)
  *     Returns:                Status code.
  *
  ****************************************************************/
-static int Psi240i_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
+static int Psi240i_QueueCommand(struct scsi_cmnd *SCpnt,
+                               void (*done)(struct scsi_cmnd *))
        {
-       UCHAR              *cdb = (UCHAR *)SCpnt->cmnd;                                 // Pointer to SCSI CDB
-       PADAPTER240I    padapter = HOSTDATA (SCpnt->device->host);                      // Pointer to adapter control structure
-       POUR_DEVICE             pdev     = &padapter->device [SCpnt->device->id];// Pointer to device information
-       UCHAR                   rc;                                                                                     // command return code
+       UCHAR *cdb = (UCHAR *)SCpnt->cmnd;
+       // Pointer to SCSI CDB
+       PADAPTER240I padapter = HOSTDATA (SCpnt->device->host);
+       // Pointer to adapter control structure
+       POUR_DEVICE pdev = &padapter->device [SCpnt->device->id];
+       // Pointer to device information
+       UCHAR rc;
+       // command return code
 
        SCpnt->scsi_done = done;
        padapter->ide.ide.ides.spigot = pdev->spigot;
index 6a598766df51648de8185be4044c15d71056e710..21ebb9214004cfc1eed5112eadd0d7a8bf4710c2 100644 (file)
@@ -309,7 +309,7 @@ typedef struct _IDENTIFY_DATA2 {
 #endif // PSI_EIDE_SCSIOP
 
 // function prototypes
-int Psi240i_Command                    (Scsi_Cmnd *SCpnt);
-int Psi240i_Abort                      (Scsi_Cmnd *SCpnt);
-int Psi240i_Reset                      (Scsi_Cmnd *SCpnt, unsigned int flags);
+int Psi240i_Command(struct scsi_cmnd *SCpnt);
+int Psi240i_Abort(struct scsi_cmnd *SCpnt);
+int Psi240i_Reset(struct scsi_cmnd *SCpnt, unsigned int flags);
 #endif
index 2521d548dd5941123bd644c6da74fd96ae510481..16af5b79e5878ff23f8b920c6ad2bf6a125c2042 100644 (file)
@@ -931,11 +931,10 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
 
        case BUS_RESET:
                if (qla1280_verbose)
-                       printk(KERN_INFO "qla1280(%ld:%d): Issuing BUS "
-                              "DEVICE RESET\n", ha->host_no, bus);
-               if (qla1280_bus_reset(ha, bus == 0))
+                       printk(KERN_INFO "qla1280(%ld:%d): Issued bus "
+                              "reset.\n", ha->host_no, bus);
+               if (qla1280_bus_reset(ha, bus) == 0)
                        result = SUCCESS;
-
                break;
 
        case ADAPTER_RESET:
index ee75a71f3c6608be7a4eb314284e127c6f999d03..285c8e8ff1a09658ddeb65c07348899da9aa316f 100644 (file)
@@ -379,21 +379,37 @@ static struct bin_attribute sysfs_sfp_attr = {
        .read = qla2x00_sysfs_read_sfp,
 };
 
+static struct sysfs_entry {
+       char *name;
+       struct bin_attribute *attr;
+       int is4GBp_only;
+} bin_file_entries[] = {
+       { "fw_dump", &sysfs_fw_dump_attr, },
+       { "nvram", &sysfs_nvram_attr, },
+       { "optrom", &sysfs_optrom_attr, },
+       { "optrom_ctl", &sysfs_optrom_ctl_attr, },
+       { "vpd", &sysfs_vpd_attr, 1 },
+       { "sfp", &sysfs_sfp_attr, 1 },
+       { 0 },
+};
+
 void
 qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha)
 {
        struct Scsi_Host *host = ha->host;
+       struct sysfs_entry *iter;
+       int ret;
 
-       sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_fw_dump_attr);
-       sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_nvram_attr);
-       sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr);
-       sysfs_create_bin_file(&host->shost_gendev.kobj,
-           &sysfs_optrom_ctl_attr);
-       if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
-               sysfs_create_bin_file(&host->shost_gendev.kobj,
-                   &sysfs_vpd_attr);
-               sysfs_create_bin_file(&host->shost_gendev.kobj,
-                   &sysfs_sfp_attr);
+       for (iter = bin_file_entries; iter->name; iter++) {
+               if (iter->is4GBp_only && (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)))
+                       continue;
+
+               ret = sysfs_create_bin_file(&host->shost_gendev.kobj,
+                   iter->attr);
+               if (ret)
+                       qla_printk(KERN_INFO, ha,
+                           "Unable to create sysfs %s binary attribute "
+                           "(%d).\n", iter->name, ret);
        }
 }
 
@@ -401,17 +417,14 @@ void
 qla2x00_free_sysfs_attr(scsi_qla_host_t *ha)
 {
        struct Scsi_Host *host = ha->host;
+       struct sysfs_entry *iter;
+
+       for (iter = bin_file_entries; iter->name; iter++) {
+               if (iter->is4GBp_only && (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)))
+                       continue;
 
-       sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_fw_dump_attr);
-       sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_nvram_attr);
-       sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr);
-       sysfs_remove_bin_file(&host->shost_gendev.kobj,
-           &sysfs_optrom_ctl_attr);
-       if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
-               sysfs_remove_bin_file(&host->shost_gendev.kobj,
-                   &sysfs_vpd_attr);
                sysfs_remove_bin_file(&host->shost_gendev.kobj,
-                   &sysfs_sfp_attr);
+                   iter->attr);
        }
 
        if (ha->beacon_blink_led == 1)
index 90dad7e8898563b5f358d80781bef05723cb7e4f..5b12278968e0b4d3001ff318fbc5e87024db1629 100644 (file)
@@ -38,7 +38,7 @@
 * Macros use for debugging the driver.
 */
 
-#define DEBUG(x)       do { if (qla2_extended_error_logging) { x; } } while (0)
+#define DEBUG(x)       do { if (ql2xextended_error_logging) { x; } } while (0)
 
 #if defined(QL_DEBUG_LEVEL_1)
 #define DEBUG1(x)      do {x;} while (0)
 #define DEBUG1(x)      do {} while (0)
 #endif
 
-#define DEBUG2(x)      do { if (qla2_extended_error_logging) { x; } } while (0)
-#define DEBUG2_3(x)    do { if (qla2_extended_error_logging) { x; } } while (0)
-#define DEBUG2_3_11(x) do { if (qla2_extended_error_logging) { x; } } while (0)
-#define DEBUG2_9_10(x) do { if (qla2_extended_error_logging) { x; } } while (0)
-#define DEBUG2_11(x)   do { if (qla2_extended_error_logging) { x; } } while (0)
-#define DEBUG2_13(x)   do { if (qla2_extended_error_logging) { x; } } while (0)
+#define DEBUG2(x)      do { if (ql2xextended_error_logging) { x; } } while (0)
+#define DEBUG2_3(x)    do { if (ql2xextended_error_logging) { x; } } while (0)
+#define DEBUG2_3_11(x) do { if (ql2xextended_error_logging) { x; } } while (0)
+#define DEBUG2_9_10(x) do { if (ql2xextended_error_logging) { x; } } while (0)
+#define DEBUG2_11(x)   do { if (ql2xextended_error_logging) { x; } } while (0)
+#define DEBUG2_13(x)   do { if (ql2xextended_error_logging) { x; } } while (0)
 
 #if defined(QL_DEBUG_LEVEL_3)
 #define DEBUG3(x)      do {x;} while (0)
index bab33f6d0bdb55709b42933e093d72be7d094047..c4fc40f8e8caee98555358c2a2d1d0a9d01f4138 100644 (file)
@@ -1545,6 +1545,9 @@ typedef struct fc_port {
        spinlock_t rport_lock;
        struct fc_rport *rport, *drport;
        u32 supported_classes;
+
+       unsigned long last_queue_full;
+       unsigned long last_ramp_up;
 } fc_port_t;
 
 /*
@@ -2255,6 +2258,7 @@ typedef struct scsi_qla_host {
        uint16_t        mgmt_svr_loop_id;
 
         uint32_t       login_retry_count;
+       int             max_q_depth;
 
        /* Fibre Channel Device List. */
        struct list_head        fcports;
index 7da69832d74cec12007d26f463c1c6d849912ed6..32ebeec45ff000bdb51e4d13d1e4e05bc692f000 100644 (file)
@@ -48,6 +48,7 @@ extern void qla2x00_update_fcport(scsi_qla_host_t *, fc_port_t *);
 extern void qla2x00_reg_remote_port(scsi_qla_host_t *, fc_port_t *);
 
 extern void qla2x00_alloc_fw_dump(scsi_qla_host_t *);
+extern void qla2x00_try_to_stop_firmware(scsi_qla_host_t *);
 
 /*
  * Global Data in qla_os.c source file.
@@ -60,7 +61,8 @@ extern int ql2xplogiabsentdevice;
 extern int ql2xloginretrycount;
 extern int ql2xfdmienable;
 extern int ql2xallocfwdump;
-extern int qla2_extended_error_logging;
+extern int ql2xextended_error_logging;
+extern int ql2xqfullrampup;
 
 extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *);
 
index 833b93085fd3d0bdb577f61f61d2d9d77a321166..08cb5e3fb55319d7eba7965f5863872aac1193f1 100644 (file)
@@ -1644,7 +1644,7 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
         * Set host adapter parameters.
         */
        if (nv->host_p[0] & BIT_7)
-               qla2_extended_error_logging = 1;
+               ql2xextended_error_logging = 1;
        ha->flags.disable_risc_code_load = ((nv->host_p[0] & BIT_4) ? 1 : 0);
        /* Always load RISC code on non ISP2[12]00 chips. */
        if (!IS_QLA2100(ha) && !IS_QLA2200(ha))
@@ -3948,3 +3948,24 @@ qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr)
 fail_fw_integrity:
        return QLA_FUNCTION_FAILED;
 }
+
+void
+qla2x00_try_to_stop_firmware(scsi_qla_host_t *ha)
+{
+       int ret, retries;
+
+       if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
+               return;
+
+       ret = qla2x00_stop_firmware(ha);
+       for (retries = 5; ret != QLA_SUCCESS && retries ; retries--) {
+               qla2x00_reset_chip(ha);
+               if (qla2x00_chip_diag(ha) != QLA_SUCCESS)
+                       continue;
+               if (qla2x00_setup_chip(ha) != QLA_SUCCESS)
+                       continue;
+               qla_printk(KERN_INFO, ha,
+                   "Attempting retry of stop-firmware command...\n");
+               ret = qla2x00_stop_firmware(ha);
+       }
+}
index 626c7178a4341bbf2b482c74d13b6abee23c66cc..d3b6df4d55c890990f75d0239a62fd65b22213a9 100644 (file)
@@ -6,6 +6,8 @@
  */
 #include "qla_def.h"
 
+#include <scsi/scsi_tcq.h>
+
 static void qla2x00_mbx_completion(scsi_qla_host_t *, uint16_t);
 static void qla2x00_async_event(scsi_qla_host_t *, uint16_t *);
 static void qla2x00_process_completed_request(struct scsi_qla_host *, uint32_t);
@@ -593,6 +595,67 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
        }
 }
 
+static void
+qla2x00_adjust_sdev_qdepth_up(struct scsi_device *sdev, void *data)
+{
+       fc_port_t *fcport = data;
+
+       if (fcport->ha->max_q_depth <= sdev->queue_depth)
+               return;
+
+       if (sdev->ordered_tags)
+               scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG,
+                   sdev->queue_depth + 1);
+       else
+               scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG,
+                   sdev->queue_depth + 1);
+
+       fcport->last_ramp_up = jiffies;
+
+       DEBUG2(qla_printk(KERN_INFO, fcport->ha,
+           "scsi(%ld:%d:%d:%d): Queue depth adjusted-up to %d.\n",
+           fcport->ha->host_no, sdev->channel, sdev->id, sdev->lun,
+           sdev->queue_depth));
+}
+
+static void
+qla2x00_adjust_sdev_qdepth_down(struct scsi_device *sdev, void *data)
+{
+       fc_port_t *fcport = data;
+
+       if (!scsi_track_queue_full(sdev, sdev->queue_depth - 1))
+               return;
+
+       DEBUG2(qla_printk(KERN_INFO, fcport->ha,
+           "scsi(%ld:%d:%d:%d): Queue depth adjusted-down to %d.\n",
+           fcport->ha->host_no, sdev->channel, sdev->id, sdev->lun,
+           sdev->queue_depth));
+}
+
+static inline void
+qla2x00_ramp_up_queue_depth(scsi_qla_host_t *ha, srb_t *sp)
+{
+       fc_port_t *fcport;
+       struct scsi_device *sdev;
+
+       sdev = sp->cmd->device;
+       if (sdev->queue_depth >= ha->max_q_depth)
+               return;
+
+       fcport = sp->fcport;
+       if (time_before(jiffies,
+           fcport->last_ramp_up + ql2xqfullrampup * HZ))
+               return;
+       if (time_before(jiffies,
+           fcport->last_queue_full + ql2xqfullrampup * HZ))
+               return;
+
+       spin_unlock_irq(&ha->hardware_lock);
+       starget_for_each_device(sdev->sdev_target, fcport,
+           qla2x00_adjust_sdev_qdepth_up);
+       spin_lock_irq(&ha->hardware_lock);
+}
+
 /**
  * qla2x00_process_completed_request() - Process a Fast Post response.
  * @ha: SCSI driver HA context
@@ -624,6 +687,8 @@ qla2x00_process_completed_request(struct scsi_qla_host *ha, uint32_t index)
 
                /* Save ISP completion status */
                sp->cmd->result = DID_OK << 16;
+
+               qla2x00_ramp_up_queue_depth(ha, sp);
                qla2x00_sp_compl(ha, sp);
        } else {
                DEBUG2(printk("scsi(%ld): Invalid ISP SCSI completion handle\n",
@@ -823,6 +888,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
         */
        switch (comp_status) {
        case CS_COMPLETE:
+       case CS_QUEUE_FULL:
                if (scsi_status == 0) {
                        cp->result = DID_OK << 16;
                        break;
@@ -849,6 +915,20 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
                }
                cp->result = DID_OK << 16 | lscsi_status;
 
+               if (lscsi_status == SAM_STAT_TASK_SET_FULL) {
+                       DEBUG2(printk(KERN_INFO
+                           "scsi(%ld): QUEUE FULL status detected "
+                           "0x%x-0x%x.\n", ha->host_no, comp_status,
+                           scsi_status));
+
+                       /* Adjust queue depth for all luns on the port. */
+                       fcport->last_queue_full = jiffies;
+                       spin_unlock_irq(&ha->hardware_lock);
+                       starget_for_each_device(cp->device->sdev_target,
+                           fcport, qla2x00_adjust_sdev_qdepth_down);
+                       spin_lock_irq(&ha->hardware_lock);
+                       break;
+               }
                if (lscsi_status != SS_CHECK_CONDITION)
                        break;
 
@@ -1066,17 +1146,6 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
                        qla2x00_mark_device_lost(ha, fcport, 1, 1);
                break;
 
-       case CS_QUEUE_FULL:
-               DEBUG2(printk(KERN_INFO
-                   "scsi(%ld): QUEUE FULL status detected 0x%x-0x%x.\n",
-                   ha->host_no, comp_status, scsi_status));
-
-               /* SCSI Mid-Layer handles device queue full */
-
-               cp->result = DID_OK << 16 | lscsi_status;
-
-               break;
-
        default:
                DEBUG3(printk("scsi(%ld): Error detected (unknown status) "
                    "0x%x-0x%x.\n", ha->host_no, comp_status, scsi_status));
index 3f20d765563eba4f013375e5694269135c8b1a3a..208607be78c7267a5770974b8d4be12d4b839b87 100644 (file)
@@ -61,9 +61,9 @@ MODULE_PARM_DESC(ql2xallocfwdump,
                "during HBA initialization.  Memory allocation requirements "
                "vary by ISP type.  Default is 1 - allocate memory.");
 
-int qla2_extended_error_logging;
-module_param(qla2_extended_error_logging, int, S_IRUGO|S_IRUSR);
-MODULE_PARM_DESC(qla2_extended_error_logging,
+int ql2xextended_error_logging;
+module_param(ql2xextended_error_logging, int, S_IRUGO|S_IRUSR);
+MODULE_PARM_DESC(ql2xextended_error_logging,
                "Option to enable extended error logging, "
                "Default is 0 - no logging. 1 - log errors.");
 
@@ -77,6 +77,19 @@ MODULE_PARM_DESC(ql2xfdmienable,
                "Enables FDMI registratons "
                "Default is 0 - no FDMI. 1 - perfom FDMI.");
 
+#define MAX_Q_DEPTH    32
+static int ql2xmaxqdepth = MAX_Q_DEPTH;
+module_param(ql2xmaxqdepth, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(ql2xmaxqdepth,
+               "Maximum queue depth to report for target devices.");
+
+int ql2xqfullrampup = 120;
+module_param(ql2xqfullrampup, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(ql2xqfullrampup,
+               "Number of seconds to wait to begin to ramp-up the queue "
+               "depth for a device after a queue-full condition has been "
+               "detected.  Default is 120 seconds.");
+
 /*
  * SCSI host template entry points
  */
@@ -1104,9 +1117,9 @@ qla2xxx_slave_configure(struct scsi_device *sdev)
        struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
 
        if (sdev->tagged_supported)
-               scsi_activate_tcq(sdev, 32);
+               scsi_activate_tcq(sdev, ha->max_q_depth);
        else
-               scsi_deactivate_tcq(sdev, 32);
+               scsi_deactivate_tcq(sdev, ha->max_q_depth);
 
        rport->dev_loss_tmo = ha->port_down_retry_count + 5;
 
@@ -1413,6 +1426,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        ha->link_data_rate = PORT_SPEED_UNKNOWN;
        ha->optrom_size = OPTROM_SIZE_2300;
 
+       ha->max_q_depth = MAX_Q_DEPTH;
+       if (ql2xmaxqdepth != 0 && ql2xmaxqdepth <= 0xffffU)
+               ha->max_q_depth = ql2xmaxqdepth;
+
        /* Assign ISP specific operations. */
        ha->isp_ops.pci_config          = qla2100_pci_config;
        ha->isp_ops.reset_chip          = qla2x00_reset_chip;
@@ -1712,8 +1729,10 @@ qla2x00_free_device(scsi_qla_host_t *ha)
        if (ha->eft)
                qla2x00_trace_control(ha, TC_DISABLE, 0, 0);
 
+       ha->flags.online = 0;
+
        /* Stop currently executing firmware. */
-       qla2x00_stop_firmware(ha);
+       qla2x00_try_to_stop_firmware(ha);
 
        /* turn-off interrupts on the card */
        if (ha->interrupts_on)
@@ -1721,8 +1740,6 @@ qla2x00_free_device(scsi_qla_host_t *ha)
 
        qla2x00_mem_free(ha);
 
-       ha->flags.online = 0;
-
        /* Detach interrupts */
        if (ha->host->irq)
                free_irq(ha->host->irq, ha);
@@ -2697,7 +2714,7 @@ qla2x00_module_init(void)
 
        /* Derive version string. */
        strcpy(qla2x00_version_str, QLA2XXX_VERSION);
-       if (qla2_extended_error_logging)
+       if (ql2xextended_error_logging)
                strcat(qla2x00_version_str, "-debug");
 
        qla2xxx_transport_template =
index e57bf45a33936d29aea8fcc90c1450329ce8cec5..1fa0bce6b24ec272120884d8ffedc33f0d7c11f3 100644 (file)
@@ -7,7 +7,7 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION      "8.01.07-k2"
+#define QLA2XXX_VERSION      "8.01.07-k3"
 
 #define QLA_DRIVER_MAJOR_VER   8
 #define QLA_DRIVER_MINOR_VER   1
index 3e99dcfd5a9f60612033668dad27f90a4221b55c..d861c3b411c88746e837915a62009a13205ca222 100644 (file)
 #endif
 
 #if defined(QL_DEBUG_LEVEL_2)
-#define DEBUG2(x)      do {if(qla4_extended_error_logging == 2) x;} while (0);
+#define DEBUG2(x)      do {if(ql4xextended_error_logging == 2) x;} while (0);
 #define DEBUG2_3(x)   do {x;} while (0);
 #else                          /*  */
 #define DEBUG2(x)      do {} while (0);
 #endif                         /*  */
 
 #if defined(QL_DEBUG_LEVEL_3)
-#define DEBUG3(x)      do {if(qla4_extended_error_logging == 3) x;} while (0);
+#define DEBUG3(x)      do {if(ql4xextended_error_logging == 3) x;} while (0);
 #else                          /*  */
 #define DEBUG3(x)      do {} while (0);
 #if !defined(QL_DEBUG_LEVEL_2)
index 2c803edf2de805b5a082b906dd217947780e72c3..1b221ff0f6f7276ea57392953aa35e6ef30d86dd 100644 (file)
@@ -72,7 +72,7 @@ int qla4xxx_reinitialize_ddb_list(struct scsi_qla_host * ha);
 int qla4xxx_process_ddb_changed(struct scsi_qla_host * ha,
                                uint32_t fw_ddb_index, uint32_t state);
 
-extern int qla4_extended_error_logging;
+extern int ql4xextended_error_logging;
 extern int ql4xdiscoverywait;
 extern int ql4xdontresethba;
 #endif                         /* _QLA4x_GBL_H */
index ef82399c0858aa24cfca09b5b6f5c10aeddb674f..b721dc5dd7112add3a815d358b97c6fe6e30ecc0 100644 (file)
@@ -701,7 +701,7 @@ void qla4xxx_get_conn_event_log(struct scsi_qla_host * ha)
        DEBUG3(printk("scsi%ld: Connection Event Log Dump (%d entries):\n",
                      ha->host_no, num_valid_entries));
 
-       if (qla4_extended_error_logging == 3) {
+       if (ql4xextended_error_logging == 3) {
                if (oldest_entry == 0) {
                        /* Circular Buffer has not wrapped around */
                        for (i=0; i < num_valid_entries; i++) {
index 178fcddcfd81ec8d245858d859aba70ecd45a9ba..5b8db6109536d26392603d3b635fd48b56ebf473 100644 (file)
@@ -34,9 +34,9 @@ MODULE_PARM_DESC(ql4xdontresethba,
                 " default it will reset hba :0"
                 " set to 1 to avoid resetting HBA");
 
-int qla4_extended_error_logging = 0; /* 0 = off, 1 = log errors */
-module_param(qla4_extended_error_logging, int, S_IRUGO | S_IRUSR);
-MODULE_PARM_DESC(qla4_extended_error_logging,
+int ql4xextended_error_logging = 0; /* 0 = off, 1 = log errors */
+module_param(ql4xextended_error_logging, int, S_IRUGO | S_IRUSR);
+MODULE_PARM_DESC(ql4xextended_error_logging,
                 "Option to enable extended error logging, "
                 "Default is 0 - no logging, 1 - debug logging");
 
@@ -1714,7 +1714,7 @@ static int __init qla4xxx_module_init(void)
 
        /* Derive version string. */
        strcpy(qla4xxx_version_str, QLA4XXX_DRIVER_VERSION);
-       if (qla4_extended_error_logging)
+       if (ql4xextended_error_logging)
                strcat(qla4xxx_version_str, "-debug");
 
        qla4xxx_scsi_transport =
@@ -1724,13 +1724,13 @@ static int __init qla4xxx_module_init(void)
                goto release_srb_cache;
        }
 
-       printk(KERN_INFO "QLogic iSCSI HBA Driver\n");
        ret = pci_register_driver(&qla4xxx_pci_driver);
        if (ret)
                goto unregister_transport;
 
        printk(KERN_INFO "QLogic iSCSI HBA Driver\n");
        return 0;
+
 unregister_transport:
        iscsi_unregister_transport(&qla4xxx_iscsi_transport);
 release_srb_cache:
index e0725353c99cdaf18e7f1708ada202348ca1977c..2e7db18f5aefe2aae3f9113333aa4abd40e6cdd3 100644 (file)
@@ -209,7 +209,7 @@ static int ql_wai(struct qlogicfas408_priv *priv)
  *     caller must hold host lock
  */
 
-static void ql_icmd(Scsi_Cmnd * cmd)
+static void ql_icmd(struct scsi_cmnd *cmd)
 {
        struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
        int     qbase = priv->qbase;
@@ -256,7 +256,7 @@ static void ql_icmd(Scsi_Cmnd * cmd)
  *     Process scsi command - usually after interrupt 
  */
 
-static unsigned int ql_pcmd(Scsi_Cmnd * cmd)
+static unsigned int ql_pcmd(struct scsi_cmnd *cmd)
 {
        unsigned int i, j;
        unsigned long k;
@@ -407,7 +407,7 @@ static unsigned int ql_pcmd(Scsi_Cmnd * cmd)
 
 static void ql_ihandl(void *dev_id)
 {
-       Scsi_Cmnd *icmd;
+       struct scsi_cmnd *icmd;
        struct Scsi_Host *host = dev_id;
        struct qlogicfas408_priv *priv = get_priv_by_host(host);
        int qbase = priv->qbase;
@@ -447,7 +447,8 @@ irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id)
  *     Queued command
  */
 
-int qlogicfas408_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
+int qlogicfas408_queuecommand(struct scsi_cmnd *cmd,
+                             void (*done) (struct scsi_cmnd *))
 {
        struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
        if (scmd_id(cmd) == priv->qinitid) {
@@ -470,9 +471,8 @@ int qlogicfas408_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
  *     Return bios parameters 
  */
 
-int qlogicfas408_biosparam(struct scsi_device * disk,
-                       struct block_device *dev,
-                       sector_t capacity, int ip[])
+int qlogicfas408_biosparam(struct scsi_device *disk, struct block_device *dev,
+                          sector_t capacity, int ip[])
 {
 /* This should mimic the DOS Qlogic driver's behavior exactly */
        ip[0] = 0x40;
@@ -494,7 +494,7 @@ int qlogicfas408_biosparam(struct scsi_device * disk,
  *     Abort a command in progress
  */
  
-int qlogicfas408_abort(Scsi_Cmnd * cmd)
+int qlogicfas408_abort(struct scsi_cmnd *cmd)
 {
        struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
        priv->qabort = 1;
@@ -508,7 +508,7 @@ int qlogicfas408_abort(Scsi_Cmnd * cmd)
  *     the PCMCIA qlogic_stub code. This wants fixing
  */
 
-int qlogicfas408_bus_reset(Scsi_Cmnd * cmd)
+int qlogicfas408_bus_reset(struct scsi_cmnd *cmd)
 {
        struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
        unsigned long flags;
index 8fd5555c75b11acb95e3ffc9cf51b88abc13cf55..260626427a328f21ba57c40f86f05003e0b50ea2 100644 (file)
 /*----------------------------------------------------------------*/
 
 struct qlogicfas408_priv {
-        int            qbase;          /* Port */
-        int            qinitid;        /* initiator ID */
-        int            qabort;         /* Flag to cause an abort */
-        int            qlirq;          /* IRQ being used */
-        int            int_type;       /* type of irq, 2 for ISA board, 0 for PCMCIA */
-        char           qinfo[80];      /* description */
-        Scsi_Cmnd      *qlcmd;         /* current command being processed */
-        struct Scsi_Host *shost;       /* pointer back to host */
-        struct qlogicfas408_priv *next; /* next private struct */
+       int qbase;              /* Port */
+       int qinitid;            /* initiator ID */
+       int qabort;             /* Flag to cause an abort */
+       int qlirq;              /* IRQ being used */
+       int int_type;           /* type of irq, 2 for ISA board, 0 for PCMCIA */
+       char qinfo[80];         /* description */
+       struct scsi_cmnd *qlcmd;        /* current command being processed */
+       struct Scsi_Host *shost;        /* pointer back to host */
+       struct qlogicfas408_priv *next; /* next private struct */
 };
 
 /* The qlogic card uses two register maps - These macros select which one */
@@ -103,12 +103,13 @@ struct qlogicfas408_priv {
 #define get_priv_by_host(x) (struct qlogicfas408_priv *)&((x)->hostdata[0])
 
 irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id);
-int qlogicfas408_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *));
+int qlogicfas408_queuecommand(struct scsi_cmnd * cmd,
+                             void (*done) (struct scsi_cmnd *));
 int qlogicfas408_biosparam(struct scsi_device * disk,
-                       struct block_device *dev,
-                       sector_t capacity, int ip[]);
-int qlogicfas408_abort(Scsi_Cmnd * cmd);
-int qlogicfas408_bus_reset(Scsi_Cmnd * cmd);
+                          struct block_device *dev,
+                          sector_t capacity, int ip[]);
+int qlogicfas408_abort(struct scsi_cmnd * cmd);
+int qlogicfas408_bus_reset(struct scsi_cmnd * cmd);
 const char *qlogicfas408_info(struct Scsi_Host *host);
 int qlogicfas408_get_chip_type(int qbase, int int_type);
 void qlogicfas408_setup(int qbase, int id, int int_type);
index 9c0f35820e3e3a3c5ca797ee4c57752b22f3ba79..30ee3d72c02151f0b56ca9b69b9c7d10aff7bbff 100644 (file)
@@ -52,7 +52,7 @@
 #include "scsi_debug.h"
 
 #define SCSI_DEBUG_VERSION "1.80"
-static const char * scsi_debug_version_date = "20060914";
+static const char * scsi_debug_version_date = "20061018";
 
 /* Additional Sense Code (ASC) used */
 #define NO_ADDITIONAL_SENSE 0x0
@@ -254,6 +254,8 @@ static int resp_requests(struct scsi_cmnd * SCpnt,
                         struct sdebug_dev_info * devip);
 static int resp_start_stop(struct scsi_cmnd * scp,
                           struct sdebug_dev_info * devip);
+static int resp_report_tgtpgs(struct scsi_cmnd * scp,
+                             struct sdebug_dev_info * devip);
 static int resp_readcap(struct scsi_cmnd * SCpnt,
                        struct sdebug_dev_info * devip);
 static int resp_readcap16(struct scsi_cmnd * SCpnt,
@@ -287,9 +289,9 @@ static void __init sdebug_build_parts(unsigned char * ramp);
 static void __init init_all_queued(void);
 static void stop_all_queued(void);
 static int stop_queued_cmnd(struct scsi_cmnd * cmnd);
-static int inquiry_evpd_83(unsigned char * arr, int target_dev_id,
-                          int dev_id_num, const char * dev_id_str,
-                          int dev_id_str_len);
+static int inquiry_evpd_83(unsigned char * arr, int port_group_id,
+                          int target_dev_id, int dev_id_num,
+                          const char * dev_id_str, int dev_id_str_len);
 static int inquiry_evpd_88(unsigned char * arr, int target_dev_id);
 static int do_create_driverfs_files(void);
 static void do_remove_driverfs_files(void);
@@ -422,6 +424,15 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done)
                }
                errsts = resp_readcap16(SCpnt, devip);
                break;
+       case MAINTENANCE_IN:
+               if (MI_REPORT_TARGET_PGS != cmd[1]) {
+                       mk_sense_buffer(devip, ILLEGAL_REQUEST,
+                                       INVALID_OPCODE, 0);
+                       errsts = check_condition_result;
+                       break;
+               }
+               errsts = resp_report_tgtpgs(SCpnt, devip);
+               break;
        case READ_16:
        case READ_12:
        case READ_10:
@@ -665,8 +676,9 @@ static const char * inq_vendor_id = "Linux   ";
 static const char * inq_product_id = "scsi_debug      ";
 static const char * inq_product_rev = "0004";
 
-static int inquiry_evpd_83(unsigned char * arr, int target_dev_id,
-                          int dev_id_num, const char * dev_id_str,
+static int inquiry_evpd_83(unsigned char * arr, int port_group_id,
+                          int target_dev_id, int dev_id_num,
+                          const char * dev_id_str,
                           int dev_id_str_len)
 {
        int num, port_a;
@@ -720,6 +732,15 @@ static int inquiry_evpd_83(unsigned char * arr, int target_dev_id,
        arr[num++] = (port_a >> 16) & 0xff;
        arr[num++] = (port_a >> 8) & 0xff;
        arr[num++] = port_a & 0xff;
+       /* NAA-5, Target port group identifier */
+       arr[num++] = 0x61;      /* proto=sas, binary */
+       arr[num++] = 0x95;      /* piv=1, target port group id */
+       arr[num++] = 0x0;
+       arr[num++] = 0x4;
+       arr[num++] = 0;
+       arr[num++] = 0;
+       arr[num++] = (port_group_id >> 8) & 0xff;
+       arr[num++] = port_group_id & 0xff;
        /* NAA-5, Target device identifier */
        arr[num++] = 0x61;      /* proto=sas, binary */
        arr[num++] = 0xa3;      /* piv=1, target device, naa */
@@ -928,12 +949,12 @@ static int resp_inquiry(struct scsi_cmnd * scp, int target,
                        struct sdebug_dev_info * devip)
 {
        unsigned char pq_pdt;
-       unsigned char arr[SDEBUG_MAX_INQ_ARR_SZ];
+       unsigned char * arr;
        unsigned char *cmd = (unsigned char *)scp->cmnd;
-       int alloc_len, n;
+       int alloc_len, n, ret;
 
        alloc_len = (cmd[3] << 8) + cmd[4];
-       memset(arr, 0, SDEBUG_MAX_INQ_ARR_SZ);
+       arr = kzalloc(SDEBUG_MAX_INQ_ARR_SZ, GFP_KERNEL);
        if (devip->wlun)
                pq_pdt = 0x1e;  /* present, wlun */
        else if (scsi_debug_no_lun_0 && (0 == devip->lun))
@@ -944,12 +965,15 @@ static int resp_inquiry(struct scsi_cmnd * scp, int target,
        if (0x2 & cmd[1]) {  /* CMDDT bit set */
                mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB,
                                0);
+               kfree(arr);
                return check_condition_result;
        } else if (0x1 & cmd[1]) {  /* EVPD bit set */
-               int lu_id_num, target_dev_id, len;
+               int lu_id_num, port_group_id, target_dev_id, len;
                char lu_id_str[6];
                int host_no = devip->sdbg_host->shost->host_no;
                
+               port_group_id = (((host_no + 1) & 0x7f) << 8) +
+                   (devip->channel & 0x7f);
                if (0 == scsi_debug_vpd_use_hostno)
                        host_no = 0;
                lu_id_num = devip->wlun ? -1 : (((host_no + 1) * 2000) +
@@ -977,8 +1001,9 @@ static int resp_inquiry(struct scsi_cmnd * scp, int target,
                        memcpy(&arr[4], lu_id_str, len);
                } else if (0x83 == cmd[2]) { /* device identification */
                        arr[1] = cmd[2];        /*sanity */
-                       arr[3] = inquiry_evpd_83(&arr[4], target_dev_id,
-                                                lu_id_num, lu_id_str, len);
+                       arr[3] = inquiry_evpd_83(&arr[4], port_group_id,
+                                                target_dev_id, lu_id_num,
+                                                lu_id_str, len);
                } else if (0x84 == cmd[2]) { /* Software interface ident. */
                        arr[1] = cmd[2];        /*sanity */
                        arr[3] = inquiry_evpd_84(&arr[4]);
@@ -1012,17 +1037,22 @@ static int resp_inquiry(struct scsi_cmnd * scp, int target,
                        /* Illegal request, invalid field in cdb */
                        mk_sense_buffer(devip, ILLEGAL_REQUEST,
                                        INVALID_FIELD_IN_CDB, 0);
+                       kfree(arr);
                        return check_condition_result;
                }
                len = min(((arr[2] << 8) + arr[3]) + 4, alloc_len);
-               return fill_from_dev_buffer(scp, arr,
+               ret = fill_from_dev_buffer(scp, arr,
                            min(len, SDEBUG_MAX_INQ_ARR_SZ));
+               kfree(arr);
+               return ret;
        }
        /* drops through here for a standard inquiry */
        arr[1] = DEV_REMOVEABLE(target) ? 0x80 : 0;     /* Removable disk */
        arr[2] = scsi_debug_scsi_level;
        arr[3] = 2;    /* response_data_format==2 */
        arr[4] = SDEBUG_LONG_INQ_SZ - 5;
+       if (0 == scsi_debug_vpd_use_hostno)
+               arr[5] = 0x10; /* claim: implicit TGPS */
        arr[6] = 0x10; /* claim: MultiP */
        /* arr[6] |= 0x40; ... claim: EncServ (enclosure services) */
        arr[7] = 0xa; /* claim: LINKED + CMDQUE */
@@ -1039,8 +1069,10 @@ static int resp_inquiry(struct scsi_cmnd * scp, int target,
                arr[n++] = 0x3; arr[n++] = 0x60; /* SSC-2 no version */
        }
        arr[n++] = 0xc; arr[n++] = 0xf;  /* SAS-1.1 rev 10 */
-       return fill_from_dev_buffer(scp, arr,
+       ret = fill_from_dev_buffer(scp, arr,
                            min(alloc_len, SDEBUG_LONG_INQ_SZ));
+       kfree(arr);
+       return ret;
 }
 
 static int resp_requests(struct scsi_cmnd * scp,
@@ -1171,6 +1203,87 @@ static int resp_readcap16(struct scsi_cmnd * scp,
                                    min(alloc_len, SDEBUG_READCAP16_ARR_SZ));
 }
 
+#define SDEBUG_MAX_TGTPGS_ARR_SZ 1412
+
+static int resp_report_tgtpgs(struct scsi_cmnd * scp,
+                             struct sdebug_dev_info * devip)
+{
+       unsigned char *cmd = (unsigned char *)scp->cmnd;
+       unsigned char * arr;
+       int host_no = devip->sdbg_host->shost->host_no;
+       int n, ret, alen, rlen;
+       int port_group_a, port_group_b, port_a, port_b;
+
+       alen = ((cmd[6] << 24) + (cmd[7] << 16) + (cmd[8] << 8)
+               + cmd[9]);
+
+       arr = kzalloc(SDEBUG_MAX_TGTPGS_ARR_SZ, GFP_KERNEL);
+       /*
+        * EVPD page 0x88 states we have two ports, one
+        * real and a fake port with no device connected.
+        * So we create two port groups with one port each
+        * and set the group with port B to unavailable.
+        */
+       port_a = 0x1; /* relative port A */
+       port_b = 0x2; /* relative port B */
+       port_group_a = (((host_no + 1) & 0x7f) << 8) +
+           (devip->channel & 0x7f);
+       port_group_b = (((host_no + 1) & 0x7f) << 8) +
+           (devip->channel & 0x7f) + 0x80;
+
+       /*
+        * The asymmetric access state is cycled according to the host_id.
+        */
+       n = 4;
+       if (0 == scsi_debug_vpd_use_hostno) {
+           arr[n++] = host_no % 3; /* Asymm access state */
+           arr[n++] = 0x0F; /* claim: all states are supported */
+       } else {
+           arr[n++] = 0x0; /* Active/Optimized path */
+           arr[n++] = 0x01; /* claim: only support active/optimized paths */
+       }
+       arr[n++] = (port_group_a >> 8) & 0xff;
+       arr[n++] = port_group_a & 0xff;
+       arr[n++] = 0;    /* Reserved */
+       arr[n++] = 0;    /* Status code */
+       arr[n++] = 0;    /* Vendor unique */
+       arr[n++] = 0x1;  /* One port per group */
+       arr[n++] = 0;    /* Reserved */
+       arr[n++] = 0;    /* Reserved */
+       arr[n++] = (port_a >> 8) & 0xff;
+       arr[n++] = port_a & 0xff;
+       arr[n++] = 3;    /* Port unavailable */
+       arr[n++] = 0x08; /* claim: only unavailalbe paths are supported */
+       arr[n++] = (port_group_b >> 8) & 0xff;
+       arr[n++] = port_group_b & 0xff;
+       arr[n++] = 0;    /* Reserved */
+       arr[n++] = 0;    /* Status code */
+       arr[n++] = 0;    /* Vendor unique */
+       arr[n++] = 0x1;  /* One port per group */
+       arr[n++] = 0;    /* Reserved */
+       arr[n++] = 0;    /* Reserved */
+       arr[n++] = (port_b >> 8) & 0xff;
+       arr[n++] = port_b & 0xff;
+
+       rlen = n - 4;
+       arr[0] = (rlen >> 24) & 0xff;
+       arr[1] = (rlen >> 16) & 0xff;
+       arr[2] = (rlen >> 8) & 0xff;
+       arr[3] = rlen & 0xff;
+
+       /*
+        * Return the smallest value of either
+        * - The allocated length
+        * - The constructed command length
+        * - The maximum array size
+        */
+       rlen = min(alen,n);
+       ret = fill_from_dev_buffer(scp, arr,
+                                  min(rlen, SDEBUG_MAX_TGTPGS_ARR_SZ));
+       kfree(arr);
+       return ret;
+}
+
 /* <<Following mode page info copied from ST318451LW>> */
 
 static int resp_err_recov_pg(unsigned char * p, int pcontrol, int target)
index 743f67ed76400e1433d8f4bbd00d2bf91bd8fbca..d2c02df12fdcb8b6b072a7a7e57500b21263a3d6 100644 (file)
@@ -1084,7 +1084,7 @@ static void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd)
 {
        struct request *req = cmd->request;
 
-       BUG_ON(sizeof(req->cmd) > sizeof(cmd->cmnd));
+       BUILD_BUG_ON(sizeof(req->cmd) > sizeof(cmd->cmnd));
        memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd));
        cmd->cmd_len = req->cmd_len;
        if (!req->data_len)
index e7fe565b96de93ffb5354d4c86d36dfd46410806..e1a91665d1c2ac9e00698073b7aea186953e0fd9 100644 (file)
@@ -192,6 +192,7 @@ static CLASS_DEVICE_ATTR(state, S_IRUGO | S_IWUSR, show_shost_state, store_shost
 shost_rd_attr(unique_id, "%u\n");
 shost_rd_attr(host_busy, "%hu\n");
 shost_rd_attr(cmd_per_lun, "%hd\n");
+shost_rd_attr(can_queue, "%hd\n");
 shost_rd_attr(sg_tablesize, "%hu\n");
 shost_rd_attr(unchecked_isa_dma, "%d\n");
 shost_rd_attr2(proc_name, hostt->proc_name, "%s\n");
@@ -200,6 +201,7 @@ static struct class_device_attribute *scsi_sysfs_shost_attrs[] = {
        &class_device_attr_unique_id,
        &class_device_attr_host_busy,
        &class_device_attr_cmd_per_lun,
+       &class_device_attr_can_queue,
        &class_device_attr_sg_tablesize,
        &class_device_attr_unchecked_isa_dma,
        &class_device_attr_proc_name,
index 7b0019cccce331ddc15ecf6dd72d2f7f67a47a48..2d3baa99ca25d2352332945044e83c88ad477b10 100644 (file)
@@ -21,7 +21,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 #include <linux/module.h>
-#include <linux/mempool.h>
 #include <linux/mutex.h>
 #include <net/tcp.h>
 #include <scsi/scsi.h>
@@ -149,30 +148,6 @@ static DECLARE_TRANSPORT_CLASS(iscsi_connection_class,
 static struct sock *nls;
 static DEFINE_MUTEX(rx_queue_mutex);
 
-struct mempool_zone {
-       mempool_t *pool;
-       atomic_t allocated;
-       int size;
-       int hiwat;
-       struct list_head freequeue;
-       spinlock_t freelock;
-};
-
-static struct mempool_zone *z_reply;
-
-/*
- * Z_MAX_* - actual mempool size allocated at the mempool_zone_init() time
- * Z_HIWAT_* - zone's high watermark when if_error bit will be set to -ENOMEM
- *             so daemon will notice OOM on NETLINK tranposrt level and will
- *             be able to predict or change operational behavior
- */
-#define Z_MAX_REPLY    8
-#define Z_HIWAT_REPLY  6
-#define Z_MAX_PDU      8
-#define Z_HIWAT_PDU    6
-#define Z_MAX_ERROR    16
-#define Z_HIWAT_ERROR  12
-
 static LIST_HEAD(sesslist);
 static DEFINE_SPINLOCK(sesslock);
 static LIST_HEAD(connlist);
@@ -414,59 +389,11 @@ int iscsi_destroy_session(struct iscsi_cls_session *session)
 }
 EXPORT_SYMBOL_GPL(iscsi_destroy_session);
 
-static void mempool_zone_destroy(struct mempool_zone *zp)
-{
-       mempool_destroy(zp->pool);
-       kfree(zp);
-}
-
-static void*
-mempool_zone_alloc_skb(gfp_t gfp_mask, void *pool_data)
-{
-       struct mempool_zone *zone = pool_data;
-
-       return alloc_skb(zone->size, gfp_mask);
-}
-
-static void
-mempool_zone_free_skb(void *element, void *pool_data)
-{
-       kfree_skb(element);
-}
-
-static struct mempool_zone *
-mempool_zone_init(unsigned max, unsigned size, unsigned hiwat)
-{
-       struct mempool_zone *zp;
-
-       zp = kzalloc(sizeof(*zp), GFP_KERNEL);
-       if (!zp)
-               return NULL;
-
-       zp->size = size;
-       zp->hiwat = hiwat;
-       INIT_LIST_HEAD(&zp->freequeue);
-       spin_lock_init(&zp->freelock);
-       atomic_set(&zp->allocated, 0);
-
-       zp->pool = mempool_create(max, mempool_zone_alloc_skb,
-                                 mempool_zone_free_skb, zp);
-       if (!zp->pool) {
-               kfree(zp);
-               return NULL;
-       }
-
-       return zp;
-}
-
 static void iscsi_conn_release(struct device *dev)
 {
        struct iscsi_cls_conn *conn = iscsi_dev_to_conn(dev);
        struct device *parent = conn->dev.parent;
 
-       mempool_zone_destroy(conn->z_pdu);
-       mempool_zone_destroy(conn->z_error);
-
        kfree(conn);
        put_device(parent);
 }
@@ -476,31 +403,6 @@ static int iscsi_is_conn_dev(const struct device *dev)
        return dev->release == iscsi_conn_release;
 }
 
-static int iscsi_create_event_pools(struct iscsi_cls_conn *conn)
-{
-       conn->z_pdu = mempool_zone_init(Z_MAX_PDU,
-                       NLMSG_SPACE(sizeof(struct iscsi_uevent) +
-                                   sizeof(struct iscsi_hdr) +
-                                   DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH),
-                       Z_HIWAT_PDU);
-       if (!conn->z_pdu) {
-               dev_printk(KERN_ERR, &conn->dev, "iscsi: can not allocate "
-                          "pdu zone for new conn\n");
-               return -ENOMEM;
-       }
-
-       conn->z_error = mempool_zone_init(Z_MAX_ERROR,
-                       NLMSG_SPACE(sizeof(struct iscsi_uevent)),
-                       Z_HIWAT_ERROR);
-       if (!conn->z_error) {
-               dev_printk(KERN_ERR, &conn->dev, "iscsi: can not allocate "
-                          "error zone for new conn\n");
-               mempool_zone_destroy(conn->z_pdu);
-               return -ENOMEM;
-       }
-       return 0;
-}
-
 /**
  * iscsi_create_conn - create iscsi class connection
  * @session: iscsi cls session
@@ -533,12 +435,9 @@ iscsi_create_conn(struct iscsi_cls_session *session, uint32_t cid)
        conn->transport = transport;
        conn->cid = cid;
 
-       if (iscsi_create_event_pools(conn))
-               goto free_conn;
-
        /* this is released in the dev's release function */
        if (!get_device(&session->dev))
-               goto free_conn_pools;
+               goto free_conn;
 
        snprintf(conn->dev.bus_id, BUS_ID_SIZE, "connection%d:%u",
                 session->sid, cid);
@@ -555,8 +454,6 @@ iscsi_create_conn(struct iscsi_cls_session *session, uint32_t cid)
 
 release_parent_ref:
        put_device(&session->dev);
-free_conn_pools:
-
 free_conn:
        kfree(conn);
        return NULL;
@@ -599,81 +496,31 @@ iscsi_if_transport_lookup(struct iscsi_transport *tt)
        return NULL;
 }
 
-static inline struct list_head *skb_to_lh(struct sk_buff *skb)
-{
-       return (struct list_head *)&skb->cb;
-}
-
-static void
-mempool_zone_complete(struct mempool_zone *zone)
-{
-       unsigned long flags;
-       struct list_head *lh, *n;
-
-       spin_lock_irqsave(&zone->freelock, flags);
-       list_for_each_safe(lh, n, &zone->freequeue) {
-               struct sk_buff *skb = (struct sk_buff *)((char *)lh -
-                               offsetof(struct sk_buff, cb));
-               if (!skb_shared(skb)) {
-                       list_del(skb_to_lh(skb));
-                       mempool_free(skb, zone->pool);
-                       atomic_dec(&zone->allocated);
-               }
-       }
-       spin_unlock_irqrestore(&zone->freelock, flags);
-}
-
-static struct sk_buff*
-mempool_zone_get_skb(struct mempool_zone *zone)
-{
-       struct sk_buff *skb;
-
-       skb = mempool_alloc(zone->pool, GFP_ATOMIC);
-       if (skb)
-               atomic_inc(&zone->allocated);
-       return skb;
-}
-
 static int
-iscsi_broadcast_skb(struct mempool_zone *zone, struct sk_buff *skb, gfp_t gfp)
+iscsi_broadcast_skb(struct sk_buff *skb, gfp_t gfp)
 {
-       unsigned long flags;
        int rc;
 
-       skb_get(skb);
        rc = netlink_broadcast(nls, skb, 0, 1, gfp);
        if (rc < 0) {
-               mempool_free(skb, zone->pool);
                printk(KERN_ERR "iscsi: can not broadcast skb (%d)\n", rc);
                return rc;
        }
 
-       spin_lock_irqsave(&zone->freelock, flags);
-       INIT_LIST_HEAD(skb_to_lh(skb));
-       list_add(skb_to_lh(skb), &zone->freequeue);
-       spin_unlock_irqrestore(&zone->freelock, flags);
        return 0;
 }
 
 static int
-iscsi_unicast_skb(struct mempool_zone *zone, struct sk_buff *skb, int pid)
+iscsi_unicast_skb(struct sk_buff *skb, int pid)
 {
-       unsigned long flags;
        int rc;
 
-       skb_get(skb);
        rc = netlink_unicast(nls, skb, pid, MSG_DONTWAIT);
        if (rc < 0) {
-               mempool_free(skb, zone->pool);
                printk(KERN_ERR "iscsi: can not unicast skb (%d)\n", rc);
                return rc;
        }
 
-       spin_lock_irqsave(&zone->freelock, flags);
-       INIT_LIST_HEAD(skb_to_lh(skb));
-       list_add(skb_to_lh(skb), &zone->freequeue);
-       spin_unlock_irqrestore(&zone->freelock, flags);
-
        return 0;
 }
 
@@ -692,9 +539,7 @@ int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
        if (!priv)
                return -EINVAL;
 
-       mempool_zone_complete(conn->z_pdu);
-
-       skb = mempool_zone_get_skb(conn->z_pdu);
+       skb = alloc_skb(len, GFP_ATOMIC);
        if (!skb) {
                iscsi_conn_error(conn, ISCSI_ERR_CONN_FAILED);
                dev_printk(KERN_ERR, &conn->dev, "iscsi: can not deliver "
@@ -707,15 +552,13 @@ int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
        memset(ev, 0, sizeof(*ev));
        ev->transport_handle = iscsi_handle(conn->transport);
        ev->type = ISCSI_KEVENT_RECV_PDU;
-       if (atomic_read(&conn->z_pdu->allocated) >= conn->z_pdu->hiwat)
-               ev->iferror = -ENOMEM;
        ev->r.recv_req.cid = conn->cid;
        ev->r.recv_req.sid = iscsi_conn_get_sid(conn);
        pdu = (char*)ev + sizeof(*ev);
        memcpy(pdu, hdr, sizeof(struct iscsi_hdr));
        memcpy(pdu + sizeof(struct iscsi_hdr), data, data_size);
 
-       return iscsi_unicast_skb(conn->z_pdu, skb, priv->daemon_pid);
+       return iscsi_unicast_skb(skb, priv->daemon_pid);
 }
 EXPORT_SYMBOL_GPL(iscsi_recv_pdu);
 
@@ -731,9 +574,7 @@ void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error)
        if (!priv)
                return;
 
-       mempool_zone_complete(conn->z_error);
-
-       skb = mempool_zone_get_skb(conn->z_error);
+       skb = alloc_skb(len, GFP_ATOMIC);
        if (!skb) {
                dev_printk(KERN_ERR, &conn->dev, "iscsi: gracefully ignored "
                          "conn error (%d)\n", error);
@@ -744,13 +585,11 @@ void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error)
        ev = NLMSG_DATA(nlh);
        ev->transport_handle = iscsi_handle(conn->transport);
        ev->type = ISCSI_KEVENT_CONN_ERROR;
-       if (atomic_read(&conn->z_error->allocated) >= conn->z_error->hiwat)
-               ev->iferror = -ENOMEM;
        ev->r.connerror.error = error;
        ev->r.connerror.cid = conn->cid;
        ev->r.connerror.sid = iscsi_conn_get_sid(conn);
 
-       iscsi_broadcast_skb(conn->z_error, skb, GFP_ATOMIC);
+       iscsi_broadcast_skb(skb, GFP_ATOMIC);
 
        dev_printk(KERN_INFO, &conn->dev, "iscsi: detected conn error (%d)\n",
                   error);
@@ -767,9 +606,7 @@ iscsi_if_send_reply(int pid, int seq, int type, int done, int multi,
        int flags = multi ? NLM_F_MULTI : 0;
        int t = done ? NLMSG_DONE : type;
 
-       mempool_zone_complete(z_reply);
-
-       skb = mempool_zone_get_skb(z_reply);
+       skb = alloc_skb(len, GFP_ATOMIC);
        /*
         * FIXME:
         * user is supposed to react on iferror == -ENOMEM;
@@ -780,7 +617,7 @@ iscsi_if_send_reply(int pid, int seq, int type, int done, int multi,
        nlh = __nlmsg_put(skb, pid, seq, t, (len - sizeof(*nlh)), 0);
        nlh->nlmsg_flags = flags;
        memcpy(NLMSG_DATA(nlh), payload, size);
-       return iscsi_unicast_skb(z_reply, skb, pid);
+       return iscsi_unicast_skb(skb, pid);
 }
 
 static int
@@ -810,9 +647,7 @@ iscsi_if_get_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
        do {
                int actual_size;
 
-               mempool_zone_complete(conn->z_pdu);
-
-               skbstat = mempool_zone_get_skb(conn->z_pdu);
+               skbstat = alloc_skb(len, GFP_ATOMIC);
                if (!skbstat) {
                        dev_printk(KERN_ERR, &conn->dev, "iscsi: can not "
                                   "deliver stats: OOM\n");
@@ -825,8 +660,6 @@ iscsi_if_get_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
                memset(evstat, 0, sizeof(*evstat));
                evstat->transport_handle = iscsi_handle(conn->transport);
                evstat->type = nlh->nlmsg_type;
-               if (atomic_read(&conn->z_pdu->allocated) >= conn->z_pdu->hiwat)
-                       evstat->iferror = -ENOMEM;
                evstat->u.get_stats.cid =
                        ev->u.get_stats.cid;
                evstat->u.get_stats.sid =
@@ -845,7 +678,7 @@ iscsi_if_get_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
                skb_trim(skbstat, NLMSG_ALIGN(actual_size));
                nlhstat->nlmsg_len = actual_size;
 
-               err = iscsi_unicast_skb(conn->z_pdu, skbstat, priv->daemon_pid);
+               err = iscsi_unicast_skb(skbstat, priv->daemon_pid);
        } while (err < 0 && err != -ECONNREFUSED);
 
        return err;
@@ -876,9 +709,7 @@ int iscsi_if_destroy_session_done(struct iscsi_cls_conn *conn)
        session = iscsi_dev_to_session(conn->dev.parent);
        shost = iscsi_session_to_shost(session);
 
-       mempool_zone_complete(conn->z_pdu);
-
-       skb = mempool_zone_get_skb(conn->z_pdu);
+       skb = alloc_skb(len, GFP_KERNEL);
        if (!skb) {
                dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of "
                          "session creation event\n");
@@ -896,7 +727,7 @@ int iscsi_if_destroy_session_done(struct iscsi_cls_conn *conn)
         * this will occur if the daemon is not up, so we just warn
         * the user and when the daemon is restarted it will handle it
         */
-       rc = iscsi_broadcast_skb(conn->z_pdu, skb, GFP_KERNEL);
+       rc = iscsi_broadcast_skb(skb, GFP_KERNEL);
        if (rc < 0)
                dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of "
                          "session destruction event. Check iscsi daemon\n");
@@ -939,9 +770,7 @@ int iscsi_if_create_session_done(struct iscsi_cls_conn *conn)
        session = iscsi_dev_to_session(conn->dev.parent);
        shost = iscsi_session_to_shost(session);
 
-       mempool_zone_complete(conn->z_pdu);
-
-       skb = mempool_zone_get_skb(conn->z_pdu);
+       skb = alloc_skb(len, GFP_KERNEL);
        if (!skb) {
                dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of "
                          "session creation event\n");
@@ -959,7 +788,7 @@ int iscsi_if_create_session_done(struct iscsi_cls_conn *conn)
         * this will occur if the daemon is not up, so we just warn
         * the user and when the daemon is restarted it will handle it
         */
-       rc = iscsi_broadcast_skb(conn->z_pdu, skb, GFP_KERNEL);
+       rc = iscsi_broadcast_skb(skb, GFP_KERNEL);
        if (rc < 0)
                dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of "
                          "session creation event. Check iscsi daemon\n");
@@ -1278,9 +1107,6 @@ iscsi_if_rx(struct sock *sk, int len)
                                err = iscsi_if_send_reply(
                                        NETLINK_CREDS(skb)->pid, nlh->nlmsg_seq,
                                        nlh->nlmsg_type, 0, 0, ev, sizeof(*ev));
-                               if (atomic_read(&z_reply->allocated) >=
-                                               z_reply->hiwat)
-                                       ev->iferror = -ENOMEM;
                        } while (err < 0 && err != -ECONNREFUSED);
                        skb_pull(skb, rlen);
                }
@@ -1584,32 +1410,6 @@ int iscsi_unregister_transport(struct iscsi_transport *tt)
 }
 EXPORT_SYMBOL_GPL(iscsi_unregister_transport);
 
-static int
-iscsi_rcv_nl_event(struct notifier_block *this, unsigned long event, void *ptr)
-{
-       struct netlink_notify *n = ptr;
-
-       if (event == NETLINK_URELEASE &&
-           n->protocol == NETLINK_ISCSI && n->pid) {
-               struct iscsi_cls_conn *conn;
-               unsigned long flags;
-
-               mempool_zone_complete(z_reply);
-               spin_lock_irqsave(&connlock, flags);
-               list_for_each_entry(conn, &connlist, conn_list) {
-                       mempool_zone_complete(conn->z_error);
-                       mempool_zone_complete(conn->z_pdu);
-               }
-               spin_unlock_irqrestore(&connlock, flags);
-       }
-
-       return NOTIFY_DONE;
-}
-
-static struct notifier_block iscsi_nl_notifier = {
-       .notifier_call  = iscsi_rcv_nl_event,
-};
-
 static __init int iscsi_transport_init(void)
 {
        int err;
@@ -1633,25 +1433,15 @@ static __init int iscsi_transport_init(void)
        if (err)
                goto unregister_conn_class;
 
-       err = netlink_register_notifier(&iscsi_nl_notifier);
-       if (err)
-               goto unregister_session_class;
-
        nls = netlink_kernel_create(NETLINK_ISCSI, 1, iscsi_if_rx,
                        THIS_MODULE);
        if (!nls) {
                err = -ENOBUFS;
-               goto unregister_notifier;
+               goto unregister_session_class;
        }
 
-       z_reply = mempool_zone_init(Z_MAX_REPLY,
-               NLMSG_SPACE(sizeof(struct iscsi_uevent)), Z_HIWAT_REPLY);
-       if (z_reply)
-               return 0;
+       return 0;
 
-       sock_release(nls->sk_socket);
-unregister_notifier:
-       netlink_unregister_notifier(&iscsi_nl_notifier);
 unregister_session_class:
        transport_class_unregister(&iscsi_session_class);
 unregister_conn_class:
@@ -1665,9 +1455,7 @@ unregister_transport_class:
 
 static void __exit iscsi_transport_exit(void)
 {
-       mempool_zone_destroy(z_reply);
        sock_release(nls->sk_socket);
-       netlink_unregister_notifier(&iscsi_nl_notifier);
        transport_class_unregister(&iscsi_connection_class);
        transport_class_unregister(&iscsi_session_class);
        transport_class_unregister(&iscsi_host_class);
index 3babdc76b3fb37f3e361243f8d5b7167a0d85f8b..e1a52c525ed492155a8243722e4387428198548b 100644 (file)
@@ -1177,7 +1177,10 @@ static int st_open(struct inode *inode, struct file *filp)
                goto err_out;
        if ((filp->f_flags & O_NONBLOCK) == 0 &&
            retval != CHKRES_READY) {
-               retval = (-EIO);
+               if (STp->ready == NO_TAPE)
+                       retval = (-ENOMEDIUM);
+               else
+                       retval = (-EIO);
                goto err_out;
        }
        return 0;
index 5ec5af8e337903c78a8277712d770d1b83b8e7b0..3b3f3050a877f0e221ee49fb649b45cc20b9acbc 100644 (file)
@@ -266,8 +266,8 @@ static struct scsi_host_template *the_template = NULL;
        (struct NCR5380_hostdata *)(in)->hostdata
 #define        HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
 
-#define        NEXT(cmd)       ((Scsi_Cmnd *)((cmd)->host_scribble))
-#define        NEXTADDR(cmd)   ((Scsi_Cmnd **)&((cmd)->host_scribble))
+#define        NEXT(cmd)       ((struct scsi_cmnd *)((cmd)->host_scribble))
+#define        NEXTADDR(cmd)   ((struct scsi_cmnd **)&((cmd)->host_scribble))
 
 #define        HOSTNO          instance->host_no
 #define        H_NO(cmd)       (cmd)->device->host->host_no
@@ -360,7 +360,7 @@ static void __init init_tags( void )
  * conditions.
  */ 
 
-static int is_lun_busy( Scsi_Cmnd *cmd, int should_be_tagged )
+static int is_lun_busy(struct scsi_cmnd *cmd, int should_be_tagged)
 {
     SETUP_HOSTDATA(cmd->device->host);
 
@@ -384,7 +384,7 @@ static int is_lun_busy( Scsi_Cmnd *cmd, int should_be_tagged )
  * untagged.
  */
 
-static void cmd_get_tag( Scsi_Cmnd *cmd, int should_be_tagged )
+static void cmd_get_tag(struct scsi_cmnd *cmd, int should_be_tagged)
 {
     SETUP_HOSTDATA(cmd->device->host);
 
@@ -416,7 +416,7 @@ static void cmd_get_tag( Scsi_Cmnd *cmd, int should_be_tagged )
  * unlock the LUN.
  */
 
-static void cmd_free_tag( Scsi_Cmnd *cmd )
+static void cmd_free_tag(struct scsi_cmnd *cmd)
 {
     SETUP_HOSTDATA(cmd->device->host);
 
@@ -460,18 +460,18 @@ static void free_all_tags( void )
 
 
 /*
- * Function: void merge_contiguous_buffers( Scsi_Cmnd *cmd )
+ * Function: void merge_contiguous_buffers(struct scsi_cmnd *cmd)
  *
  * Purpose: Try to merge several scatter-gather requests into one DMA
  *    transfer. This is possible if the scatter buffers lie on
  *    physical contiguous addresses.
  *
- * Parameters: Scsi_Cmnd *cmd
+ * Parameters: struct scsi_cmnd *cmd
  *    The command to work on. The first scatter buffer's data are
  *    assumed to be already transfered into ptr/this_residual.
  */
 
-static void merge_contiguous_buffers( Scsi_Cmnd *cmd )
+static void merge_contiguous_buffers(struct scsi_cmnd *cmd)
 {
     unsigned long endaddr;
 #if (NDEBUG & NDEBUG_MERGING)
@@ -501,15 +501,15 @@ static void merge_contiguous_buffers( Scsi_Cmnd *cmd )
 }
 
 /*
- * Function : void initialize_SCp(Scsi_Cmnd *cmd)
+ * Function : void initialize_SCp(struct scsi_cmnd *cmd)
  *
  * Purpose : initialize the saved data pointers for cmd to point to the 
  *     start of the buffer.
  *
- * Inputs : cmd - Scsi_Cmnd structure to have pointers reset.
+ * Inputs : cmd - struct scsi_cmnd structure to have pointers reset.
  */
 
-static __inline__ void initialize_SCp(Scsi_Cmnd *cmd)
+static __inline__ void initialize_SCp(struct scsi_cmnd *cmd)
 {
     /* 
      * Initialize the Scsi Pointer field so that all of the commands in the 
@@ -753,14 +753,15 @@ static void NCR5380_print_status (struct Scsi_Host *instance)
   do { if (pos + strlen(fmt) + 20 /* slop */ < buffer + length) \
         pos += sprintf(pos, fmt , ## args); } while(0)
 static
-char *lprint_Scsi_Cmnd (Scsi_Cmnd *cmd, char *pos, char *buffer, int length);
+char *lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, char *pos, char *buffer,
+                      int length);
 
-static int NCR5380_proc_info (struct Scsi_Host *instance, char *buffer, char **start,
-                      off_t offset, int length, int inout)
+static int NCR5380_proc_info(struct Scsi_Host *instance, char *buffer,
+                            char **start, off_t offset, int length, int inout)
 {
     char *pos = buffer;
     struct NCR5380_hostdata *hostdata;
-    Scsi_Cmnd *ptr;
+    struct scsi_cmnd *ptr;
     unsigned long flags;
     off_t begin = 0;
 #define check_offset()                         \
@@ -784,18 +785,19 @@ static int NCR5380_proc_info (struct Scsi_Host *instance, char *buffer, char **s
     if (!hostdata->connected)
        SPRINTF("scsi%d: no currently connected command\n", HOSTNO);
     else
-       pos = lprint_Scsi_Cmnd ((Scsi_Cmnd *) hostdata->connected,
+       pos = lprint_Scsi_Cmnd ((struct scsi_cmnd *) hostdata->connected,
                                pos, buffer, length);
     SPRINTF("scsi%d: issue_queue\n", HOSTNO);
     check_offset();
-    for (ptr = (Scsi_Cmnd *) hostdata->issue_queue; ptr; ptr = NEXT(ptr)) {
+    for (ptr = (struct scsi_cmnd *) hostdata->issue_queue; ptr; ptr = NEXT(ptr))
+    {
        pos = lprint_Scsi_Cmnd (ptr, pos, buffer, length);
        check_offset();
     }
 
     SPRINTF("scsi%d: disconnected_queue\n", HOSTNO);
     check_offset();
-    for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr;
+    for (ptr = (struct scsi_cmnd *) hostdata->disconnected_queue; ptr;
         ptr = NEXT(ptr)) {
        pos = lprint_Scsi_Cmnd (ptr, pos, buffer, length);
        check_offset();
@@ -810,8 +812,8 @@ static int NCR5380_proc_info (struct Scsi_Host *instance, char *buffer, char **s
     return length;
 }
 
-static char *
-lprint_Scsi_Cmnd (Scsi_Cmnd *cmd, char *pos, char *buffer, int length)
+static char *lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, char *pos, char *buffer,
+                             int length)
 {
     int i, s;
     unsigned char *command;
@@ -888,8 +890,8 @@ static int NCR5380_init (struct Scsi_Host *instance, int flags)
 }
 
 /* 
- * Function : int NCR5380_queue_command (Scsi_Cmnd *cmd, 
- *     void (*done)(Scsi_Cmnd *)) 
+ * Function : int NCR5380_queue_command (struct scsi_cmnd *cmd,
+ *     void (*done)(struct scsi_cmnd *))
  *
  * Purpose :  enqueues a SCSI command
  *
@@ -906,10 +908,11 @@ static int NCR5380_init (struct Scsi_Host *instance, int flags)
  */
 
 /* Only make static if a wrapper function is used */
-static int NCR5380_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
+static int NCR5380_queue_command(struct scsi_cmnd *cmd,
+                                void (*done)(struct scsi_cmnd *))
 {
     SETUP_HOSTDATA(cmd->device->host);
-    Scsi_Cmnd *tmp;
+    struct scsi_cmnd *tmp;
     unsigned long flags;
 
 #if (NDEBUG & NDEBUG_NO_WRITE)
@@ -990,7 +993,7 @@ static int NCR5380_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
        NEXT(cmd) = hostdata->issue_queue;
        hostdata->issue_queue = cmd;
     } else {
-       for (tmp = (Scsi_Cmnd *)hostdata->issue_queue;
+       for (tmp = (struct scsi_cmnd *)hostdata->issue_queue;
             NEXT(tmp); tmp = NEXT(tmp))
            ;
        LIST(cmd, tmp);
@@ -1030,7 +1033,7 @@ static int NCR5380_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
     
 static void NCR5380_main (void *bl)
 {
-    Scsi_Cmnd *tmp, *prev;
+    struct scsi_cmnd *tmp, *prev;
     struct Scsi_Host *instance = first_instance;
     struct NCR5380_hostdata *hostdata = HOSTDATA(instance);
     int done;
@@ -1073,12 +1076,12 @@ static void NCR5380_main (void *bl)
             * for a target that's not busy.
             */
 #if (NDEBUG & NDEBUG_LISTS)
-           for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, prev = NULL;
+           for (tmp = (struct scsi_cmnd *) hostdata->issue_queue, prev = NULL;
                 tmp && (tmp != prev); prev = tmp, tmp = NEXT(tmp))
                ;
            if ((tmp == prev) && tmp) printk(" LOOP\n");/* else printk("\n");*/
 #endif
-           for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, 
+           for (tmp = (struct scsi_cmnd *) hostdata->issue_queue,
                 prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp) ) {
 
 #if (NDEBUG & NDEBUG_LISTS)
@@ -1339,7 +1342,8 @@ static irqreturn_t NCR5380_intr (int irq, void *dev_id)
 }
 
 #ifdef NCR5380_STATS
-static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd* cmd)
+static void collect_stats(struct NCR5380_hostdata *hostdata,
+                         struct scsi_cmnd *cmd)
 {
 # ifdef NCR5380_STAT_LIMIT
     if (cmd->request_bufflen > NCR5380_STAT_LIMIT)
@@ -1365,8 +1369,8 @@ static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd* cmd)
 #endif
 
 /* 
- * Function : int NCR5380_select (struct Scsi_Host *instance, Scsi_Cmnd *cmd, 
- *     int tag);
+ * Function : int NCR5380_select(struct Scsi_Host *instance,
+ *                              struct scsi_cmnd *cmd, int tag);
  *
  * Purpose : establishes I_T_L or I_T_L_Q nexus for new or existing command,
  *     including ARBITRATION, SELECTION, and initial message out for 
@@ -1395,7 +1399,8 @@ static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd* cmd)
  *             cmd->result host byte set to DID_BAD_TARGET.
  */
 
-static int NCR5380_select (struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
+static int NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd,
+                         int tag)
 {
     SETUP_HOSTDATA(instance);
     unsigned char tmp[3], phase;
@@ -1985,7 +1990,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
 #endif
     unsigned char *data;
     unsigned char phase, tmp, extended_msg[10], old_phase=0xff;
-    Scsi_Cmnd *cmd = (Scsi_Cmnd *) hostdata->connected;
+    struct scsi_cmnd *cmd = (struct scsi_cmnd *) hostdata->connected;
 
 #ifdef SUN3_SCSI_VME
     dregs->csr |= CSR_INTR;
@@ -2272,7 +2277,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
                        local_irq_save(flags);
                        LIST(cmd,hostdata->issue_queue);
                        NEXT(cmd) = hostdata->issue_queue;
-                       hostdata->issue_queue = (Scsi_Cmnd *) cmd;
+                       hostdata->issue_queue = (struct scsi_cmnd *) cmd;
                        local_irq_restore(flags);
                        QU_PRINTK("scsi%d: REQUEST SENSE added to head of "
                                  "issue queue\n", H_NO(cmd));
@@ -2502,7 +2507,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
  * Function : void NCR5380_reselect (struct Scsi_Host *instance)
  *
  * Purpose : does reselection, initializing the instance->connected 
- *     field to point to the Scsi_Cmnd for which the I_T_L or I_T_L_Q 
+ *     field to point to the struct scsi_cmnd for which the I_T_L or I_T_L_Q
  *     nexus has been reestablished,
  *     
  * Inputs : instance - this instance of the NCR5380.
@@ -2521,7 +2526,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance)
     unsigned char tag;
 #endif
     unsigned char msg[3];
-    Scsi_Cmnd *tmp = NULL, *prev;
+    struct scsi_cmnd *tmp = NULL, *prev;
 /*    unsigned long flags; */
 
     /*
@@ -2577,7 +2582,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance)
      * just reestablished, and remove it from the disconnected queue.
      */
 
-    for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue, prev = NULL; 
+    for (tmp = (struct scsi_cmnd *) hostdata->disconnected_queue, prev = NULL;
         tmp; prev = tmp, tmp = NEXT(tmp) ) {
        if ((target_mask == (1 << tmp->device->id)) && (lun == tmp->device->lun)
 #ifdef SUPPORT_TAGS
@@ -2668,11 +2673,11 @@ static void NCR5380_reselect (struct Scsi_Host *instance)
 
 
 /*
- * Function : int NCR5380_abort (Scsi_Cmnd *cmd)
+ * Function : int NCR5380_abort(struct scsi_cmnd *cmd)
  *
  * Purpose : abort a command
  *
- * Inputs : cmd - the Scsi_Cmnd to abort, code - code to set the 
+ * Inputs : cmd - the struct scsi_cmnd to abort, code - code to set the
  *     host byte of the result field to, if zero DID_ABORTED is 
  *     used.
  *
@@ -2684,11 +2689,11 @@ static void NCR5380_reselect (struct Scsi_Host *instance)
  *      called where the loop started in NCR5380_main().
  */
 
-static int NCR5380_abort (Scsi_Cmnd *cmd)
+static int NCR5380_abort(struct scsi_cmnd *cmd)
 {
     struct Scsi_Host *instance = cmd->device->host;
     SETUP_HOSTDATA(instance);
-    Scsi_Cmnd *tmp, **prev;
+    struct scsi_cmnd *tmp, **prev;
     unsigned long flags;
 
     printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO);
@@ -2753,9 +2758,9 @@ static int NCR5380_abort (Scsi_Cmnd *cmd)
  * Case 2 : If the command hasn't been issued yet, we simply remove it 
  *         from the issue queue.
  */
-    for (prev = (Scsi_Cmnd **) &(hostdata->issue_queue), 
-       tmp = (Scsi_Cmnd *) hostdata->issue_queue;
-       tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp) )
+    for (prev = (struct scsi_cmnd **) &(hostdata->issue_queue),
+       tmp = (struct scsi_cmnd *) hostdata->issue_queue;
+       tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp))
        if (cmd == tmp) {
            REMOVE(5, *prev, tmp, NEXT(tmp));
            (*prev) = NEXT(tmp);
@@ -2812,7 +2817,7 @@ static int NCR5380_abort (Scsi_Cmnd *cmd)
  * it from the disconnected queue.
  */
 
-    for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp;
+    for (tmp = (struct scsi_cmnd *) hostdata->disconnected_queue; tmp;
         tmp = NEXT(tmp)) 
         if (cmd == tmp) {
             local_irq_restore(flags);
@@ -2826,8 +2831,8 @@ static int NCR5380_abort (Scsi_Cmnd *cmd)
            do_abort (instance);
 
            local_irq_save(flags);
-           for (prev = (Scsi_Cmnd **) &(hostdata->disconnected_queue), 
-               tmp = (Scsi_Cmnd *) hostdata->disconnected_queue;
+           for (prev = (struct scsi_cmnd **) &(hostdata->disconnected_queue),
+               tmp = (struct scsi_cmnd *) hostdata->disconnected_queue;
                tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp) )
                    if (cmd == tmp) {
                    REMOVE(5, *prev, tmp, NEXT(tmp));
@@ -2868,7 +2873,7 @@ static int NCR5380_abort (Scsi_Cmnd *cmd)
 
 
 /* 
- * Function : int NCR5380_bus_reset (Scsi_Cmnd *cmd)
+ * Function : int NCR5380_bus_reset(struct scsi_cmnd *cmd)
  * 
  * Purpose : reset the SCSI bus.
  *
@@ -2876,13 +2881,13 @@ static int NCR5380_abort (Scsi_Cmnd *cmd)
  *
  */ 
 
-static int NCR5380_bus_reset( Scsi_Cmnd *cmd)
+static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
 {
     SETUP_HOSTDATA(cmd->device->host);
     int           i;
     unsigned long flags;
 #if 1
-    Scsi_Cmnd *connected, *disconnected_queue;
+    struct scsi_cmnd *connected, *disconnected_queue;
 #endif
 
 
@@ -2914,9 +2919,9 @@ static int NCR5380_bus_reset( Scsi_Cmnd *cmd)
      * remembered in local variables first.
      */
     local_irq_save(flags);
-    connected = (Scsi_Cmnd *)hostdata->connected;
+    connected = (struct scsi_cmnd *)hostdata->connected;
     hostdata->connected = NULL;
-    disconnected_queue = (Scsi_Cmnd *)hostdata->disconnected_queue;
+    disconnected_queue = (struct scsi_cmnd *)hostdata->disconnected_queue;
     hostdata->disconnected_queue = NULL;
 #ifdef SUPPORT_TAGS
     free_all_tags();
index e625b4c5833adda4a422735e1f3046acc10274bb..d56d85dd9ba0ed60c943e8bd99956a22c06418ca 100644 (file)
@@ -119,7 +119,7 @@ module_param(setup_use_tagged_queuing, int, 0);
 static int setup_hostid = -1;
 module_param(setup_hostid, int, 0);
 
-static Scsi_Cmnd *sun3_dma_setup_done = NULL;
+static struct scsi_cmnd *sun3_dma_setup_done = NULL;
 
 #define        AFTER_RESET_DELAY       (HZ/2)
 
@@ -521,8 +521,9 @@ static inline unsigned long sun3scsi_dma_residual(struct Scsi_Host *instance)
        return last_residual;
 }
 
-static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted, Scsi_Cmnd *cmd,
-                                   int write_flag)
+static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted,
+                                                 struct scsi_cmnd *cmd,
+                                                 int write_flag)
 {
        if(blk_fs_request(cmd->request))
                return wanted;
index 834dab4280199c3a719ca6f23cd240378f0ea134..a1103b3e2034444769b608ad95ff7683e7978c5b 100644 (file)
 
 #define IOBASE_SUN3_VMESCSI 0xff200000
 
-static int sun3scsi_abort (Scsi_Cmnd *);
+static int sun3scsi_abort(struct scsi_cmnd *);
 static int sun3scsi_detect (struct scsi_host_template *);
 static const char *sun3scsi_info (struct Scsi_Host *);
-static int sun3scsi_bus_reset(Scsi_Cmnd *);
-static int sun3scsi_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
+static int sun3scsi_bus_reset(struct scsi_cmnd *);
+static int sun3scsi_queue_command(struct scsi_cmnd *,
+                                 void (*done)(struct scsi_cmnd *));
 static int sun3scsi_release (struct Scsi_Host *);
 
 #ifndef CMD_PER_LUN
index e8faab16567b69b9a0f58eb79adc014b67b33d28..92def310a84c05eeaf3a317c99468799fc65bb17 100644 (file)
@@ -84,7 +84,7 @@ module_param(setup_use_tagged_queuing, int, 0);
 static int setup_hostid = -1;
 module_param(setup_hostid, int, 0);
 
-static Scsi_Cmnd *sun3_dma_setup_done = NULL;
+static struct scsi_cmnd *sun3_dma_setup_done = NULL;
 
 #define        AFTER_RESET_DELAY       (HZ/2)
 
@@ -455,8 +455,9 @@ static inline unsigned long sun3scsi_dma_residual(struct Scsi_Host *instance)
        return last_residual;
 }
 
-static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted, Scsi_Cmnd *cmd,
-                                   int write_flag)
+static inline unsigned long sun3scsi_dma_xfer_len(unsigned long wanted,
+                                                 struct scsi_cmnd *cmd,
+                                                 int write_flag)
 {
        if(blk_fs_request(cmd->request))
                return wanted;
index d03aa6ce8fe8afef715018917d257daad01b31ab..fa5382e354be71edcd50437386d446979283283b 100644 (file)
@@ -2304,6 +2304,7 @@ static struct scsi_host_template driver_template = {
        .sg_tablesize           = SG_ALL,
        .cmd_per_lun            = 1,
        .use_clustering         = ENABLE_CLUSTERING,
+       .max_sectors            = 0x4000, /* 8MiB = 16 * 1024 * 512 */
 };
 
 /***********************************************************************
index 2ebbfd95145fd34587cbd715b2d59048c283abfb..d07ecb53c68b85bad48b7f8fd243105857a5fec9 100644 (file)
@@ -111,7 +111,7 @@ static struct backlight_properties corgibl_data = {
        .update_status  = corgibl_set_intensity,
 };
 
-static int __init corgibl_probe(struct platform_device *pdev)
+static int corgibl_probe(struct platform_device *pdev)
 {
        struct corgibl_machinfo *machinfo = pdev->dev.platform_data;
 
@@ -166,4 +166,4 @@ module_exit(corgibl_exit);
 
 MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>");
 MODULE_DESCRIPTION("Corgi Backlight Driver");
-MODULE_LICENSE("GPLv2");
+MODULE_LICENSE("GPL");
index 3afb472763c0488fddcd1dd5a4c0e3bb5817c1f8..3dc49424dc75b43e6cc5d2860c5c258011d3162a 100644 (file)
@@ -29,7 +29,6 @@
 #include <asm/io.h>
 #include <asm/hd64461.h>
 #include <asm/cpu/dac.h>
-#include <asm/hp6xx/hp6xx.h>
 
 #define        WIDTH 640
 
index eeeeff9a09eb6180709773d4e99dddb4549437d8..a95836839e1e965d29739662a1e7ca95a70edef0 100644 (file)
@@ -161,7 +161,7 @@ intelfbhw_get_memory(struct pci_dev *pdev, int *aperture_size,
                return 1;
 
        /* Find the bridge device.  It is always 0:0.0 */
-       if (!(bridge_dev = pci_find_slot(0, PCI_DEVFN(0, 0)))) {
+       if (!(bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)))) {
                ERR_MSG("cannot find bridge device\n");
                return 1;
        }
@@ -169,6 +169,8 @@ intelfbhw_get_memory(struct pci_dev *pdev, int *aperture_size,
        /* Get the fb aperture size and "stolen" memory amount. */
        tmp = 0;
        pci_read_config_word(bridge_dev, INTEL_GMCH_CTRL, &tmp);
+       pci_dev_put(bridge_dev);
+
        switch (pdev->device) {
        case PCI_DEVICE_ID_INTEL_915G:
        case PCI_DEVICE_ID_INTEL_915GM:
@@ -662,7 +664,7 @@ intelfbhw_print_hw_state(struct intelfb_info *dinfo, struct intelfb_hwstate *hw)
        int index = dinfo->pll_index;
        DBG_MSG("intelfbhw_print_hw_state\n");
 
-       if (!hw || !dinfo)
+       if (!hw)
                return;
        /* Read in as much of the HW state as possible. */
        printk("hw state dump start\n");
index fee318e6f4bb30e8b40c932c103caf857bbc77b1..133dcc8a4150fbaa6ceb432939fb2c4c9e9910a7 100644 (file)
@@ -1777,6 +1777,7 @@ config RPCSEC_GSS_KRB5
        select CRYPTO
        select CRYPTO_MD5
        select CRYPTO_DES
+       select CRYPTO_CBC
        help
          Provides for secure RPC calls by means of a gss-api
          mechanism based on Kerberos V5. This is required for
@@ -1795,6 +1796,7 @@ config RPCSEC_GSS_SPKM3
        select CRYPTO_MD5
        select CRYPTO_DES
        select CRYPTO_CAST5
+       select CRYPTO_CBC
        help
          Provides for secure RPC calls by means of a gss-api
          mechanism based on the SPKM3 public-key mechanism.
index 2bac4ba1d1d3755b70598e992847459dc889a962..a1ff91eef10810c50583962ae671f07e14737bf6 100644 (file)
@@ -1469,23 +1469,21 @@ static void switch_names(struct dentry *dentry, struct dentry *target)
  * deleted it.
  */
  
-/**
- * d_move - move a dentry
+/*
+ * d_move_locked - move a dentry
  * @dentry: entry to move
  * @target: new dentry
  *
  * Update the dcache to reflect the move of a file name. Negative
  * dcache entries should not be moved in this way.
  */
-
-void d_move(struct dentry * dentry, struct dentry * target)
+static void d_move_locked(struct dentry * dentry, struct dentry * target)
 {
        struct hlist_head *list;
 
        if (!dentry->d_inode)
                printk(KERN_WARNING "VFS: moving negative dcache entry\n");
 
-       spin_lock(&dcache_lock);
        write_seqlock(&rename_lock);
        /*
         * XXXX: do we really need to take target->d_lock?
@@ -1536,9 +1534,83 @@ already_unhashed:
        fsnotify_d_move(dentry);
        spin_unlock(&dentry->d_lock);
        write_sequnlock(&rename_lock);
+}
+
+/**
+ * d_move - move a dentry
+ * @dentry: entry to move
+ * @target: new dentry
+ *
+ * Update the dcache to reflect the move of a file name. Negative
+ * dcache entries should not be moved in this way.
+ */
+
+void d_move(struct dentry * dentry, struct dentry * target)
+{
+       spin_lock(&dcache_lock);
+       d_move_locked(dentry, target);
        spin_unlock(&dcache_lock);
 }
 
+/*
+ * Helper that returns 1 if p1 is a parent of p2, else 0
+ */
+static int d_isparent(struct dentry *p1, struct dentry *p2)
+{
+       struct dentry *p;
+
+       for (p = p2; p->d_parent != p; p = p->d_parent) {
+               if (p->d_parent == p1)
+                       return 1;
+       }
+       return 0;
+}
+
+/*
+ * This helper attempts to cope with remotely renamed directories
+ *
+ * It assumes that the caller is already holding
+ * dentry->d_parent->d_inode->i_mutex and the dcache_lock
+ *
+ * Note: If ever the locking in lock_rename() changes, then please
+ * remember to update this too...
+ *
+ * On return, dcache_lock will have been unlocked.
+ */
+static struct dentry *__d_unalias(struct dentry *dentry, struct dentry *alias)
+{
+       struct mutex *m1 = NULL, *m2 = NULL;
+       struct dentry *ret;
+
+       /* If alias and dentry share a parent, then no extra locks required */
+       if (alias->d_parent == dentry->d_parent)
+               goto out_unalias;
+
+       /* Check for loops */
+       ret = ERR_PTR(-ELOOP);
+       if (d_isparent(alias, dentry))
+               goto out_err;
+
+       /* See lock_rename() */
+       ret = ERR_PTR(-EBUSY);
+       if (!mutex_trylock(&dentry->d_sb->s_vfs_rename_mutex))
+               goto out_err;
+       m1 = &dentry->d_sb->s_vfs_rename_mutex;
+       if (!mutex_trylock(&alias->d_parent->d_inode->i_mutex))
+               goto out_err;
+       m2 = &alias->d_parent->d_inode->i_mutex;
+out_unalias:
+       d_move_locked(alias, dentry);
+       ret = alias;
+out_err:
+       spin_unlock(&dcache_lock);
+       if (m2)
+               mutex_unlock(m2);
+       if (m1)
+               mutex_unlock(m1);
+       return ret;
+}
+
 /*
  * Prepare an anonymous dentry for life in the superblock's dentry tree as a
  * named dentry in place of the dentry to be replaced.
@@ -1581,7 +1653,7 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
  */
 struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
 {
-       struct dentry *alias, *actual;
+       struct dentry *actual;
 
        BUG_ON(!d_unhashed(dentry));
 
@@ -1593,26 +1665,27 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
                goto found_lock;
        }
 
-       /* See if a disconnected directory already exists as an anonymous root
-        * that we should splice into the tree instead */
-       if (S_ISDIR(inode->i_mode) && (alias = __d_find_alias(inode, 1))) {
-               spin_lock(&alias->d_lock);
-
-               /* Is this a mountpoint that we could splice into our tree? */
-               if (IS_ROOT(alias))
-                       goto connect_mountpoint;
-
-               if (alias->d_name.len == dentry->d_name.len &&
-                   alias->d_parent == dentry->d_parent &&
-                   memcmp(alias->d_name.name,
-                          dentry->d_name.name,
-                          dentry->d_name.len) == 0)
-                       goto replace_with_alias;
-
-               spin_unlock(&alias->d_lock);
-
-               /* Doh! Seem to be aliasing directories for some reason... */
-               dput(alias);
+       if (S_ISDIR(inode->i_mode)) {
+               struct dentry *alias;
+
+               /* Does an aliased dentry already exist? */
+               alias = __d_find_alias(inode, 0);
+               if (alias) {
+                       actual = alias;
+                       /* Is this an anonymous mountpoint that we could splice
+                        * into our tree? */
+                       if (IS_ROOT(alias)) {
+                               spin_lock(&alias->d_lock);
+                               __d_materialise_dentry(dentry, alias);
+                               __d_drop(alias);
+                               goto found;
+                       }
+                       /* Nope, but we must(!) avoid directory aliasing */
+                       actual = __d_unalias(dentry, alias);
+                       if (IS_ERR(actual))
+                               dput(alias);
+                       goto out_nolock;
+               }
        }
 
        /* Add a unique reference */
@@ -1628,7 +1701,7 @@ found:
        _d_rehash(actual);
        spin_unlock(&actual->d_lock);
        spin_unlock(&dcache_lock);
-
+out_nolock:
        if (actual == dentry) {
                security_d_instantiate(dentry, inode);
                return NULL;
@@ -1637,16 +1710,6 @@ found:
        iput(inode);
        return actual;
 
-       /* Convert the anonymous/root alias into an ordinary dentry */
-connect_mountpoint:
-       __d_materialise_dentry(dentry, alias);
-
-       /* Replace the candidate dentry with the alias in the tree */
-replace_with_alias:
-       __d_drop(alias);
-       actual = alias;
-       goto found;
-
 shouldnt_be_hashed:
        spin_unlock(&dcache_lock);
        BUG();
index 489a3d63002db2db9d5dec4a3c3f1899a154a4e7..ee9b473b7b808d7866dfd95db09d775576977943 100644 (file)
@@ -318,7 +318,7 @@ int diRead(struct inode *ip)
        struct inomap *imap;
        int block_offset;
        int inodes_left;
-       uint pageno;
+       unsigned long pageno;
        int rel_inode;
 
        jfs_info("diRead: ino = %ld", ip->i_ino);
@@ -606,7 +606,7 @@ int diWrite(tid_t tid, struct inode *ip)
        int block_offset;
        int inodes_left;
        struct metapage *mp;
-       uint pageno;
+       unsigned long pageno;
        int rel_inode;
        int dioffset;
        struct inode *ipimap;
index 4133ef5264e53c738c1c312da874bea25e3de1bf..b34cd16f472fef71c798c0470f98cbb33f6ea10c 100644 (file)
@@ -935,8 +935,17 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru
 
 no_entry:
        res = d_materialise_unique(dentry, inode);
-       if (res != NULL)
+       if (res != NULL) {
+               struct dentry *parent;
+               if (IS_ERR(res))
+                       goto out_unlock;
+               /* Was a directory renamed! */
+               parent = dget_parent(res);
+               if (!IS_ROOT(parent))
+                       nfs_mark_for_revalidate(parent->d_inode);
+               dput(parent);
                dentry = res;
+       }
        nfs_renew_times(dentry);
        nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
 out_unlock:
@@ -1132,6 +1141,8 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc)
        alias = d_materialise_unique(dentry, inode);
        if (alias != NULL) {
                dput(dentry);
+               if (IS_ERR(alias))
+                       return NULL;
                dentry = alias;
        }
 
index f3bc70eee35b3b7aabc012af82170db1f1133ded..67ed43674c635a66a3a947accb3a757810fdd260 100644 (file)
@@ -73,7 +73,7 @@
 #define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i))
 
 #if defined(CONFIG_PXA25x)
-#define PXA_LAST_GPIO  80
+#define PXA_LAST_GPIO  84
 #elif defined(CONFIG_PXA27x)
 #define PXA_LAST_GPIO  127
 #endif
index e0b9c44c126ce19519b67a8a074686f3a31e4cd7..c40b6032c48027655b972b7c0e603dc82c7eb492 100644 (file)
@@ -41,7 +41,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
                "       stcond  %1, %0\n"
                "       brne    1b"
                : "=&r"(result), "=o"(v->counter)
-               : "m"(v->counter), "ir"(i)
+               : "m"(v->counter), "rKs21"(i)
                : "cc");
 
        return result;
@@ -58,7 +58,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
 {
        int result;
 
-       if (__builtin_constant_p(i))
+       if (__builtin_constant_p(i) && (i >= -1048575) && (i <= 1048576))
                result = atomic_sub_return(-i, v);
        else
                asm volatile(
@@ -101,7 +101,7 @@ static inline int atomic_sub_unless(atomic_t *v, int a, int u)
                "       mov     %1, 1\n"
                "1:"
                : "=&r"(tmp), "=&r"(result), "=o"(v->counter)
-               : "m"(v->counter), "ir"(a), "ir"(u)
+               : "m"(v->counter), "rKs21"(a), "rKs21"(u)
                : "cc", "memory");
 
        return result;
@@ -121,7 +121,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
 {
        int tmp, result;
 
-       if (__builtin_constant_p(a))
+       if (__builtin_constant_p(a) && (a >= -1048575) && (a <= 1048576))
                result = atomic_sub_unless(v, -a, u);
        else {
                result = 0;
index 2fc8f111dce9e43ca010ca8c474986c4feb78295..eec47500fa66e2d5514628b5950f014fc4a54d6d 100644 (file)
@@ -76,6 +76,39 @@ static inline unsigned int readl(const volatile void __iomem *addr)
 #define readsw(p, d, l)                __raw_readsw((unsigned int)p, d, l)
 #define readsl(p, d, l)                __raw_readsl((unsigned int)p, d, l)
 
+
+/*
+ * io{read,write}{8,16,32} macros in both le (for PCI style consumers) and native be
+ */
+#ifndef ioread8
+
+#define ioread8(p)     ({ unsigned int __v = __raw_readb(p); __v; })
+
+#define ioread16(p)    ({ unsigned int __v = le16_to_cpu(__raw_readw(p)); __v; })
+#define ioread16be(p)  ({ unsigned int __v = be16_to_cpu(__raw_readw(p)); __v; })
+
+#define ioread32(p)    ({ unsigned int __v = le32_to_cpu(__raw_readl(p)); __v; })
+#define ioread32be(p)  ({ unsigned int __v = be32_to_cpu(__raw_readl(p)); __v; })
+
+#define iowrite8(v,p)  __raw_writeb(v, p)
+
+#define iowrite16(v,p) __raw_writew(cpu_to_le16(v), p)
+#define iowrite16be(v,p)       __raw_writew(cpu_to_be16(v), p)
+
+#define iowrite32(v,p) __raw_writel(cpu_to_le32(v), p)
+#define iowrite32be(v,p)       __raw_writel(cpu_to_be32(v), p)
+
+#define ioread8_rep(p,d,c)     __raw_readsb(p,d,c)
+#define ioread16_rep(p,d,c)    __raw_readsw(p,d,c)
+#define ioread32_rep(p,d,c)    __raw_readsl(p,d,c)
+
+#define iowrite8_rep(p,s,c)    __raw_writesb(p,s,c)
+#define iowrite16_rep(p,s,c)   __raw_writesw(p,s,c)
+#define iowrite32_rep(p,s,c)   __raw_writesl(p,s,c)
+
+#endif
+
+
 /*
  * These two are only here because ALSA _thinks_ it needs them...
  */
index 69240b52f8e17931d939c96c6c2901978717b9b9..9d0d11c180d958674922d37e2d36c757fcd6142a 100644 (file)
                *(__param)                                              \
                VMLINUX_SYMBOL(__stop___param) = .;                     \
        }                                                               \
+                                                                       \
+       /* Unwind data binary search table */                           \
+       EH_FRAME_HDR                                                    \
+                                                                       \
        __end_rodata = .;                                               \
        . = ALIGN(4096);
 
                *(.kprobes.text)                                        \
                VMLINUX_SYMBOL(__kprobes_text_end) = .;
 
+#ifdef CONFIG_STACK_UNWIND
+               /* Unwind data binary search table */
+#define EH_FRAME_HDR                                                   \
+               .eh_frame_hdr : AT(ADDR(.eh_frame_hdr) - LOAD_OFFSET) { \
+                       VMLINUX_SYMBOL(__start_unwind_hdr) = .;         \
+                       *(.eh_frame_hdr)                                \
+                       VMLINUX_SYMBOL(__end_unwind_hdr) = .;           \
+               }
+#else
+#define EH_FRAME_HDR
+#endif
+
                /* DWARF debug sections.
                Symbols in the DWARF debugging sections are relative to
                the beginning of the section so we begin them at 0.  */
index 9ab59e2bb23368530fa67c95af0d6ab2c4f7fe8f..e3c9925876a3ce4eb80ec67937362cd7d014ad2f 100644 (file)
@@ -55,24 +55,13 @@ extern void (*flush_icache_range)(unsigned long start, unsigned long end);
 #define flush_cache_vmap(start, end)           flush_cache_all()
 #define flush_cache_vunmap(start, end)         flush_cache_all()
 
-static inline void copy_to_user_page(struct vm_area_struct *vma,
+extern void copy_to_user_page(struct vm_area_struct *vma,
        struct page *page, unsigned long vaddr, void *dst, const void *src,
-       unsigned long len)
-{
-       if (cpu_has_dc_aliases)
-               flush_cache_page(vma, vaddr, page_to_pfn(page));
-       memcpy(dst, src, len);
-       __flush_icache_page(vma, page);
-}
+       unsigned long len);
 
-static inline void copy_from_user_page(struct vm_area_struct *vma,
+extern void copy_from_user_page(struct vm_area_struct *vma,
        struct page *page, unsigned long vaddr, void *dst, const void *src,
-       unsigned long len)
-{
-       if (cpu_has_dc_aliases)
-               flush_cache_page(vma, vaddr, page_to_pfn(page));
-       memcpy(dst, src, len);
-}
+       unsigned long len);
 
 extern void (*flush_cache_sigtramp)(unsigned long addr);
 extern void (*flush_icache_all)(void);
index 6959bdb59310b096ec7797e0a31c78fde5aa9afc..02c8a13fc894838b27336ae42fbb542f87132e01 100644 (file)
  * fix-mapped?
  */
 enum fixed_addresses {
+#define FIX_N_COLOURS 8
+       FIX_CMAP_BEGIN,
+#ifdef CONFIG_MIPS_MT_SMTC
+       FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS),
+#else
+       FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS,
+#endif
 #ifdef CONFIG_HIGHMEM
-       FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
+       /* reserved pte's for temporary kernel mappings */
+       FIX_KMAP_BEGIN = FIX_CMAP_END + 1,
        FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
 #endif
        __end_of_fixed_addresses
@@ -70,9 +78,9 @@ extern void __set_fixmap (enum fixed_addresses idx,
  * at the top of mem..
  */
 #if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX)
-#define FIXADDR_TOP    (0xff000000UL - 0x2000)
+#define FIXADDR_TOP    ((unsigned long)(long)(int)(0xff000000 - 0x20000))
 #else
-#define FIXADDR_TOP    (0xffffe000UL)
+#define FIXADDR_TOP    ((unsigned long)(long)(int)0xfffe0000)
 #endif
 #define FIXADDR_SIZE   (__end_of_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START  (FIXADDR_TOP - FIXADDR_SIZE)
index 8e64be0cc47d3d0f7579445af6726a661f50a17b..c89bd58ee2839be66fc98059172523d246d412b4 100644 (file)
 #  define ASM_CONST(x)         __ASM_CONST(x)
 #endif
 
+
+/*
+ * Feature section common macros
+ *
+ * Note that the entries now contain offsets between the table entry
+ * and the code rather than absolute code pointers in order to be
+ * useable with the vdso shared library. There is also an assumption
+ * that values will be negative, that is, the fixup table has to be
+ * located after the code it fixes up.
+ */
+#ifdef CONFIG_PPC64
+#ifdef __powerpc64__
+/* 64 bits kernel, 64 bits code */
+#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect)  \
+99:                                                    \
+       .section sect,"a";                              \
+       .align 3;                                       \
+98:                                                    \
+       .llong msk;                                     \
+       .llong val;                                     \
+       .llong label##b-98b;                            \
+       .llong 99b-98b;                                 \
+       .previous
+#else /* __powerpc64__ */
+/* 64 bits kernel, 32 bits code (ie. vdso32) */
+#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect)  \
+99:                                                    \
+       .section sect,"a";                              \
+       .align 3;                                       \
+98:                                                    \
+       .llong msk;                                     \
+       .llong val;                                     \
+       .long 0xffffffff;                               \
+       .long label##b-98b;                             \
+       .long 0xffffffff;                               \
+       .long 99b-98b;                                  \
+       .previous
+#endif /* !__powerpc64__ */
+#else /* CONFIG_PPC64 */
+/* 32 bits kernel, 32 bits code */
+#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect)  \
+99:                                                    \
+       .section sect,"a";                              \
+       .align 2;                                       \
+98:                                                    \
+       .long msk;                                      \
+       .long val;                                      \
+       .long label##b-98b;                             \
+       .long 99b-98b;                                  \
+       .previous
+#endif /* !CONFIG_PPC64 */
+
 #ifdef __powerpc64__
 
 /* operations for longs and pointers */
index 12707ab9dc98db6bcc6bf75556dd925e9a56818e..a9a40149a7c0daf66cca975035b4d5863bbc10bc 100644 (file)
@@ -89,8 +89,11 @@ struct cpu_spec {
 
 extern struct cpu_spec         *cur_cpu_spec;
 
-extern void identify_cpu(unsigned long offset, unsigned long cpu);
-extern void do_cpu_ftr_fixups(unsigned long offset);
+extern unsigned int __start___ftr_fixup, __stop___ftr_fixup;
+
+extern struct cpu_spec *identify_cpu(unsigned long offset);
+extern void do_feature_fixups(unsigned long value, void *fixup_start,
+                             void *fixup_end);
 
 #endif /* __ASSEMBLY__ */
 
@@ -144,6 +147,7 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
 #define CPU_FTR_CI_LARGE_PAGE          LONG_ASM_CONST(0x0000100000000000)
 #define CPU_FTR_PAUSE_ZERO             LONG_ASM_CONST(0x0000200000000000)
 #define CPU_FTR_PURR                   LONG_ASM_CONST(0x0000400000000000)
+#define CPU_FTR_CELL_TB_BUG            LONG_ASM_CONST(0x0000800000000000)
 
 #ifndef __ASSEMBLY__
 
@@ -332,7 +336,7 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
 #define CPU_FTRS_CELL  (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
            CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
            CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
-           CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE)
+           CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_CELL_TB_BUG)
 #define CPU_FTRS_PA6T (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
            CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
            CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \
@@ -431,29 +435,12 @@ static inline int cpu_has_feature(unsigned long feature)
 
 #ifdef __ASSEMBLY__
 
-#define BEGIN_FTR_SECTION              98:
-
-#ifndef __powerpc64__
+#define BEGIN_FTR_SECTION_NESTED(label)        label:
+#define BEGIN_FTR_SECTION              BEGIN_FTR_SECTION_NESTED(97)
+#define END_FTR_SECTION_NESTED(msk, val, label) \
+       MAKE_FTR_SECTION_ENTRY(msk, val, label, __ftr_fixup)
 #define END_FTR_SECTION(msk, val)              \
-99:                                            \
-       .section __ftr_fixup,"a";               \
-       .align 2;                               \
-       .long msk;                              \
-       .long val;                              \
-       .long 98b;                              \
-       .long 99b;                              \
-       .previous
-#else /* __powerpc64__ */
-#define END_FTR_SECTION(msk, val)              \
-99:                                            \
-       .section __ftr_fixup,"a";               \
-       .align 3;                               \
-       .llong msk;                             \
-       .llong val;                             \
-       .llong 98b;                             \
-       .llong 99b;                             \
-       .previous
-#endif /* __powerpc64__ */
+       END_FTR_SECTION_NESTED(msk, val, 97)
 
 #define END_FTR_SECTION_IFSET(msk)     END_FTR_SECTION((msk), (msk))
 #define END_FTR_SECTION_IFCLR(msk)     END_FTR_SECTION((msk), 0)
index 1022737f4f34884ea392264cd8a21156290bad67..fdf9aff71150412a9d351241b3c10d65652eb38a 100644 (file)
@@ -96,19 +96,16 @@ extern void machine_check_fwnmi(void);
 /* This is true if we are using the firmware NMI handler (typically LPAR) */
 extern int fwnmi_active;
 
-#else /* __ASSEMBLY__ */
+extern unsigned int __start___fw_ftr_fixup, __stop___fw_ftr_fixup;
 
-#define BEGIN_FW_FTR_SECTION           96:
+#else /* __ASSEMBLY__ */
 
+#define BEGIN_FW_FTR_SECTION_NESTED(label)     label:
+#define BEGIN_FW_FTR_SECTION                   BEGIN_FW_FTR_SECTION_NESTED(97)
+#define END_FW_FTR_SECTION_NESTED(msk, val, label) \
+       MAKE_FTR_SECTION_ENTRY(msk, val, label, __fw_ftr_fixup)
 #define END_FW_FTR_SECTION(msk, val)           \
-97:                                            \
-       .section __fw_ftr_fixup,"a";            \
-       .align 3;                               \
-       .llong msk;                             \
-       .llong val;                             \
-       .llong 96b;                             \
-       .llong 97b;                             \
-       .previous
+       END_FW_FTR_SECTION_NESTED(msk, val, 97)
 
 #define END_FW_FTR_SECTION_IFSET(msk)  END_FW_FTR_SECTION((msk), (msk))
 #define END_FW_FTR_SECTION_IFCLR(msk)  END_FW_FTR_SECTION((msk), 0)
index 78489fb8d140f4465bd9594906efe15f47ea3ffc..db1362f8c603c2576dffefbe6e23a8c410057984 100644 (file)
@@ -7,6 +7,7 @@
 #ifdef CONFIG_PPC_MERGE
 extern void i8259_init(struct device_node *node, unsigned long intack_addr);
 extern unsigned int i8259_irq(void);
+extern struct irq_host *i8259_get_host(void);
 #else
 extern void i8259_init(unsigned long intack_addr, int offset);
 extern int i8259_irq(void);
index a940cfe040da1a4d38b253b09c948bdbdac401a9..fa083d8e46632807b5a206a5ab7fa528e7676fea 100644 (file)
@@ -30,9 +30,9 @@ BEGIN_FTR_SECTION;                                                    \
        mfspr   ra,SPRN_PURR;           /* get processor util. reg */   \
 END_FTR_SECTION_IFSET(CPU_FTR_PURR);                                   \
 BEGIN_FTR_SECTION;                                                     \
-       mftb    ra;                     /* or get TB if no PURR */      \
+       MFTB(ra);                       /* or get TB if no PURR */      \
 END_FTR_SECTION_IFCLR(CPU_FTR_PURR);                                   \
-       ld      rb,PACA_STARTPURR(r13);                         \
+       ld      rb,PACA_STARTPURR(r13);                                 \
        std     ra,PACA_STARTPURR(r13);                                 \
        subf    rb,rb,ra;               /* subtract start value */      \
        ld      ra,PACA_USER_TIME(r13);                                 \
@@ -45,9 +45,9 @@ BEGIN_FTR_SECTION;                                                    \
        mfspr   ra,SPRN_PURR;           /* get processor util. reg */   \
 END_FTR_SECTION_IFSET(CPU_FTR_PURR);                                   \
 BEGIN_FTR_SECTION;                                                     \
-       mftb    ra;                     /* or get TB if no PURR */      \
+       MFTB(ra);                       /* or get TB if no PURR */      \
 END_FTR_SECTION_IFCLR(CPU_FTR_PURR);                                   \
-       ld      rb,PACA_STARTPURR(r13);                         \
+       ld      rb,PACA_STARTPURR(r13);                                 \
        std     ra,PACA_STARTPURR(r13);                                 \
        subf    rb,rb,ra;               /* subtract start value */      \
        ld      ra,PACA_SYSTEM_TIME(r13);                               \
@@ -274,6 +274,16 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
 #define ISYNC_601
 #endif
 
+#ifdef CONFIG_PPC_CELL
+#define MFTB(dest)                     \
+90:    mftb  dest;                     \
+BEGIN_FTR_SECTION_NESTED(96);          \
+       cmpwi dest,0;                   \
+       beq-  90b;                      \
+END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96)
+#else
+#define MFTB(dest)                     mftb dest
+#endif
 
 #ifndef CONFIG_SMP
 #define TLBSYNC
index 5246297693369d677ca698ca3e2cc795e2f1faf4..ec11d44eaeb5d46085f8d3bbffbece4611c7f9a1 100644 (file)
@@ -134,7 +134,7 @@ extern struct device_node *of_find_all_nodes(struct device_node *prev);
 extern struct device_node *of_get_parent(const struct device_node *node);
 extern struct device_node *of_get_next_child(const struct device_node *node,
                                             struct device_node *prev);
-extern struct property *of_find_property(struct device_node *np,
+extern struct property *of_find_property(const struct device_node *np,
                                         const char *name,
                                         int *lenp);
 extern struct device_node *of_node_get(struct device_node *node);
@@ -158,10 +158,12 @@ extern void of_detach_node(const struct device_node *);
 extern void finish_device_tree(void);
 extern void unflatten_device_tree(void);
 extern void early_init_devtree(void *);
-extern int device_is_compatible(struct device_node *device, const char *);
+extern int device_is_compatible(const struct device_node *device,
+                               const char *);
 extern int machine_is_compatible(const char *compat);
-extern const void *get_property(struct device_node *node, const char *name,
-               int *lenp);
+extern const void *get_property(const struct device_node *node,
+                               const char *name,
+                               int *lenp);
 extern void print_properties(struct device_node *node);
 extern int prom_n_addr_cells(struct device_node* np);
 extern int prom_n_size_cells(struct device_node* np);
index 8fb96811b55de74efe6ec468e619dc1e8a2a0ae4..6faae7b14d5540f0e5cdcd13b3a31c195d7d980b 100644 (file)
 #define PV_630         0x0040
 #define PV_630p        0x0041
 #define PV_970MP       0x0044
+#define PV_970GX       0x0045
 #define PV_BE          0x0070
 #define PV_PA6T                0x0090
 
                                : "=r" (rval)); rval;})
 #define mtspr(rn, v)   asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
 
+#ifdef __powerpc64__
+#ifdef CONFIG_PPC_CELL
+#define mftb()         ({unsigned long rval;                           \
+                       asm volatile(                                   \
+                               "90:    mftb %0;\n"                     \
+                               "97:    cmpwi %0,0;\n"                  \
+                               "       beq- 90b;\n"                    \
+                               "99:\n"                                 \
+                               ".section __ftr_fixup,\"a\"\n"          \
+                               ".align 3\n"                            \
+                               "98:\n"                                 \
+                               "       .llong %1\n"                    \
+                               "       .llong %1\n"                    \
+                               "       .llong 97b-98b\n"               \
+                               "       .llong 99b-98b\n"               \
+                               ".previous"                             \
+                       : "=r" (rval) : "i" (CPU_FTR_CELL_TB_BUG)); rval;})
+#else
 #define mftb()         ({unsigned long rval;   \
                        asm volatile("mftb %0" : "=r" (rval)); rval;})
+#endif /* !CONFIG_PPC_CELL */
+
+#else /* __powerpc64__ */
+
 #define mftbl()                ({unsigned long rval;   \
                        asm volatile("mftbl %0" : "=r" (rval)); rval;})
+#define mftbu()                ({unsigned long rval;   \
+                       asm volatile("mftbu %0" : "=r" (rval)); rval;})
+#endif /* !__powerpc64__ */
 
 #define mttbl(v)       asm volatile("mttbl %0":: "r"(v))
 #define mttbu(v)       asm volatile("mttbu %0":: "r"(v))
index b051d4c88c3b46a19b40ba11d2e951010be502d6..a78285010d62f852674327f09a73fda3b7a69a8b 100644 (file)
@@ -82,30 +82,35 @@ struct div_result {
 #define __USE_RTC()    0
 #endif
 
-/* On ppc64 this gets us the whole timebase; on ppc32 just the lower half */
+#ifdef CONFIG_PPC64
+
+/* For compatibility, get_tbl() is defined as get_tb() on ppc64 */
+#define get_tbl                get_tb
+
+#else
+
 static inline unsigned long get_tbl(void)
 {
-       unsigned long tbl;
-
 #if defined(CONFIG_403GCX)
+       unsigned long tbl;
        asm volatile("mfspr %0, 0x3dd" : "=r" (tbl));
+       return tbl;
 #else
-       asm volatile("mftb %0" : "=r" (tbl));
+       return mftbl();
 #endif
-       return tbl;
 }
 
 static inline unsigned int get_tbu(void)
 {
+#ifdef CONFIG_403GCX
        unsigned int tbu;
-
-#if defined(CONFIG_403GCX)
        asm volatile("mfspr %0, 0x3dc" : "=r" (tbu));
+       return tbu;
 #else
-       asm volatile("mftbu %0" : "=r" (tbu));
+       return mftbu();
 #endif
-       return tbu;
 }
+#endif /* !CONFIG_PPC64 */
 
 static inline unsigned int get_rtcl(void)
 {
@@ -131,7 +136,7 @@ static inline u64 get_tb(void)
 {
        return mftb();
 }
-#else
+#else /* CONFIG_PPC64 */
 static inline u64 get_tb(void)
 {
        unsigned int tbhi, tblo, tbhi2;
@@ -144,7 +149,7 @@ static inline u64 get_tb(void)
 
        return ((u64)tbhi << 32) | tblo;
 }
-#endif
+#endif /* !CONFIG_PPC64 */
 
 static inline void set_tb(unsigned int upper, unsigned int lower)
 {
index 3b9a8e78680646f3ee64f2582b0c14b26d0a08c9..92dedde761d183a0109dfd7173c37ec1f3a1d43b 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <asm/cputable.h>
+#include <asm/reg.h>
 
 #define CLOCK_TICK_RATE        1024000 /* Underlying HZ */
 
@@ -15,13 +16,11 @@ typedef unsigned long cycles_t;
 
 static inline cycles_t get_cycles(void)
 {
-       cycles_t ret;
-
 #ifdef __powerpc64__
-
-       __asm__ __volatile__("mftb %0" : "=r" (ret) : );
-
+       return mftb();
 #else
+       cycles_t ret;
+
        /*
         * For the "cycle" counter we use the timebase lower half.
         * Currently only used on SMP.
@@ -30,18 +29,19 @@ static inline cycles_t get_cycles(void)
        ret = 0;
 
        __asm__ __volatile__(
-               "98:    mftb %0\n"
+               "97:    mftb %0\n"
                "99:\n"
                ".section __ftr_fixup,\"a\"\n"
+               ".align 2\n"
+               "98:\n"
                "       .long %1\n"
                "       .long 0\n"
-               "       .long 98b\n"
-               "       .long 99b\n"
+               "       .long 97b-98b\n"
+               "       .long 99b-98b\n"
                ".previous"
                : "=r" (ret) : "i" (CPU_FTR_601));
-#endif
-
        return ret;
+#endif
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-sh/hp6xx/ide.h b/include/asm-sh/hp6xx/ide.h
deleted file mode 100644 (file)
index 570395a..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_SH_HP6XX_IDE_H
-#define __ASM_SH_HP6XX_IDE_H
-
-#define IRQ_CFCARD     93
-#define IRQ_PCMCIA     94
-
-#endif /* __ASM_SH_HP6XX_IDE_H */
-
diff --git a/include/asm-sh/hp6xx/io.h b/include/asm-sh/hp6xx/io.h
deleted file mode 100644 (file)
index 2044476..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __ASM_SH_HP6XX_IO_H
-#define __ASM_SH_HP6XX_IO_H
-
-/*
- * Nothing special here.. just use the generic cchip io routines.
- */
-#include <asm/hd64461.h>
-
-#endif /* __ASM_SH_HP6XX_IO_H */
-
diff --git a/include/asm-sh/hs7751rvoip/ide.h b/include/asm-sh/hs7751rvoip/ide.h
deleted file mode 100644 (file)
index 65ad1d0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_SH_HS7751RVOIP_IDE_H
-#define __ASM_SH_HS7751RVOIP_IDE_H
-
-/* Nothing to see here.. */
-#include <asm/hs7751rvoip/hs7751rvoip.h>
-
-#endif /* __ASM_SH_HS7751RVOIP_IDE_H */
-
index 895c5780e45473150ad02217a860e254b7fac648..19912ae6a7f720fae3d7327649b1fe0015b681f6 100644 (file)
@@ -6,16 +6,6 @@
  *
  * Copyright (C) 2004 Takashi SHUDO <shudo@hitachi-ul.co.jp>
  */
-
-#ifdef CONFIG_IDE
-# ifndef IRQ_CFCARD
-#  define IRQ_CFCARD   14
-# endif
-# ifndef IRQ_PCMCIA
-#  define IRQ_PCMCIA   15
-# endif
-#endif
-
 #define INTC_BASE      0xffd00000
 #define INTC_ICR0      (INTC_BASE+0x0)
 #define INTC_ICR1      (INTC_BASE+0x1c)
index 28996f9c58ccf81ff1c74d7b3e232869cd564c00..7596ab83e0d4dcb5136fda0483c83a1af90e846f 100644 (file)
 #include <asm/machvec.h>
 #include <asm/ptrace.h>                /* for pt_regs */
 
-#if defined(CONFIG_SH_HP6XX) || \
-    defined(CONFIG_SH_RTS7751R2D) || \
-    defined(CONFIG_SH_HS7751RVOIP) || \
-    defined(CONFIG_SH_HS7751RVOIP) || \
-    defined(CONFIG_SH_SH03) || \
-    defined(CONFIG_SH_R7780RP) || \
-    defined(CONFIG_SH_LANDISK)
-#include <asm/mach/ide.h>
-#endif
-
 #ifndef CONFIG_CPU_SUBTYPE_SH7780
 
 #define INTC_DMAC0_MSK 0
 #define INTC_IPRD      0xffd00010UL
 #endif
 
-#ifdef CONFIG_IDE
-# ifndef IRQ_CFCARD
-#  define IRQ_CFCARD   14
-# endif
-# ifndef IRQ_PCMCIA
-#  define IRQ_PCMCIA   15
-# endif
-#endif
-
 #define TIMER_IRQ      16
 #define TIMER_IPR_ADDR INTC_IPRA
 #define TIMER_IPR_POS   3
@@ -704,7 +685,7 @@ struct intc2_data {
        unsigned char priority;
 };
 
-void make_intc2_irq(struct intc2_data *);
+void make_intc2_irq(struct intc2_data *, unsigned int nr_irqs);
 void init_IRQ_intc2(void);
 #endif
 
diff --git a/include/asm-sh/landisk/ide.h b/include/asm-sh/landisk/ide.h
deleted file mode 100644 (file)
index 6490e28..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * modifed by kogiidena
- * 2005.03.03
- */
-
-#ifndef __ASM_SH_LANDISK_IDE_H
-#define __ASM_SH_LANDISK_IDE_H
-
-/* Nothing to see here.. */
-#include <asm/landisk/iodata_landisk.h>
-#define IRQ_CFCARD     IRQ_FATA        /* CF Card IRQ */
-#define IRQ_PCMCIA     IRQ_ATA         /* PCMCIA IRQ */
-
-#endif /* __ASM_SH_LANDISK_IDE_H  */
index 474773853cd1a71f3184d85daf62468f3cfc2de0..45bb74e35d325acbbccc4607528ea2c4e07d0a59 100644 (file)
@@ -255,6 +255,8 @@ extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs);
  */
 #define thread_saved_pc(tsk)   (tsk->thread.pc)
 
+void show_trace(struct task_struct *tsk, unsigned long *sp,
+               struct pt_regs *regs);
 extern unsigned long get_wchan(struct task_struct *p);
 
 #define KSTK_EIP(tsk)  ((tsk)->thread.pc)
similarity index 96%
rename from include/asm-sh/r7780rp/r7780rp.h
rename to include/asm-sh/r7780rp.h
index f95d9dba31a2fe1c4d509f0dd8838669e0e84ab5..c18f648a799549105a01c75981baa808c004657a 100644 (file)
@@ -72,8 +72,6 @@
 
 #define PA_AX88796L     0xa4100400      /* AX88796L Area */
 #define PA_SC1602BSLB   0xa6000000      /* SC1602BSLB Area */
-#define PA_AREA5_IO     0xb4000000      /* Area 5 IO Memory */
-#define PA_AREA6_IO     0xb8000000      /* Area 6 IO Memory */
 #define PA_IDE_OFFSET   0x1f0           /* CF IDE Offset */
 #define AX88796L_IO_BASE        0x1000  /* AX88796L IO Base Address */
 
@@ -83,7 +81,6 @@
 #define IRQ_PCISLOT2    66              /* PCI Slot #2 IRQ */
 #define IRQ_PCISLOT3    67              /* PCI Slot #3 IRQ */
 #define IRQ_PCISLOT4    68              /* PCI Slot #4 IRQ */
-#define IRQ_CFCARD      1               /* CF Card IRQ */
 // #define IRQ_CFINST   0               /* CF Card Insert IRQ */
 #define IRQ_TP          2               /* Touch Panel IRQ */
 #define IRQ_SCI1        3               /* SCI1 IRQ */
 
 #define PA_AX88796L    0xa5800400      /* AX88796L Area */
 #define PA_SC1602BSLB  0xa6000000      /* SC1602BSLB Area */
-#define PA_AREA5_IO    0xb4000000      /* Area 5 IO Memory */
-#define PA_AREA6_IO    0xb8000000      /* Area 6 IO Memory */
 #define PA_IDE_OFFSET  0x1f0           /* CF IDE Offset */
 #define AX88796L_IO_BASE       0x1000  /* AX88796L IO Base Address */
 
 #define IRQ_PCISLOT2   1               /* PCI Slot #2 IRQ */
 #define IRQ_PCISLOT3   2               /* PCI Slot #3 IRQ */
 #define IRQ_PCISLOT4   3               /* PCI Slot #4 IRQ */
-#define IRQ_CFCARD     4               /* CF Card IRQ */
 #define IRQ_CFINST     5               /* CF Card Insert IRQ */
 #define IRQ_M66596     6               /* M66596 IRQ */
 #define IRQ_SDCARD     7               /* SD Card IRQ */
diff --git a/include/asm-sh/r7780rp/ide.h b/include/asm-sh/r7780rp/ide.h
deleted file mode 100644 (file)
index a1ed78e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_SH_R7780RP_IDE_H
-#define __ASM_SH_R7780RP_IDE_H
-
-/* Nothing to see here.. */
-#include <asm/mach/r7780rp.h>
-
-#endif /* __ASM_SH_R7780RP_IDE_H */
-
diff --git a/include/asm-sh/rts7751r2d/ide.h b/include/asm-sh/rts7751r2d/ide.h
deleted file mode 100644 (file)
index 416f96b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_SH_RTS7751R2D_IDE_H
-#define __ASM_SH_RTS7751R2D_IDE_H
-
-/* Nothing to see here.. */
-#include <asm/rts7751r2d/rts7751r2d.h>
-
-#endif /* __ASM_SH_RTS7751R2D_IDE_H */
-
diff --git a/include/asm-sh/sh03/ide.h b/include/asm-sh/sh03/ide.h
deleted file mode 100644 (file)
index 73ee92e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __ASM_SH_SH03_IDE_H
-#define __ASM_SH_SH03_IDE_H
-
-#define IRQ_CFCARD     8
-#define IRQ_PCMCIA     8
-
-#endif /* __ASM_SH_SH03_IDE_H */
index 6c1f8fde5ac4a8e6a73c6d5059491db8c7e56554..3340126f4e0fc7785cef0ed7e4c191583fdc6e35 100644 (file)
@@ -353,6 +353,13 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
                                    (unsigned long)_n_, sizeof(*(ptr))); \
   })
 
+extern void *set_exception_table_vec(unsigned int vec, void *handler);
+
+static inline void *set_exception_table_evt(unsigned int evt, void *handler)
+{
+       return set_exception_table_vec(evt >> 5, handler);
+}
+
 /* XXX
  * disable hlt during certain critical i/o operations
  */
index c73935dc7ba11c8e800b79596d6ae27e3431fd30..36511ca514165b4307033de76e7b09db646509c1 100644 (file)
@@ -164,7 +164,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
        return (u32)(unsigned long)uptr;
 }
 
-static __inline__ void __user *compat_alloc_user_space(long len)
+static inline void __user *compat_alloc_user_space(long len)
 {
        struct pt_regs *regs = current_thread_info()->kregs;
        unsigned long usp = regs->u_regs[UREG_I6];
@@ -174,7 +174,10 @@ static __inline__ void __user *compat_alloc_user_space(long len)
        else
                usp &= 0xffffffffUL;
 
-       return (void __user *) (usp - len);
+       usp -= len;
+       usp &= ~0x7UL;
+
+       return (void __user *) usp;
 }
 
 struct compat_ipc64_perm {
index 792dd52fcd702b0ec45a719845d6da5e46c8deed..179cce755aa75656380f7f4e9005cebd46010742 100644 (file)
@@ -76,6 +76,8 @@
 #ifndef __ASSEMBLY__
 typedef int vector_irq_t[NR_VECTORS];
 DECLARE_PER_CPU(vector_irq_t, vector_irq);
+extern void __setup_vector_irq(int cpu);
+extern spinlock_t vector_lock;
 
 /*
  * Various low-level irq details needed by irq.c, process.c,
index 6899e770b173e4a2cb75fdd5bc664359cdf0fa7b..0555c1c4d8fa9fcda13c280997c076decc85d708 100644 (file)
@@ -366,6 +366,7 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
 { 
        pte_t pte;
        pte_val(pte) = physpage | pgprot_val(pgprot); 
+       pte_val(pte) &= __supported_pte_mask;
        return pte; 
 }
  
index c181fef786e43adcd4b114fa9922aa6a725ff2b9..e72cfcdf53448d262ce0b549de267ae470f8ebe1 100644 (file)
@@ -122,6 +122,8 @@ extern int fix_aperture;
 extern int reboot_force;
 extern int notsc_setup(char *);
 
+extern int timer_over_8254;
+
 extern int gsi_irq_sharing(int gsi);
 
 extern void smp_local_timer_interrupt(void);
index cfdb4f6a89d4a0edd2aa5ec65cf88ec88787eb13..c26c3adcfacff0aa9231d527daf75d0f2fc09336 100644 (file)
@@ -131,6 +131,7 @@ COMPATIBLE_IOCTL(RUN_ARRAY)
 COMPATIBLE_IOCTL(STOP_ARRAY)
 COMPATIBLE_IOCTL(STOP_ARRAY_RO)
 COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
+COMPATIBLE_IOCTL(GET_BITMAP_FILE)
 ULONG_IOCTL(SET_BITMAP_FILE)
 /* DM */
 COMPATIBLE_IOCTL(DM_VERSION_32)
index 662e6a10144e5b453b2ad11b02fc7314bd33816e..9d4f6a9639365bd6e2483ed911ea336a9e83caa0 100644 (file)
@@ -393,7 +393,7 @@ extern void device_unregister(struct device * dev);
 extern void device_initialize(struct device * dev);
 extern int __must_check device_add(struct device * dev);
 extern void device_del(struct device * dev);
-extern int __must_check device_for_each_child(struct device *, void *,
+extern int device_for_each_child(struct device *, void *,
                     int (*fn)(struct device *, void *));
 extern int device_rename(struct device *dev, char *new_name);
 
index 38dc403be70b5bc4f49aee4132ba7ea85ca61399..904bf3d2d90bb068bc3837dfc40bf45e65cdddb6 100644 (file)
@@ -69,6 +69,7 @@ extern struct dmi_device * dmi_find_device(int type, const char *name,
        struct dmi_device *from);
 extern void dmi_scan_machine(void);
 extern int dmi_get_year(int field);
+extern int dmi_name_in_vendors(char *str);
 
 #else
 
@@ -77,6 +78,7 @@ static inline char * dmi_get_system_info(int field) { return NULL; }
 static inline struct dmi_device * dmi_find_device(int type, const char *name,
        struct dmi_device *from) { return NULL; }
 static inline int dmi_get_year(int year) { return 0; }
+static inline int dmi_name_in_vendors(char *s) { return 0; }
 
 #endif
 
index d0a7ad5ed518d3f6d314c4fede714676def3a26b..b03d5a340dc810723368d1cc4fbf73b703e9628d 100644 (file)
@@ -143,7 +143,7 @@ enum {
        ATA_DFLAG_CFG_MASK      = (1 << 8) - 1,
 
        ATA_DFLAG_PIO           = (1 << 8), /* device limited to PIO mode */
-       ATA_DFLAG_NCQ_OFF       = (1 << 9), /* devied limited to non-NCQ mode */
+       ATA_DFLAG_NCQ_OFF       = (1 << 9), /* device limited to non-NCQ mode */
        ATA_DFLAG_SUSPENDED     = (1 << 10), /* device suspended */
        ATA_DFLAG_INIT_MASK     = (1 << 16) - 1,
 
index 09f0f575ddff947b32ac9cdef5e8f2b07b4dff87..daabb3aa1ec6b96b5078f6236d2df87fbfe710f6 100644 (file)
@@ -150,7 +150,7 @@ extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new);
 extern void mpol_fix_fork_child_flag(struct task_struct *p);
 #define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x))
 
-#ifdef CONFIG_CPUSET
+#ifdef CONFIG_CPUSETS
 #define current_cpuset_is_being_rebound() \
                                (cpuset_being_rebound == current->cpuset)
 #else
index 59855b8718a0a4b993a39cb825034ad081dd09cd..ed0762b283a9fd725b08a10fd2e194f89fcba3c0 100644 (file)
@@ -674,6 +674,12 @@ void sparse_init(void);
 #define sparse_index_init(_sec, _nid)  do {} while (0)
 #endif /* CONFIG_SPARSEMEM */
 
+#ifdef CONFIG_NODES_SPAN_OTHER_NODES
+#define early_pfn_in_nid(pfn, nid)     (early_pfn_to_nid(pfn) == (nid))
+#else
+#define early_pfn_in_nid(pfn, nid)     (1)
+#endif
+
 #ifndef early_pfn_valid
 #define early_pfn_valid(pfn)   (1)
 #endif
index 4689e2a699c001b797db97888f183be3b9dd396c..09be0f81b27ba37d4125f4dfa7fa2de601858b37 100644 (file)
@@ -455,7 +455,11 @@ int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
 int pci_find_ext_capability (struct pci_dev *dev, int cap);
 struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
 
-struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from);
+struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
+                               struct pci_dev *from);
+struct pci_dev *pci_get_device_reverse(unsigned int vendor, unsigned int device,
+                               struct pci_dev *from);
+
 struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device,
                                unsigned int ss_vendor, unsigned int ss_device,
                                struct pci_dev *from);
@@ -660,7 +664,12 @@ static inline struct pci_dev *pci_find_device(unsigned int vendor, unsigned int
 static inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn)
 { return NULL; }
 
-static inline struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from)
+static inline struct pci_dev *pci_get_device(unsigned int vendor,
+                               unsigned int device, struct pci_dev *from)
+{ return NULL; }
+
+static inline struct pci_dev *pci_get_device_reverse(unsigned int vendor,
+                               unsigned int device, struct pci_dev *from)
 { return NULL; }
 
 static inline struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device,
index 84d88775185556e4d2a8a6b0560bcfc9c202038a..ebd42a3710b4eefc44bec8a9880bd88af6472bcb 100644 (file)
@@ -146,16 +146,16 @@ enum bitmap_state {
 
 /* the superblock at the front of the bitmap file -- little endian */
 typedef struct bitmap_super_s {
-       __u32 magic;        /*  0  BITMAP_MAGIC */
-       __u32 version;      /*  4  the bitmap major for now, could change... */
-       __u8  uuid[16];     /*  8  128 bit uuid - must match md device uuid */
-       __u64 events;       /* 24  event counter for the bitmap (1)*/
-       __u64 events_cleared;/*32  event counter when last bit cleared (2) */
-       __u64 sync_size;    /* 40  the size of the md device's sync range(3) */
-       __u32 state;        /* 48  bitmap state information */
-       __u32 chunksize;    /* 52  the bitmap chunk size in bytes */
-       __u32 daemon_sleep; /* 56  seconds between disk flushes */
-       __u32 write_behind; /* 60  number of outstanding write-behind writes */
+       __le32 magic;        /*  0  BITMAP_MAGIC */
+       __le32 version;      /*  4  the bitmap major for now, could change... */
+       __u8  uuid[16];      /*  8  128 bit uuid - must match md device uuid */
+       __le64 events;       /* 24  event counter for the bitmap (1)*/
+       __le64 events_cleared;/*32  event counter when last bit cleared (2) */
+       __le64 sync_size;    /* 40  the size of the md device's sync range(3) */
+       __le32 state;        /* 48  bitmap state information */
+       __le32 chunksize;    /* 52  the bitmap chunk size in bytes */
+       __le32 daemon_sleep; /* 56  seconds between disk flushes */
+       __le32 write_behind; /* 60  number of outstanding write-behind writes */
 
        __u8  pad[256 - 64]; /* set to zero */
 } bitmap_super_t;
index b6ebc69bae54d7b22402732355279d474701f699..3f2cd98c508bfdff781b361b1b86886bd65ddda8 100644 (file)
@@ -206,52 +206,52 @@ static inline __u64 md_event(mdp_super_t *sb) {
  */
 struct mdp_superblock_1 {
        /* constant array information - 128 bytes */
-       __u32   magic;          /* MD_SB_MAGIC: 0xa92b4efc - little endian */
-       __u32   major_version;  /* 1 */
-       __u32   feature_map;    /* bit 0 set if 'bitmap_offset' is meaningful */
-       __u32   pad0;           /* always set to 0 when writing */
+       __le32  magic;          /* MD_SB_MAGIC: 0xa92b4efc - little endian */
+       __le32  major_version;  /* 1 */
+       __le32  feature_map;    /* bit 0 set if 'bitmap_offset' is meaningful */
+       __le32  pad0;           /* always set to 0 when writing */
 
        __u8    set_uuid[16];   /* user-space generated. */
        char    set_name[32];   /* set and interpreted by user-space */
 
-       __u64   ctime;          /* lo 40 bits are seconds, top 24 are microseconds or 0*/
-       __u32   level;          /* -4 (multipath), -1 (linear), 0,1,4,5 */
-       __u32   layout;         /* only for raid5 and raid10 currently */
-       __u64   size;           /* used size of component devices, in 512byte sectors */
+       __le64  ctime;          /* lo 40 bits are seconds, top 24 are microseconds or 0*/
+       __le32  level;          /* -4 (multipath), -1 (linear), 0,1,4,5 */
+       __le32  layout;         /* only for raid5 and raid10 currently */
+       __le64  size;           /* used size of component devices, in 512byte sectors */
 
-       __u32   chunksize;      /* in 512byte sectors */
-       __u32   raid_disks;
-       __u32   bitmap_offset;  /* sectors after start of superblock that bitmap starts
+       __le32  chunksize;      /* in 512byte sectors */
+       __le32  raid_disks;
+       __le32  bitmap_offset;  /* sectors after start of superblock that bitmap starts
                                 * NOTE: signed, so bitmap can be before superblock
                                 * only meaningful of feature_map[0] is set.
                                 */
 
        /* These are only valid with feature bit '4' */
-       __u32   new_level;      /* new level we are reshaping to                */
-       __u64   reshape_position;       /* next address in array-space for reshape */
-       __u32   delta_disks;    /* change in number of raid_disks               */
-       __u32   new_layout;     /* new layout                                   */
-       __u32   new_chunk;      /* new chunk size (bytes)                       */
+       __le32  new_level;      /* new level we are reshaping to                */
+       __le64  reshape_position;       /* next address in array-space for reshape */
+       __le32  delta_disks;    /* change in number of raid_disks               */
+       __le32  new_layout;     /* new layout                                   */
+       __le32  new_chunk;      /* new chunk size (bytes)                       */
        __u8    pad1[128-124];  /* set to 0 when written */
 
        /* constant this-device information - 64 bytes */
-       __u64   data_offset;    /* sector start of data, often 0 */
-       __u64   data_size;      /* sectors in this device that can be used for data */
-       __u64   super_offset;   /* sector start of this superblock */
-       __u64   recovery_offset;/* sectors before this offset (from data_offset) have been recovered */
-       __u32   dev_number;     /* permanent identifier of this  device - not role in raid */
-       __u32   cnt_corrected_read; /* number of read errors that were corrected by re-writing */
+       __le64  data_offset;    /* sector start of data, often 0 */
+       __le64  data_size;      /* sectors in this device that can be used for data */
+       __le64  super_offset;   /* sector start of this superblock */
+       __le64  recovery_offset;/* sectors before this offset (from data_offset) have been recovered */
+       __le32  dev_number;     /* permanent identifier of this  device - not role in raid */
+       __le32  cnt_corrected_read; /* number of read errors that were corrected by re-writing */
        __u8    device_uuid[16]; /* user-space setable, ignored by kernel */
        __u8    devflags;       /* per-device flags.  Only one defined...*/
 #define        WriteMostly1    1       /* mask for writemostly flag in above */
        __u8    pad2[64-57];    /* set to 0 when writing */
 
        /* array state information - 64 bytes */
-       __u64   utime;          /* 40 bits second, 24 btes microseconds */
-       __u64   events;         /* incremented when superblock updated */
-       __u64   resync_offset;  /* data before this offset (from data_offset) known to be in sync */
-       __u32   sb_csum;        /* checksum upto devs[max_dev] */
-       __u32   max_dev;        /* size of devs[] array to consider */
+       __le64  utime;          /* 40 bits second, 24 btes microseconds */
+       __le64  events;         /* incremented when superblock updated */
+       __le64  resync_offset;  /* data before this offset (from data_offset) known to be in sync */
+       __le32  sb_csum;        /* checksum upto devs[max_dev] */
+       __le32  max_dev;        /* size of devs[] array to consider */
        __u8    pad3[64-32];    /* set to 0 when writing */
 
        /* device state information. Indexed by dev_number.
@@ -260,7 +260,7 @@ struct mdp_superblock_1 {
         * into the 'roles' value.  If a device is spare or faulty, then it doesn't
         * have a meaningful role.
         */
-       __u16   dev_roles[0];   /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
+       __le16  dev_roles[0];   /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
 };
 
 /* feature_map bits */
index 73e1751d03dd18e2806d4a018c05f9cf05eaf942..749928c161fb24a6fbdcc95fc703c18d900f9494 100644 (file)
@@ -26,6 +26,7 @@ struct module;
  * Initialize unwind support.
  */
 extern void unwind_init(void);
+extern void unwind_setup(void);
 
 #ifdef CONFIG_MODULES
 
@@ -73,6 +74,7 @@ extern int unwind_to_user(struct unwind_frame_info *);
 struct unwind_frame_info {};
 
 static inline void unwind_init(void) {}
+static inline void unwind_setup(void) {}
 
 #ifdef CONFIG_MODULES
 
index 465b7830278209fee5a1454d634739c9e17a3a50..ac4ce9091747cd6660c5d77a7bce868e8e7a1747 100644 (file)
@@ -199,11 +199,6 @@ static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp)
 {
        fl->uli_u.dnports.sport = scp->addrloc;
        fl->uli_u.dnports.dport = scp->addrrem;
-       fl->uli_u.dnports.objnum = scp->addr.sdn_objnum;
-       if (fl->uli_u.dnports.objnum == 0) {
-               fl->uli_u.dnports.objnamel = (__u8)dn_ntohs(scp->addr.sdn_objnamel);
-               memcpy(fl->uli_u.dnports.objname, scp->addr.sdn_objname, 16);
-       }
 }
 
 extern unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu);
index 3b44d72b27d3ca25126f7f595dd787e6935e8b8b..5cda27cd9debdbaa59afd05ec151b61badf9e4e5 100644 (file)
@@ -68,9 +68,6 @@ struct flowi {
                struct {
                        __le16  sport;
                        __le16  dport;
-                       __u8    objnum;
-                       __u8    objnamel; /* Not 16 bits since max val is 16 */
-                       __u8    objname[16]; /* Not zero terminated */
                } dnports;
 
                __be32          spi;
index 40bb90ebb2d1b24e11134b08c21ab47f59f68e75..ac286a35303288eddbf2171bced23f79cd11da7c 100644 (file)
@@ -884,8 +884,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
 
 /**
  *     sk_filter_release: Release a socket filter
- *     @sk: socket
- *     @fp: filter to remove
+ *     @rcu: rcu_head that contains the sk_filter info to remove
  *
  *     Remove a filter from a socket and release its resources.
  */
index 401192e56e502a6a69e2e1c14c4630678acbfed3..61eebec00a7b8fd40d5803a640f0999a8902c683 100644 (file)
@@ -136,7 +136,6 @@ struct iscsi_conn {
 
        /* control data */
        int                     id;             /* CID */
-       struct list_head        item;           /* maintains list of conns */
        int                     c_stage;        /* connection state */
        /*
         * Preallocated buffer for pdus that have data but do not
@@ -235,10 +234,8 @@ struct iscsi_session {
                                                 * - mgmtpool,             *
                                                 * - r2tpool               */
        int                     state;          /* session state           */
-       struct list_head        item;
        int                     age;            /* counts session re-opens */
 
-       struct list_head        connections;    /* list of connections */
        int                     cmds_max;       /* size of cmds array */
        struct iscsi_cmd_task   **cmds;         /* Original Cmds arr */
        struct iscsi_queue      cmdpool;        /* PDU's pool */
index 84a6d5fe0920c019bd400c8681f9a417f5a14243..5c0e9791441c91ab712608b078ba420f0852e1d9 100644 (file)
@@ -97,6 +97,7 @@ extern const unsigned char scsi_command_size[8];
 #define PERSISTENT_RESERVE_IN 0x5e
 #define PERSISTENT_RESERVE_OUT 0x5f
 #define REPORT_LUNS           0xa0
+#define MAINTENANCE_IN        0xa3
 #define MOVE_MEDIUM           0xa5
 #define EXCHANGE_MEDIUM       0xa6
 #define READ_12               0xa8
@@ -114,6 +115,8 @@ extern const unsigned char scsi_command_size[8];
 #define SERVICE_ACTION_IN     0x9e
 /* values for service action in */
 #define        SAI_READ_CAPACITY_16  0x10
+/* values for maintenance in */
+#define MI_REPORT_TARGET_PGS  0x0a
 
 /* Values for T10/04-262r7 */
 #define        ATA_16                0x85      /* 16-byte pass-thru */
@@ -430,7 +433,7 @@ struct scsi_lun {
 #define SCSI_IOCTL_GET_PCI             0x5387
 
 /* Pull a u32 out of a SCSI message (using BE SCSI conventions) */
-static inline u32 scsi_to_u32(u8 *ptr)
+static inline __u32 scsi_to_u32(__u8 *ptr)
 {
        return (ptr[0]<<24) + (ptr[1]<<16) + (ptr[2]<<8) + ptr[3];
 }
index 39e833260bd0dc63f46258802d0b186fbaa1a6bd..4b95c89c95c9f14ad30a27e22f48b1740d2c7498 100644 (file)
@@ -29,7 +29,6 @@
 struct scsi_transport_template;
 struct iscsi_transport;
 struct Scsi_Host;
-struct mempool_zone;
 struct iscsi_cls_conn;
 struct iscsi_conn;
 struct iscsi_cmd_task;
@@ -157,9 +156,6 @@ struct iscsi_cls_conn {
 
        int active;                     /* must be accessed with the connlock */
        struct device dev;              /* sysfs transport/container device */
-       struct mempool_zone *z_error;
-       struct mempool_zone *z_pdu;
-       struct list_head freequeue;
 };
 
 #define iscsi_dev_to_conn(_dev) \
index 4ad86eb6440b7bc6be0f599bed804d80e1879507..52fd6879b86e1142f1c604367b5eb552e2dc26f5 100644 (file)
@@ -1,3 +1,3 @@
 /* include/version.h.  Generated by alsa/ksync script.  */
 #define CONFIG_SND_VERSION "1.0.13"
-#define CONFIG_SND_DATE " (Fri Oct 06 18:28:19 2006 UTC)"
+#define CONFIG_SND_DATE " (Sun Oct 22 08:56:16 2006 UTC)"
index ee123243fb530b4d4e589f731c5bfa4652148dc8..36f608a7cfbaf0fe1e2d3b1f37ff42e945bc100d 100644 (file)
@@ -503,6 +503,7 @@ asmlinkage void __init start_kernel(void)
        printk(KERN_NOTICE);
        printk(linux_banner);
        setup_arch(&command_line);
+       unwind_setup();
        setup_per_cpu_areas();
        smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
 
index 2e2368607aab1a8293739315d832c608463d8d5f..f7e50d16dbf6b6ba55980dda3e0841d0a9d0d394 100644 (file)
 
 #include <linux/unwind.h>
 #include <linux/module.h>
-#include <linux/delay.h>
+#include <linux/bootmem.h>
+#include <linux/sort.h>
 #include <linux/stop_machine.h>
 #include <asm/sections.h>
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
 
 extern char __start_unwind[], __end_unwind[];
+extern const u8 __start_unwind_hdr[], __end_unwind_hdr[];
 
 #define MAX_STACK_DEPTH 8
 
@@ -100,6 +102,8 @@ static struct unwind_table {
        } core, init;
        const void *address;
        unsigned long size;
+       const unsigned char *header;
+       unsigned long hdrsz;
        struct unwind_table *link;
        const char *name;
 } root_table;
@@ -145,6 +149,10 @@ static struct unwind_table *find_table(unsigned long pc)
        return table;
 }
 
+static unsigned long read_pointer(const u8 **pLoc,
+                                  const void *end,
+                                  signed ptrType);
+
 static void init_unwind_table(struct unwind_table *table,
                               const char *name,
                               const void *core_start,
@@ -152,14 +160,30 @@ static void init_unwind_table(struct unwind_table *table,
                               const void *init_start,
                               unsigned long init_size,
                               const void *table_start,
-                              unsigned long table_size)
+                              unsigned long table_size,
+                              const u8 *header_start,
+                              unsigned long header_size)
 {
+       const u8 *ptr = header_start + 4;
+       const u8 *end = header_start + header_size;
+
        table->core.pc = (unsigned long)core_start;
        table->core.range = core_size;
        table->init.pc = (unsigned long)init_start;
        table->init.range = init_size;
        table->address = table_start;
        table->size = table_size;
+       /* See if the linker provided table looks valid. */
+       if (header_size <= 4
+           || header_start[0] != 1
+           || (void *)read_pointer(&ptr, end, header_start[1]) != table_start
+           || header_start[2] == DW_EH_PE_omit
+           || read_pointer(&ptr, end, header_start[2]) <= 0
+           || header_start[3] == DW_EH_PE_omit)
+               header_start = NULL;
+       table->hdrsz = header_size;
+       smp_wmb();
+       table->header = header_start;
        table->link = NULL;
        table->name = name;
 }
@@ -169,7 +193,143 @@ void __init unwind_init(void)
        init_unwind_table(&root_table, "kernel",
                          _text, _end - _text,
                          NULL, 0,
-                         __start_unwind, __end_unwind - __start_unwind);
+                         __start_unwind, __end_unwind - __start_unwind,
+                         __start_unwind_hdr, __end_unwind_hdr - __start_unwind_hdr);
+}
+
+static const u32 bad_cie, not_fde;
+static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *);
+static signed fde_pointer_type(const u32 *cie);
+
+struct eh_frame_hdr_table_entry {
+       unsigned long start, fde;
+};
+
+static int cmp_eh_frame_hdr_table_entries(const void *p1, const void *p2)
+{
+       const struct eh_frame_hdr_table_entry *e1 = p1;
+       const struct eh_frame_hdr_table_entry *e2 = p2;
+
+       return (e1->start > e2->start) - (e1->start < e2->start);
+}
+
+static void swap_eh_frame_hdr_table_entries(void *p1, void *p2, int size)
+{
+       struct eh_frame_hdr_table_entry *e1 = p1;
+       struct eh_frame_hdr_table_entry *e2 = p2;
+       unsigned long v;
+
+       v = e1->start;
+       e1->start = e2->start;
+       e2->start = v;
+       v = e1->fde;
+       e1->fde = e2->fde;
+       e2->fde = v;
+}
+
+static void __init setup_unwind_table(struct unwind_table *table,
+                                       void *(*alloc)(unsigned long))
+{
+       const u8 *ptr;
+       unsigned long tableSize = table->size, hdrSize;
+       unsigned n;
+       const u32 *fde;
+       struct {
+               u8 version;
+               u8 eh_frame_ptr_enc;
+               u8 fde_count_enc;
+               u8 table_enc;
+               unsigned long eh_frame_ptr;
+               unsigned int fde_count;
+               struct eh_frame_hdr_table_entry table[];
+       } __attribute__((__packed__)) *header;
+
+       if (table->header)
+               return;
+
+       if (table->hdrsz)
+               printk(KERN_WARNING ".eh_frame_hdr for '%s' present but unusable\n",
+                      table->name);
+
+       if (tableSize & (sizeof(*fde) - 1))
+               return;
+
+       for (fde = table->address, n = 0;
+            tableSize > sizeof(*fde) && tableSize - sizeof(*fde) >= *fde;
+            tableSize -= sizeof(*fde) + *fde, fde += 1 + *fde / sizeof(*fde)) {
+               const u32 *cie = cie_for_fde(fde, table);
+               signed ptrType;
+
+               if (cie == &not_fde)
+                       continue;
+               if (cie == NULL
+                   || cie == &bad_cie
+                   || (ptrType = fde_pointer_type(cie)) < 0)
+                       return;
+               ptr = (const u8 *)(fde + 2);
+               if (!read_pointer(&ptr,
+                                 (const u8 *)(fde + 1) + *fde,
+                                 ptrType))
+                       return;
+               ++n;
+       }
+
+       if (tableSize || !n)
+               return;
+
+       hdrSize = 4 + sizeof(unsigned long) + sizeof(unsigned int)
+               + 2 * n * sizeof(unsigned long);
+       header = alloc(hdrSize);
+       if (!header)
+               return;
+       header->version          = 1;
+       header->eh_frame_ptr_enc = DW_EH_PE_abs|DW_EH_PE_native;
+       header->fde_count_enc    = DW_EH_PE_abs|DW_EH_PE_data4;
+       header->table_enc        = DW_EH_PE_abs|DW_EH_PE_native;
+       put_unaligned((unsigned long)table->address, &header->eh_frame_ptr);
+       BUILD_BUG_ON(offsetof(typeof(*header), fde_count)
+                    % __alignof(typeof(header->fde_count)));
+       header->fde_count        = n;
+
+       BUILD_BUG_ON(offsetof(typeof(*header), table)
+                    % __alignof(typeof(*header->table)));
+       for (fde = table->address, tableSize = table->size, n = 0;
+            tableSize;
+            tableSize -= sizeof(*fde) + *fde, fde += 1 + *fde / sizeof(*fde)) {
+               const u32 *cie = fde + 1 - fde[1] / sizeof(*fde);
+
+               if (!fde[1])
+                       continue; /* this is a CIE */
+               ptr = (const u8 *)(fde + 2);
+               header->table[n].start = read_pointer(&ptr,
+                                                     (const u8 *)(fde + 1) + *fde,
+                                                     fde_pointer_type(cie));
+               header->table[n].fde = (unsigned long)fde;
+               ++n;
+       }
+       WARN_ON(n != header->fde_count);
+
+       sort(header->table,
+            n,
+            sizeof(*header->table),
+            cmp_eh_frame_hdr_table_entries,
+            swap_eh_frame_hdr_table_entries);
+
+       table->hdrsz = hdrSize;
+       smp_wmb();
+       table->header = (const void *)header;
+}
+
+static void *__init balloc(unsigned long sz)
+{
+       return __alloc_bootmem_nopanic(sz,
+                                      sizeof(unsigned int),
+                                      __pa(MAX_DMA_ADDRESS));
+}
+
+void __init unwind_setup(void)
+{
+       setup_unwind_table(&root_table, balloc);
 }
 
 #ifdef CONFIG_MODULES
@@ -193,7 +353,8 @@ void *unwind_add_table(struct module *module,
        init_unwind_table(table, module->name,
                          module->module_core, module->core_size,
                          module->module_init, module->init_size,
-                         table_start, table_size);
+                         table_start, table_size,
+                         NULL, 0);
 
        if (last_table)
                last_table->link = table;
@@ -303,6 +464,26 @@ static sleb128_t get_sleb128(const u8 **pcur, const u8 *end)
        return value;
 }
 
+static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *table)
+{
+       const u32 *cie;
+
+       if (!*fde || (*fde & (sizeof(*fde) - 1)))
+               return &bad_cie;
+       if (!fde[1])
+               return &not_fde; /* this is a CIE */
+       if ((fde[1] & (sizeof(*fde) - 1))
+           || fde[1] > (unsigned long)(fde + 1) - (unsigned long)table->address)
+               return NULL; /* this is not a valid FDE */
+       cie = fde + 1 - fde[1] / sizeof(*fde);
+       if (*cie <= sizeof(*cie) + 4
+           || *cie >= fde[1] - sizeof(*fde)
+           || (*cie & (sizeof(*cie) - 1))
+           || cie[1])
+               return NULL; /* this is not a (valid) CIE */
+       return cie;
+}
+
 static unsigned long read_pointer(const u8 **pLoc,
                                   const void *end,
                                   signed ptrType)
@@ -610,49 +791,108 @@ int unwind(struct unwind_frame_info *frame)
        unsigned i;
        signed ptrType = -1;
        uleb128_t retAddrReg = 0;
-       struct unwind_table *table;
+       const struct unwind_table *table;
        struct unwind_state state;
 
        if (UNW_PC(frame) == 0)
                return -EINVAL;
        if ((table = find_table(pc)) != NULL
            && !(table->size & (sizeof(*fde) - 1))) {
-               unsigned long tableSize = table->size;
-
-               for (fde = table->address;
-                    tableSize > sizeof(*fde) && tableSize - sizeof(*fde) >= *fde;
-                    tableSize -= sizeof(*fde) + *fde,
-                    fde += 1 + *fde / sizeof(*fde)) {
-                       if (!*fde || (*fde & (sizeof(*fde) - 1)))
-                               break;
-                       if (!fde[1])
-                               continue; /* this is a CIE */
-                       if ((fde[1] & (sizeof(*fde) - 1))
-                           || fde[1] > (unsigned long)(fde + 1)
-                                       - (unsigned long)table->address)
-                               continue; /* this is not a valid FDE */
-                       cie = fde + 1 - fde[1] / sizeof(*fde);
-                       if (*cie <= sizeof(*cie) + 4
-                           || *cie >= fde[1] - sizeof(*fde)
-                           || (*cie & (sizeof(*cie) - 1))
-                           || cie[1]
-                           || (ptrType = fde_pointer_type(cie)) < 0) {
-                               cie = NULL; /* this is not a (valid) CIE */
-                               continue;
+               const u8 *hdr = table->header;
+               unsigned long tableSize;
+
+               smp_rmb();
+               if (hdr && hdr[0] == 1) {
+                       switch(hdr[3] & DW_EH_PE_FORM) {
+                       case DW_EH_PE_native: tableSize = sizeof(unsigned long); break;
+                       case DW_EH_PE_data2: tableSize = 2; break;
+                       case DW_EH_PE_data4: tableSize = 4; break;
+                       case DW_EH_PE_data8: tableSize = 8; break;
+                       default: tableSize = 0; break;
+                       }
+                       ptr = hdr + 4;
+                       end = hdr + table->hdrsz;
+                       if (tableSize
+                           && read_pointer(&ptr, end, hdr[1])
+                              == (unsigned long)table->address
+                           && (i = read_pointer(&ptr, end, hdr[2])) > 0
+                           && i == (end - ptr) / (2 * tableSize)
+                           && !((end - ptr) % (2 * tableSize))) {
+                               do {
+                                       const u8 *cur = ptr + (i / 2) * (2 * tableSize);
+
+                                       startLoc = read_pointer(&cur,
+                                                               cur + tableSize,
+                                                               hdr[3]);
+                                       if (pc < startLoc)
+                                               i /= 2;
+                                       else {
+                                               ptr = cur - tableSize;
+                                               i = (i + 1) / 2;
+                                       }
+                               } while (startLoc && i > 1);
+                               if (i == 1
+                                   && (startLoc = read_pointer(&ptr,
+                                                               ptr + tableSize,
+                                                               hdr[3])) != 0
+                                   && pc >= startLoc)
+                                       fde = (void *)read_pointer(&ptr,
+                                                                  ptr + tableSize,
+                                                                  hdr[3]);
                        }
+               }
+
+               if (fde != NULL) {
+                       cie = cie_for_fde(fde, table);
                        ptr = (const u8 *)(fde + 2);
-                       startLoc = read_pointer(&ptr,
-                                               (const u8 *)(fde + 1) + *fde,
-                                               ptrType);
-                       endLoc = startLoc
-                                + read_pointer(&ptr,
-                                               (const u8 *)(fde + 1) + *fde,
-                                               ptrType & DW_EH_PE_indirect
-                                               ? ptrType
-                                               : ptrType & (DW_EH_PE_FORM|DW_EH_PE_signed));
-                       if (pc >= startLoc && pc < endLoc)
-                               break;
-                       cie = NULL;
+                       if(cie != NULL
+                          && cie != &bad_cie
+                          && cie != &not_fde
+                          && (ptrType = fde_pointer_type(cie)) >= 0
+                          && read_pointer(&ptr,
+                                          (const u8 *)(fde + 1) + *fde,
+                                          ptrType) == startLoc) {
+                               if (!(ptrType & DW_EH_PE_indirect))
+                                       ptrType &= DW_EH_PE_FORM|DW_EH_PE_signed;
+                               endLoc = startLoc
+                                        + read_pointer(&ptr,
+                                                       (const u8 *)(fde + 1) + *fde,
+                                                       ptrType);
+                               if(pc >= endLoc)
+                                       fde = NULL;
+                       } else
+                               fde = NULL;
+               }
+               if (fde == NULL) {
+                       for (fde = table->address, tableSize = table->size;
+                            cie = NULL, tableSize > sizeof(*fde)
+                            && tableSize - sizeof(*fde) >= *fde;
+                            tableSize -= sizeof(*fde) + *fde,
+                            fde += 1 + *fde / sizeof(*fde)) {
+                               cie = cie_for_fde(fde, table);
+                               if (cie == &bad_cie) {
+                                       cie = NULL;
+                                       break;
+                               }
+                               if (cie == NULL
+                                   || cie == &not_fde
+                                   || (ptrType = fde_pointer_type(cie)) < 0)
+                                       continue;
+                               ptr = (const u8 *)(fde + 2);
+                               startLoc = read_pointer(&ptr,
+                                                       (const u8 *)(fde + 1) + *fde,
+                                                       ptrType);
+                               if (!startLoc)
+                                       continue;
+                               if (!(ptrType & DW_EH_PE_indirect))
+                                       ptrType &= DW_EH_PE_FORM|DW_EH_PE_signed;
+                               endLoc = startLoc
+                                        + read_pointer(&ptr,
+                                                       (const u8 *)(fde + 1) + *fde,
+                                                       ptrType);
+                               if (pc >= startLoc && pc < endLoc)
+                                       break;
+                       }
                }
        }
        if (cie != NULL) {
index ebd425c2e2a7fe8402733d1a5166ca2a69fa6678..f5fc45472d5ca77d3406b9ced195c45fde97ca78 100644 (file)
@@ -1689,6 +1689,8 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
        for (pfn = start_pfn; pfn < end_pfn; pfn++) {
                if (!early_pfn_valid(pfn))
                        continue;
+               if (!early_pfn_in_nid(pfn, nid))
+                       continue;
                page = pfn_to_page(pfn);
                set_page_links(page, zone, nid, pfn);
                init_page_count(page);
index 266449d604bd170c4c1656318c1ded64fcc5404a..84c631f30741016e0e73602129ed6c33d6ca88f9 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3152,12 +3152,15 @@ void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)
        struct zone **z;
        void *obj = NULL;
 
-       for (z = zonelist->zones; *z && !obj; z++)
+       for (z = zonelist->zones; *z && !obj; z++) {
+               int nid = zone_to_nid(*z);
+
                if (zone_idx(*z) <= ZONE_NORMAL &&
-                               cpuset_zone_allowed(*z, flags))
+                               cpuset_zone_allowed(*z, flags) &&
+                               cache->nodelists[nid])
                        obj = __cache_alloc_node(cache,
-                                       flags | __GFP_THISNODE,
-                                       zone_to_nid(*z));
+                                       flags | __GFP_THISNODE, nid);
+       }
        return obj;
 }
 
index c0a4ae28fcfab23025ffdaf079dfd9199c8aa8dd..62f6ed1f2f98c9c5c25d70759f87d60e3e4f699d 100644 (file)
@@ -141,7 +141,7 @@ static struct class atm_class = {
 int atm_register_sysfs(struct atm_dev *adev)
 {
        struct class_device *cdev = &adev->class_dev;
-       int i, err;
+       int i, j, err;
 
        cdev->class = &atm_class;
        class_set_devdata(cdev, adev);
@@ -151,10 +151,19 @@ int atm_register_sysfs(struct atm_dev *adev)
        if (err < 0)
                return err;
 
-       for (i = 0; atm_attrs[i]; i++)
-               class_device_create_file(cdev, atm_attrs[i]);
+       for (i = 0; atm_attrs[i]; i++) {
+               err = class_device_create_file(cdev, atm_attrs[i]);
+               if (err)
+                       goto err_out;
+       }
 
        return 0;
+
+err_out:
+       for (j = 0; j < i; j++)
+               class_device_remove_file(cdev, atm_attrs[j]);
+       class_device_del(cdev);
+       return err;
 }
 
 void atm_unregister_sysfs(struct atm_dev *adev)
index e2a095d0fd803796b2cca1673952bf91b5226ede..ef8919cca74b5467ad60a24485e5eef493421cea 100644 (file)
@@ -4,15 +4,15 @@ menu "DCCP Configuration (EXPERIMENTAL)"
 config IP_DCCP
        tristate "The DCCP Protocol (EXPERIMENTAL)"
        ---help---
-         Datagram Congestion Control Protocol
+         Datagram Congestion Control Protocol (RFC 4340)
 
-         From draft-ietf-dccp-spec-11 <http://www.icir.org/kohler/dcp/draft-ietf-dccp-spec-11.txt>.
+         From http://www.ietf.org/rfc/rfc4340.txt:
 
          The Datagram Congestion Control Protocol (DCCP) is a transport
          protocol that implements bidirectional, unicast connections of
          congestion-controlled, unreliable datagrams. It should be suitable
          for use by applications such as streaming media, Internet telephony,
-         and on-line games
+         and on-line games.
 
          To compile this protocol support as a module, choose M here: the
          module will be called dccp.
index 4d176d33983fef29db3a34c24b1f22bd4e72d9e7..f8208874ac7d79bc3f4c3516e54d7e7e87514c90 100644 (file)
@@ -113,7 +113,7 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb)
 
        memcpy(to, from, len);
        /*
-        *      From draft-ietf-dccp-spec-11.txt:
+        *      From RFC 4340, A.2:
         *
         *      For each acknowledgement it sends, the HC-Receiver will add an
         *      acknowledgement record.  ack_seqno will equal the HC-Receiver
@@ -224,7 +224,7 @@ static inline int dccp_ackvec_set_buf_head_state(struct dccp_ackvec *av,
 }
 
 /*
- * Implements the draft-ietf-dccp-spec-11.txt Appendix A
+ * Implements the RFC 4340, Appendix A
  */
 int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk,
                    const u64 ackno, const u8 state)
@@ -237,7 +237,7 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk,
         * We may well decide to do buffer compression, etc, but for now lets
         * just drop.
         *
-        * From Appendix A:
+        * From Appendix A.1.1 (`New Packets'):
         *
         *      Of course, the circular buffer may overflow, either when the
         *      HC-Sender is sending data at a very high rate, when the
@@ -274,9 +274,9 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk,
                /*
                 * A.1.2.  Old Packets
                 *
-                *      When a packet with Sequence Number S arrives, and
-                *      S <= buf_ackno, the HC-Receiver will scan the table
-                *      for the byte corresponding to S. (Indexing structures
+                *      When a packet with Sequence Number S <= buf_ackno
+                *      arrives, the HC-Receiver will scan the table for
+                *      the byte corresponding to S. (Indexing structures
                 *      could reduce the complexity of this scan.)
                 */
                u64 delta = dccp_delta_seqno(ackno, av->dccpav_buf_ackno);
index 2424effac7f690d4c7679f18c70c9cb14ee71ea6..cf8f20ce23a9cf76ad5b58b2277e2553ad924777 100644 (file)
@@ -28,8 +28,7 @@
 
 /** struct dccp_ackvec - ack vector
  *
- * This data structure is the one defined in the DCCP draft
- * Appendix A.
+ * This data structure is the one defined in RFC 4340, Appendix A.
  *
  * @dccpav_buf_head - circular buffer head
  * @dccpav_buf_tail - circular buffer tail
index 32752f7504476013933574f754c87d87f2bf935f..8533dabfb9f8200468dd3d18b88436cfd969f00a 100644 (file)
@@ -22,11 +22,11 @@ config IP_DCCP_CCID2
          for lost packets, would prefer CCID 2 to CCID 3.  On-line games may
          also prefer CCID 2.
 
-         CCID 2 is further described in:
-         http://www.icir.org/kohler/dccp/draft-ietf-dccp-ccid2-10.txt
+         CCID 2 is further described in RFC 4341,
+         http://www.ietf.org/rfc/rfc4341.txt
 
-         This text was extracted from:
-         http://www.icir.org/kohler/dccp/draft-ietf-dccp-spec-13.txt
+         This text was extracted from RFC 4340 (sec. 10.1),
+         http://www.ietf.org/rfc/rfc4340.txt
 
          If in doubt, say M.
 
@@ -53,15 +53,14 @@ config IP_DCCP_CCID3
          suitable than CCID 2 for applications such streaming media where a
          relatively smooth sending rate is of importance.
 
-         CCID 3 is further described in:
-
-         http://www.icir.org/kohler/dccp/draft-ietf-dccp-ccid3-11.txt.
+         CCID 3 is further described in RFC 4342,
+         http://www.ietf.org/rfc/rfc4342.txt
 
          The TFRC congestion control algorithms were initially described in
          RFC 3448.
 
-         This text was extracted from:
-         http://www.icir.org/kohler/dccp/draft-ietf-dccp-spec-13.txt
+         This text was extracted from RFC 4340 (sec. 10.2),
+         http://www.ietf.org/rfc/rfc4340.txt
          
          If in doubt, say M.
 
index 2efb505aeb3551837f3780f44c4bd981687c5c43..2fbb84bf4e26850d5d4c6094c633a810c677da3c 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 /*
- * This implementation should follow: draft-ietf-dccp-ccid2-10.txt
+ * This implementation should follow RFC 4341
  *
  * BUGS:
  * - sequence number wrapping
index 67d2dc0e7c678e62dd39993c1bf6ae2e724aa64f..cec23ad286de52bed053a873db50d8bc71fcf09d 100644 (file)
@@ -379,8 +379,7 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more, int len)
                packet->dccphtx_seqno  = dp->dccps_gss;
                /*
                 * Check if win_count have changed
-                * Algorithm in "8.1. Window Counter Valuer" in
-                * draft-ietf-dccp-ccid3-11.txt
+                * Algorithm in "8.1. Window Counter Value" in RFC 4342.
                 */
                quarter_rtt = timeval_delta(&now, &hctx->ccid3hctx_t_last_win_count);
                if (likely(hctx->ccid3hctx_rtt > 8))
index 0a21be437ed326d227a3e8a590048987c91f5055..272e8584564e68bb06a59f21a511ae413efa971e 100644 (file)
@@ -50,7 +50,7 @@ extern void dccp_time_wait(struct sock *sk, int state, int timeo);
 #define DCCP_TIMEWAIT_LEN (60 * HZ) /* how long to wait to destroy TIME-WAIT
                                     * state, about 60 seconds */
 
-/* draft-ietf-dccp-spec-11.txt initial RTO value */
+/* RFC 1122, 4.2.3.1 initial RTO value */
 #define DCCP_TIMEOUT_INIT ((unsigned)(3 * HZ))
 
 /* Maximal interval between probes for local resources.  */
index 7f9dc6ac58c95429ff1b9b311a99f1a2c2488ca1..1d24881ac0abc49ab1f3d35fd5a8b850daed6bad 100644 (file)
@@ -216,11 +216,11 @@ send_sync:
                dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq,
                               DCCP_PKT_SYNCACK);
                /*
-                * From the draft:
+                * From RFC 4340, sec. 5.7
                 *
                 * As with DCCP-Ack packets, DCCP-Sync and DCCP-SyncAck packets
                 * MAY have non-zero-length application data areas, whose
-                * contents receivers MUST ignore.
+                * contents receivers MUST ignore.
                 */
                goto discard;
        }
index 7e746c4c1688f41293ec6f67dcc512092854260c..e08e7688a263c82d0aca759a0bf68afd30b12392 100644 (file)
@@ -183,7 +183,7 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk,
                dccp_sync_mss(sk, mtu);
 
                /*
-                * From: draft-ietf-dccp-spec-11.txt
+                * From RFC 4340, sec. 14.1:
                 *
                 *      DCCP-Sync packets are the best choice for upward
                 *      probing, since DCCP-Sync probes do not risk application
@@ -449,6 +449,8 @@ static inline u64 dccp_v4_init_sequence(const struct sock *sk,
                                           dccp_hdr(skb)->dccph_sport);
 }
 
+static struct request_sock_ops dccp_request_sock_ops;
+
 int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
 {
        struct inet_request_sock *ireq;
@@ -489,7 +491,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
        if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
                goto drop;
 
-       req = reqsk_alloc(sk->sk_prot->rsk_prot);
+       req = reqsk_alloc(&dccp_request_sock_ops);
        if (req == NULL)
                goto drop;
 
@@ -731,7 +733,7 @@ static void dccp_v4_ctl_send_reset(struct sk_buff *rxskb)
        dccp_hdr_reset(skb)->dccph_reset_code =
                                DCCP_SKB_CB(rxskb)->dccpd_reset_code;
 
-       /* See "8.3.1. Abnormal Termination" in draft-ietf-dccp-spec-11 */
+       /* See "8.3.1. Abnormal Termination" in RFC 4340 */
        seqno = 0;
        if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ)
                dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1);
index 7171a78671aa9b0e73732db88e5bee406b5ec445..eb0ff7ab05ed3a1d4062522cf6f58846c82e3fcd 100644 (file)
@@ -550,7 +550,7 @@ static void dccp_v6_ctl_send_reset(struct sk_buff *rxskb)
        dccp_hdr_reset(skb)->dccph_reset_code =
                                DCCP_SKB_CB(rxskb)->dccpd_reset_code;
 
-       /* See "8.3.1. Abnormal Termination" in draft-ietf-dccp-spec-11 */
+       /* See "8.3.1. Abnormal Termination" in RFC 4340 */
        seqno = 0;
        if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ)
                dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1);
@@ -672,7 +672,6 @@ static struct sock *dccp_v6_hnd_req(struct sock *sk,struct sk_buff *skb)
 
 static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
 {
-       struct inet_request_sock *ireq;
        struct dccp_sock dp;
        struct request_sock *req;
        struct dccp_request_sock *dreq;
@@ -701,7 +700,7 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
        if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
                goto drop;
 
-       req = inet6_reqsk_alloc(sk->sk_prot->rsk_prot);
+       req = inet6_reqsk_alloc(&dccp6_request_sock_ops);
        if (req == NULL)
                goto drop;
 
@@ -713,7 +712,6 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
                goto drop_and_free;
 
        ireq6 = inet6_rsk(req);
-       ireq = inet_rsk(req);
        ipv6_addr_copy(&ireq6->rmt_addr, &skb->nh.ipv6h->saddr);
        ipv6_addr_copy(&ireq6->loc_addr, &skb->nh.ipv6h->daddr);
        req->rcv_wnd    = dccp_feat_default_sequence_window;
@@ -997,6 +995,10 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
        if (sk->sk_state == DCCP_OPEN) { /* Fast path */
                if (dccp_rcv_established(sk, skb, dccp_hdr(skb), skb->len))
                        goto reset;
+               if (opt_skb) {
+                       /* This is where we would goto ipv6_pktoptions. */
+                       __kfree_skb(opt_skb);
+               }
                return 0;
        }
 
@@ -1021,6 +1023,10 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
 
        if (dccp_rcv_state_process(sk, skb, dccp_hdr(skb), skb->len))
                goto reset;
+       if (opt_skb) {
+               /* This is where we would goto ipv6_pktoptions. */
+               __kfree_skb(opt_skb);
+       }
        return 0;
 
 reset:
index 07a34696ac976529beeca538352c613dd799bd8c..fb0db1f7cd7bcc0fb28caa62be8eafa458bfe3e7 100644 (file)
@@ -215,7 +215,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
                                      elapsed_time);
                        break;
                        /*
-                        * From draft-ietf-dccp-spec-11.txt:
+                        * From RFC 4340, sec. 10.3:
                         *
                         *      Option numbers 128 through 191 are for
                         *      options sent from the HC-Sender to the
index f7e84e9d13ad347d7e56a5d9db76b4d70744d8c7..a64be6cdf078f3226d3478ceb700964441073107 100644 (file)
@@ -32,6 +32,7 @@ config IEEE80211_CRYPT_WEP
        depends on IEEE80211
        select CRYPTO
        select CRYPTO_ARC4
+       select CRYPTO_ECB
        select CRC32
        ---help---
        Include software based cipher suites in support of IEEE
@@ -58,6 +59,7 @@ config IEEE80211_CRYPT_TKIP
        depends on IEEE80211 && NET_RADIO
        select CRYPTO
        select CRYPTO_MICHAEL_MIC
+       select CRYPTO_ECB
        select CRC32
        ---help---
        Include software based cipher suites in support of IEEE 802.11i
index f8ce8475915966c7d10abbec1542f71b1ac10d0d..955a07abb91df159ff5ba7765e45079f475ff609 100644 (file)
@@ -420,7 +420,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 {
        struct arphdr *rarp;
        unsigned char *rarp_ptr;
-       unsigned long sip, tip;
+       u32 sip, tip;
        unsigned char *sha, *tha;               /* s for "source", t for "target" */
        struct ic_device *d;
 
index 8fcae7a6510b9fdeb793bfc395de458daee4ddc2..f98ca30d7c1f300377daf7f51d49afc2e4af5c21 100644 (file)
@@ -169,7 +169,6 @@ static __inline__ void rt6_release(struct rt6_info *rt)
 
 static struct fib6_table fib6_main_tbl = {
        .tb6_id         = RT6_TABLE_MAIN,
-       .tb6_lock       = RW_LOCK_UNLOCKED,
        .tb6_root       = {
                .leaf           = &ip6_null_entry,
                .fn_flags       = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO,
@@ -187,6 +186,12 @@ static void fib6_link_table(struct fib6_table *tb)
 {
        unsigned int h;
 
+       /*
+        * Initialize table lock at a single place to give lockdep a key,
+        * tables aren't visible prior to being linked to the list.
+        */
+       rwlock_init(&tb->tb6_lock);
+
        h = tb->tb6_id & (FIB_TABLE_HASHSZ - 1);
 
        /*
@@ -199,7 +204,6 @@ static void fib6_link_table(struct fib6_table *tb)
 #ifdef CONFIG_IPV6_MULTIPLE_TABLES
 static struct fib6_table fib6_local_tbl = {
        .tb6_id         = RT6_TABLE_LOCAL,
-       .tb6_lock       = RW_LOCK_UNLOCKED,
        .tb6_root       = {
                .leaf           = &ip6_null_entry,
                .fn_flags       = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO,
@@ -213,7 +217,6 @@ static struct fib6_table *fib6_alloc_table(u32 id)
        table = kzalloc(sizeof(*table), GFP_ATOMIC);
        if (table != NULL) {
                table->tb6_id = id;
-               table->tb6_lock = RW_LOCK_UNLOCKED;
                table->tb6_root.leaf = &ip6_null_entry;
                table->tb6_root.fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO;
        }
index 4ab368fa0b8f09af141bf04cfda02849ea82a19d..53bf977cca63424072107de6e9608e6fa021fcab 100644 (file)
@@ -111,7 +111,7 @@ ip6_packet_match(const struct sk_buff *skb,
                 const char *outdev,
                 const struct ip6t_ip6 *ip6info,
                 unsigned int *protoff,
-                int *fragoff)
+                int *fragoff, int *hotdrop)
 {
        size_t i;
        unsigned long ret;
@@ -169,9 +169,11 @@ ip6_packet_match(const struct sk_buff *skb,
                unsigned short _frag_off;
 
                protohdr = ipv6_find_hdr(skb, protoff, -1, &_frag_off);
-               if (protohdr < 0)
+               if (protohdr < 0) {
+                       if (_frag_off == 0)
+                               *hotdrop = 1;
                        return 0;
-
+               }
                *fragoff = _frag_off;
 
                dprintf("Packet protocol %hi ?= %s%hi.\n",
@@ -290,7 +292,7 @@ ip6t_do_table(struct sk_buff **pskb,
                IP_NF_ASSERT(e);
                IP_NF_ASSERT(back);
                if (ip6_packet_match(*pskb, indev, outdev, &e->ipv6,
-                       &protoff, &offset)) {
+                       &protoff, &offset, &hotdrop)) {
                        struct ip6t_entry_target *t;
 
                        if (IP6T_MATCH_ITERATE(e, do_match,
@@ -1438,6 +1440,9 @@ static void __exit ip6_tables_fini(void)
  * If target header is found, its offset is set in *offset and return protocol
  * number. Otherwise, return -1.
  *
+ * If the first fragment doesn't contain the final protocol header or
+ * NEXTHDR_NONE it is considered invalid.
+ *
  * Note that non-1st fragment is special case that "the protocol number
  * of last header" is "next header" field in Fragment header. In this case,
  * *offset is meaningless and fragment offset is stored in *fragoff if fragoff
@@ -1461,12 +1466,12 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
                if ((!ipv6_ext_hdr(nexthdr)) || nexthdr == NEXTHDR_NONE) {
                        if (target < 0)
                                break;
-                       return -1;
+                       return -ENOENT;
                }
 
                hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr);
                if (hp == NULL)
-                       return -1;
+                       return -EBADMSG;
                if (nexthdr == NEXTHDR_FRAGMENT) {
                        unsigned short _frag_off, *fp;
                        fp = skb_header_pointer(skb,
@@ -1475,7 +1480,7 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
                                                sizeof(_frag_off),
                                                &_frag_off);
                        if (fp == NULL)
-                               return -1;
+                               return -EBADMSG;
 
                        _frag_off = ntohs(*fp) & ~0x7;
                        if (_frag_off) {
@@ -1486,7 +1491,7 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
                                                *fragoff = _frag_off;
                                        return hp->nexthdr;
                                }
-                               return -1;
+                               return -ENOENT;
                        }
                        hdrlen = 8;
                } else if (nexthdr == NEXTHDR_AUTH)
index ec1b1608156c53eed8ff6fb5781654c61285a925..46486645eb75251da249a5170e7adc0c11023759 100644 (file)
@@ -54,9 +54,14 @@ match(const struct sk_buff *skb,
        const struct ip6t_ah *ahinfo = matchinfo;
        unsigned int ptr;
        unsigned int hdrlen = 0;
+       int err;
 
-       if (ipv6_find_hdr(skb, &ptr, NEXTHDR_AUTH, NULL) < 0)
+       err = ipv6_find_hdr(skb, &ptr, NEXTHDR_AUTH, NULL);
+       if (err < 0) {
+               if (err != -ENOENT)
+                       *hotdrop = 1;
                return 0;
+       }
 
        ah = skb_header_pointer(skb, ptr, sizeof(_ah), &_ah);
        if (ah == NULL) {
index 78d9c8b9e28a55bafc6f211d3eb8ac8113579f7f..cd22eaaccdca9547a90d9679dd299d971938c795 100644 (file)
@@ -52,9 +52,14 @@ match(const struct sk_buff *skb,
        struct frag_hdr _frag, *fh;
        const struct ip6t_frag *fraginfo = matchinfo;
        unsigned int ptr;
+       int err;
 
-       if (ipv6_find_hdr(skb, &ptr, NEXTHDR_FRAGMENT, NULL) < 0)
+       err = ipv6_find_hdr(skb, &ptr, NEXTHDR_FRAGMENT, NULL);
+       if (err < 0) {
+               if (err != -ENOENT)
+                       *hotdrop = 1;
                return 0;
+       }
 
        fh = skb_header_pointer(skb, ptr, sizeof(_frag), &_frag);
        if (fh == NULL) {
index d32a205e3af298a0673854efde48eb4b7eaba7eb..3f25babe044068625a95ea3886b05b7b7365482f 100644 (file)
@@ -65,9 +65,14 @@ match(const struct sk_buff *skb,
        u8 _opttype, *tp = NULL;
        u8 _optlen, *lp = NULL;
        unsigned int optlen;
+       int err;
 
-       if (ipv6_find_hdr(skb, &ptr, match->data, NULL) < 0)
+       err = ipv6_find_hdr(skb, &ptr, match->data, NULL);
+       if (err < 0) {
+               if (err != -ENOENT)
+                       *hotdrop = 1;
                return 0;
+       }
 
        oh = skb_header_pointer(skb, ptr, sizeof(_optsh), &_optsh);
        if (oh == NULL) {
index bcb2e168a5bc9e83491ac84009faf341b7f624a1..54d7d14134fdae695496ed150c6c241431075789 100644 (file)
@@ -58,9 +58,14 @@ match(const struct sk_buff *skb,
        unsigned int hdrlen = 0;
        unsigned int ret = 0;
        struct in6_addr *ap, _addr;
+       int err;
 
-       if (ipv6_find_hdr(skb, &ptr, NEXTHDR_ROUTING, NULL) < 0)
+       err = ipv6_find_hdr(skb, &ptr, NEXTHDR_ROUTING, NULL);
+       if (err < 0) {
+               if (err != -ENOENT)
+                       *hotdrop = 1;
                return 0;
+       }
 
        rh = skb_header_pointer(skb, ptr, sizeof(_route), &_route);
        if (rh == NULL) {
index 45939bafbdf894dfcb61a0ed993d1d79204aa5a8..ef8874babf6ae8c7c23ae26fe1baaea03334dd2f 100644 (file)
@@ -170,6 +170,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
                return NET_XMIT_BYPASS;
        }
 
+       skb_orphan(skb);
+
        /*
         * If we need to duplicate packet, then re-insert at top of the
         * qdisc tree, since parent queuer expects that only one
index 84bbf8474f3eb659fea321cac5629ff1e96a0d48..899de9ed22a678d8b8193f141f0bf24799bc1ab7 100644 (file)
@@ -505,6 +505,14 @@ __xfrm_state_locate(struct xfrm_state *x, int use_spi, int family)
                                                  x->id.proto, family);
 }
 
+static void xfrm_hash_grow_check(int have_hash_collision)
+{
+       if (have_hash_collision &&
+           (xfrm_state_hmask + 1) < xfrm_state_hashmax &&
+           xfrm_state_num > xfrm_state_hmask)
+               schedule_work(&xfrm_hash_work);
+}
+
 struct xfrm_state *
 xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, 
                struct flowi *fl, struct xfrm_tmpl *tmpl,
@@ -598,6 +606,8 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
                        x->lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES;
                        x->timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ;
                        add_timer(&x->timer);
+                       xfrm_state_num++;
+                       xfrm_hash_grow_check(x->bydst.next != NULL);
                } else {
                        x->km.state = XFRM_STATE_DEAD;
                        xfrm_state_put(x);
@@ -614,14 +624,6 @@ out:
        return x;
 }
 
-static void xfrm_hash_grow_check(int have_hash_collision)
-{
-       if (have_hash_collision &&
-           (xfrm_state_hmask + 1) < xfrm_state_hashmax &&
-           xfrm_state_num > xfrm_state_hmask)
-               schedule_work(&xfrm_hash_work);
-}
-
 static void __xfrm_state_insert(struct xfrm_state *x)
 {
        unsigned int h;
index 41277963f47a811eece19639e1dac22821fd4b04..2e1141623147887ffa2f91bb6e53b362a0a5f821 100644 (file)
@@ -921,6 +921,8 @@ static int init_section_ref_ok(const char *name)
                ".fixup",
                ".smp_locks",
                ".plt",  /* seen on ARCH=um build on x86_64. Harmless */
+               "__ftr_fixup",          /* powerpc cpu feature fixup */
+               "__fw_ftr_fixup",       /* powerpc firmware feature fixup */
                NULL
        };
        /* Start of section names */
index 6973a9686b679c6f3fc7a5415a1795ce043e6a76..48ef0a09a7a71ad964aac00a79404945e6102d22 100644 (file)
@@ -1018,10 +1018,6 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
        }
        switch (info->type) {
        case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
-               private_size = sizeof(char);
-               if (info->count > 128)
-                       return -EINVAL;
-               break;
        case SNDRV_CTL_ELEM_TYPE_INTEGER:
                private_size = sizeof(long);
                if (info->count > 128)
index e43662b33f16e6ce7bf3b975175639194d6ced3f..0b4aab3225e5270a998e77e06e7821973b3e2146 100644 (file)
@@ -120,7 +120,10 @@ int snd_iprintf(struct snd_info_buffer *buffer, char *fmt,...)
        len = buffer->len - buffer->size;
        va_start(args, fmt);
        for (;;) {
-               res = vsnprintf(buffer->buffer + buffer->curr, len, fmt, args);
+               va_list ap;
+               va_copy(ap, args);
+               res = vsnprintf(buffer->buffer + buffer->curr, len, fmt, ap);
+               va_end(ap);
                if (res < len)
                        break;
                err = resize_info_buffer(buffer, buffer->len + PAGE_SIZE);
index 557c4de229607bb9d8f5c1eaee83c4f7ee0fbd6d..57371f1a441f4ed0da9a4a81791e0415886e75ae 100644 (file)
@@ -13,6 +13,7 @@ config SND_CS4231_LIB
 
 config SND_ADLIB
        tristate "AdLib FM card"
+       depends on SND
        select SND_OPL3_LIB
        help
          Say Y here to include support for AdLib FM cards.
index b33a5fb59ec2144cf35d53acc9eafe74daca4f3e..59034507175b617b331c1dad07028344813e8f57 100644 (file)
@@ -120,6 +120,8 @@ static int __devinit snd_card_ad1816a_pnp(int dev, struct snd_card_ad1816a *acar
        struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
        int err;
 
+       if (!cfg)
+               return -ENOMEM;
        acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
        if (acard->dev == NULL) {
                kfree(cfg);
index 3c1e9fd56fe00143e3c1a26ca81c5acc9affa4e8..d1f6dfcec46edfd73e55fce385be78e618b76189 100644 (file)
@@ -289,6 +289,8 @@ static int __devinit snd_cmi8330_pnp(int dev, struct snd_cmi8330 *acard,
        struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL);
        int err;
 
+       if (!cfg)
+               return -ENOMEM;
        acard->cap = pnp_request_card_device(card, id->devs[0].id, NULL);
        if (acard->cap == NULL) {
                kfree(cfg);
index f12cd09d1fccb0b3ed9fdc5291283b3413636fc3..4ec2d79431fc1b1ca8cd335fca51c330ec9222c7 100644 (file)
@@ -564,6 +564,8 @@ static int __devinit snd_interwave_pnp(int dev, struct snd_interwave *iwcard,
        struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL);
        int err;
 
+       if (!cfg)
+               return -ENOMEM;
        iwcard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
        if (iwcard->dev == NULL) {
                kfree(cfg);
index a1ad39a8cdceea220b5cf2c3f5a9df6496599706..df227377c3331d8d46030c3d37bb6bb8d298df65 100644 (file)
@@ -1683,6 +1683,8 @@ static int __init snd_card_opti9xx_pnp(struct snd_opti9xx *chip, struct pnp_card
        struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
        int err;
 
+       if (!cfg)
+               return -ENOMEM;
        chip->dev = pnp_request_card_device(card, pid->devs[0].id, NULL);
        if (chip->dev == NULL) {
                kfree(cfg);
index 3b3b4da8cfd307315f97bdcef88f38843538bacd..51f554154c48dfa0a7c56d082231268fc9a55c5a 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/cpu/dac.h>
 #include <asm/cpu/timer.h>
 #include <asm/machvec.h>
-#include <asm/hp6xx/hp6xx.h>
+#include <asm/hp6xx.h>
 #include <asm/hd64461.h>
 
 #define MODNAME "sh_dac_audio"
index a79e91850ba361bbdb05dfdd65a3ed59638fc47e..6577b232535784b6f6bcf7b2db70448e423afcf1 100644 (file)
@@ -570,8 +570,7 @@ int snd_ac97_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value
                        ac97->power_up &= ~(1 << (reg>>1));
                else
                        ac97->power_up |= 1 << (reg>>1);
-               if (power_save)
-                       update_power_regs(ac97);
+               update_power_regs(ac97);
        }
 #endif
        return err;
@@ -2337,10 +2336,7 @@ int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup)
                }
        }
 
-       if (! power_save)
-               return 0;
-
-       if (! powerup && ac97->power_workq)
+       if (power_save && !powerup && ac97->power_workq)
                /* adjust power-down bits after two seconds delay
                 * (for avoiding loud click noises for many (OSS) apps
                 *  that open/close frequently)
index 13a8cefa774917342a73979fae7734b46d0c1d41..a7edd56542d4f571b27c93ffee5a868204a6e216 100644 (file)
@@ -2032,8 +2032,10 @@ static int ali_suspend(struct pci_dev *pci, pm_message_t state)
        outl(0xffffffff, ALI_REG(chip, ALI_STOP));
 
        spin_unlock_irq(&chip->reg_lock);
+
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -2048,8 +2050,15 @@ static int ali_resume(struct pci_dev *pci)
        if (! im)
                return 0;
 
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "ali5451: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
+       pci_set_master(pci);
 
        spin_lock_irq(&chip->reg_lock);
        
index 9b16c299f0a9d33f91479a50db01545bfdd9905e..95f70f3cc37eb9621f24651b51db19d367caade2 100644 (file)
@@ -768,9 +768,9 @@ static int snd_als300_suspend(struct pci_dev *pci, pm_message_t state)
        snd_pcm_suspend_all(chip->pcm);
        snd_ac97_suspend(chip->ac97);
 
-       pci_set_power_state(pci, PCI_D3hot);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -779,9 +779,14 @@ static int snd_als300_resume(struct pci_dev *pci)
        struct snd_card *card = pci_get_drvdata(pci);
        struct snd_als300 *chip = card->private_data;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "als300: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
 
        snd_als300_init(chip);
index 15fc3929b5f700c7fa0cfeb600f2d99767ea85b5..8fb55d3b454be4038fff919b1925355f72f4c9ce 100644 (file)
@@ -804,9 +804,9 @@ static int snd_als4000_suspend(struct pci_dev *pci, pm_message_t state)
        snd_pcm_suspend_all(chip->pcm);
        snd_sbmixer_suspend(chip);
 
-       pci_set_power_state(pci, PCI_D3hot);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -816,9 +816,14 @@ static int snd_als4000_resume(struct pci_dev *pci)
        struct snd_card_als4000 *acard = card->private_data;
        struct snd_sb *chip = acard->chip;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "als4000: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
 
        snd_als4000_configure(chip);
index 3e8fc5a0006a7c3fb7bfc8d2057c9d4a6800e75d..e3e99f396711edecb7b0f06578ff40776488858c 100644 (file)
@@ -1442,9 +1442,9 @@ static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state)
        snd_atiixp_aclink_down(chip);
        snd_atiixp_chip_stop(chip);
 
-       pci_set_power_state(pci, PCI_D3hot);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -1454,9 +1454,14 @@ static int snd_atiixp_resume(struct pci_dev *pci)
        struct atiixp *chip = card->private_data;
        int i;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "atiixp: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
 
        snd_atiixp_aclink_reset(chip);
index c5dda1bf3d4606a2c123b13296f7cc4fd380cce4..dc54f2c68ed7a4fbaf3ba03415c932caa325bb3c 100644 (file)
@@ -1128,9 +1128,9 @@ static int snd_atiixp_suspend(struct pci_dev *pci, pm_message_t state)
        snd_atiixp_aclink_down(chip);
        snd_atiixp_chip_stop(chip);
 
-       pci_set_power_state(pci, PCI_D3hot);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -1140,9 +1140,14 @@ static int snd_atiixp_resume(struct pci_dev *pci)
        struct atiixp_modem *chip = card->private_data;
        int i;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "atiixp-modem: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
 
        snd_atiixp_aclink_reset(chip);
index 692f203d65d8f06a6699190e7ab866d992215f4c..2414ee6307565861c872b0b498f518d1c959ca3c 100644 (file)
@@ -1903,9 +1903,9 @@ snd_azf3328_suspend(struct pci_dev *pci, pm_message_t state)
        for (reg = 0; reg < AZF_IO_SIZE_SYNTH_PM / 2; reg++)
                chip->saved_regs_synth[reg] = inw(chip->synth_port + reg * 2);
 
-       pci_set_power_state(pci, PCI_D3hot);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -1916,9 +1916,14 @@ snd_azf3328_resume(struct pci_dev *pci)
        struct snd_azf3328 *chip = card->private_data;
        int reg;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "azt3328: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
 
        for (reg = 0; reg < AZF_IO_SIZE_IO2_PM / 2; reg++)
index 1f7e71083069db66a60ea4fcfa9c41f21e889f09..0093cd1f92db3ac352124dda27df0d9e42e6454a 100644 (file)
@@ -3122,9 +3122,9 @@ static int snd_cmipci_suspend(struct pci_dev *pci, pm_message_t state)
        /* disable ints */
        snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0);
 
-       pci_set_power_state(pci, PCI_D3hot);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -3134,9 +3134,14 @@ static int snd_cmipci_resume(struct pci_dev *pci)
        struct cmipci *cm = card->private_data;
        int i;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "cmipci: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
 
        /* reset / initialize to a sane state */
index d54924e60bb13e3f174e80670109aef64ff6b4a3..0905fa88129dde9a9550dba00b776082e2d02893 100644 (file)
@@ -2050,6 +2050,7 @@ static int cs4281_suspend(struct pci_dev *pci, pm_message_t state)
 
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -2060,8 +2061,14 @@ static int cs4281_resume(struct pci_dev *pci)
        unsigned int i;
        u32 ulCLK;
 
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "cs4281: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
 
        ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1);
index 16d4ebf2a33f557d0bfa9bb15780bb1c0bbc6eac..2807b9756ef09d96e2f48646084d201aa7daefd0 100644 (file)
@@ -3687,8 +3687,10 @@ int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state)
        /* disable CLKRUN */
        chip->active_ctrl(chip, -chip->amplifier);
        chip->amplifier = amp_saved; /* restore the status */
+
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -3698,9 +3700,16 @@ int snd_cs46xx_resume(struct pci_dev *pci)
        struct snd_cs46xx *chip = card->private_data;
        int amp_saved;
 
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "cs46xx: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
+
        amp_saved = chip->amplifier;
        chip->amplifier = 0;
        chip->active_ctrl(chip, 1); /* force to on */
index aad0e69db9c1aed2d2cb40051957d1e01e0f6776..3e4d198a4502dca0fc7def2652fe55369e9cfb4e 100644 (file)
@@ -73,9 +73,10 @@ int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state)
        snd_ac97_suspend(cs5535au->ac97);
        /* save important regs, then disable aclink in hw */
        snd_cs5535audio_stop_hardware(cs5535au);
+
        pci_disable_device(pci);
        pci_save_state(pci);
-
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -87,8 +88,14 @@ int snd_cs5535audio_resume(struct pci_dev *pci)
        int timeout;
        int i;
 
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "cs5535audio: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
 
        /* set LNK_WRM_RST to reset AC link */
index 493ec0816bb3f29afab2792add265279e9d03f38..55caf341933adc608d477ab27f61b38043e27c03 100644 (file)
@@ -226,9 +226,9 @@ static int snd_emu10k1_suspend(struct pci_dev *pci, pm_message_t state)
 
        snd_emu10k1_done(emu);
 
-       pci_set_power_state(pci, PCI_D3hot);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -237,11 +237,16 @@ static int snd_emu10k1_resume(struct pci_dev *pci)
        struct snd_card *card = pci_get_drvdata(pci);
        struct snd_emu10k1 *emu = card->private_data;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "emu10k1: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
-       
+
        snd_emu10k1_resume_init(emu);
        snd_emu10k1_efx_resume(emu);
        snd_ac97_resume(emu->ac97);
index 8cb4fb2412dbc9e6b71836f7ce703b17bd9ce570..d2a811f222c926b4549dda3e8b3b07ebc04a3357 100644 (file)
@@ -2072,9 +2072,10 @@ static int snd_ensoniq_suspend(struct pci_dev *pci, pm_message_t state)
        udelay(100);
        snd_ak4531_suspend(ensoniq->u.es1370.ak4531);
 #endif 
-       pci_set_power_state(pci, PCI_D3hot);
+
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -2083,9 +2084,14 @@ static int snd_ensoniq_resume(struct pci_dev *pci)
        struct snd_card *card = pci_get_drvdata(pci);
        struct ensoniq *ensoniq = card->private_data;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR DRIVER_NAME ": pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
 
        snd_ensoniq_chip_init(ensoniq);
index 2da988f78ba738fb1676d419bf78cf3327945104..1a8d36df4b5dab6d102cb87c879c43106afa3edf 100644 (file)
@@ -1481,10 +1481,14 @@ static int es1938_suspend(struct pci_dev *pci, pm_message_t state)
                *d = snd_es1938_reg_read(chip, *s);
 
        outb(0x00, SLIO_REG(chip, IRQCONTROL)); /* disable irqs */
-       if (chip->irq >= 0)
+       if (chip->irq >= 0) {
+               synchronize_irq(chip->irq);
                free_irq(chip->irq, chip);
+               chip->irq = -1;
+       }
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -1494,10 +1498,22 @@ static int es1938_resume(struct pci_dev *pci)
        struct es1938 *chip = card->private_data;
        unsigned char *s, *d;
 
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
-       request_irq(pci->irq, snd_es1938_interrupt,
-                   IRQF_DISABLED|IRQF_SHARED, "ES1938", chip);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "es1938: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
+
+       if (request_irq(pci->irq, snd_es1938_interrupt,
+                       IRQF_DISABLED|IRQF_SHARED, "ES1938", chip)) {
+               printk(KERN_ERR "es1938: unable to grab IRQ %d, "
+                      "disabling device\n", pci->irq);
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        chip->irq = pci->irq;
        snd_es1938_chip_init(chip);
 
@@ -1556,8 +1572,10 @@ static int snd_es1938_free(struct es1938 *chip)
 
        snd_es1938_free_gameport(chip);
 
-       if (chip->irq >= 0)
+       if (chip->irq >= 0) {
+               synchronize_irq(chip->irq);
                free_irq(chip->irq, chip);
+       }
        pci_release_regions(chip->pci);
        pci_disable_device(chip->pci);
        kfree(chip);
@@ -1602,6 +1620,7 @@ static int __devinit snd_es1938_create(struct snd_card *card,
        spin_lock_init(&chip->mixer_lock);
        chip->card = card;
        chip->pci = pci;
+       chip->irq = -1;
        if ((err = pci_request_regions(pci, "ESS Solo-1")) < 0) {
                kfree(chip);
                pci_disable_device(pci);
index b9d723c7e1dbecd83e87e3179975def5ebd88ee6..092da53e1464688d877cc1c0a6979fe0fa5258c4 100644 (file)
@@ -432,46 +432,6 @@ MODULE_PARM_DESC(joystick, "Enable joystick.");
 #define ESM_MODE_PLAY          0
 #define ESM_MODE_CAPTURE       1
 
-/* acpi states */
-enum {
-       ACPI_D0=0,
-       ACPI_D1,
-       ACPI_D2,
-       ACPI_D3
-};
-
-/* bits in the acpi masks */
-#define ACPI_12MHZ     ( 1 << 15)
-#define ACPI_24MHZ     ( 1 << 14)
-#define ACPI_978       ( 1 << 13)
-#define ACPI_SPDIF     ( 1 << 12)
-#define ACPI_GLUE      ( 1 << 11)
-#define ACPI__10       ( 1 << 10) /* reserved */
-#define ACPI_PCIINT    ( 1 << 9)
-#define ACPI_HV                ( 1 << 8) /* hardware volume */
-#define ACPI_GPIO      ( 1 << 7)
-#define ACPI_ASSP      ( 1 << 6)
-#define ACPI_SB                ( 1 << 5) /* sb emul */
-#define ACPI_FM                ( 1 << 4) /* fm emul */
-#define ACPI_RB                ( 1 << 3) /* ringbus / aclink */
-#define ACPI_MIDI      ( 1 << 2) 
-#define ACPI_GP                ( 1 << 1) /* game port */
-#define ACPI_WP                ( 1 << 0) /* wave processor */
-
-#define ACPI_ALL       (0xffff)
-#define ACPI_SLEEP     (~(ACPI_SPDIF|ACPI_ASSP|ACPI_SB|ACPI_FM| \
-                       ACPI_MIDI|ACPI_GP|ACPI_WP))
-#define ACPI_NONE      (ACPI__10)
-
-/* these masks indicate which units we care about at
-       which states */
-static u16 acpi_state_mask[] = {
-       [ACPI_D0] = ACPI_ALL,
-       [ACPI_D1] = ACPI_SLEEP,
-       [ACPI_D2] = ACPI_SLEEP,
-       [ACPI_D3] = ACPI_NONE
-};
-
 
 /* APU use in the driver */
 enum snd_enum_apu_type {
@@ -2159,21 +2119,6 @@ static void snd_es1968_reset(struct es1968 *chip)
        udelay(10);
 }
 
-/*
- * power management
- */
-static void snd_es1968_set_acpi(struct es1968 *chip, int state)
-{
-       u16 active_mask = acpi_state_mask[state];
-
-       pci_set_power_state(chip->pci, state);
-       /* make sure the units we care about are on 
-               XXX we might want to do this before state flipping? */
-       pci_write_config_word(chip->pci, 0x54, ~ active_mask);
-       pci_write_config_word(chip->pci, 0x56, ~ active_mask);
-}
-
-
 /*
  * initialize maestro chip
  */
@@ -2196,9 +2141,6 @@ static void snd_es1968_chip_init(struct es1968 *chip)
         * IRQs.
         */
        
-       /* do config work at full power */
-       snd_es1968_set_acpi(chip, ACPI_D0);
-
        /* Config Reg A */
        pci_read_config_word(pci, ESM_CONFIG_A, &w);
 
@@ -2397,9 +2339,10 @@ static int es1968_suspend(struct pci_dev *pci, pm_message_t state)
        snd_pcm_suspend_all(chip->pcm);
        snd_ac97_suspend(chip->ac97);
        snd_es1968_bob_stop(chip);
-       snd_es1968_set_acpi(chip, ACPI_D3);
+
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -2413,9 +2356,16 @@ static int es1968_resume(struct pci_dev *pci)
                return 0;
 
        /* restore all our config */
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "es1968: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
+
        snd_es1968_chip_init(chip);
 
        /* need to restore the base pointers.. */ 
@@ -2514,7 +2464,6 @@ static int snd_es1968_free(struct es1968 *chip)
        if (chip->irq >= 0)
                free_irq(chip->irq, (void *)chip);
        snd_es1968_free_gameport(chip);
-       snd_es1968_set_acpi(chip, ACPI_D3);
        chip->master_switch = NULL;
        chip->master_volume = NULL;
        pci_release_regions(chip->pci);
index 3ec7d7ee04ddde71344ba7bc50eeaf1ebe793894..77e3d5c1830201b206768ea1e84092e71a107bc1 100644 (file)
@@ -1531,9 +1531,9 @@ static int snd_fm801_suspend(struct pci_dev *pci, pm_message_t state)
                chip->saved_regs[i] = inw(chip->port + saved_regs[i]);
        /* FIXME: tea575x suspend */
 
-       pci_set_power_state(pci, PCI_D3hot);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -1543,9 +1543,14 @@ static int snd_fm801_resume(struct pci_dev *pci)
        struct fm801 *chip = card->private_data;
        int i;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "fm801: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
 
        snd_fm801_chip_init(chip, 1);
index feeed12920b4e7477d3a23219e620ae8d1e31833..0e292dc4fd872ca72a064d1ff3cd03377f3743d2 100644 (file)
@@ -86,6 +86,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
                         "{ATI, SB450},"
                         "{ATI, SB600},"
                         "{ATI, RS600},"
+                        "{ATI, RS690},"
                         "{VIA, VT8251},"
                         "{VIA, VT8237A},"
                         "{SiS, SIS966},"
@@ -336,6 +337,7 @@ struct azx {
        unsigned int initialized :1;
        unsigned int single_cmd :1;
        unsigned int polling_mode :1;
+       unsigned int msi :1;
 };
 
 /* driver types */
@@ -396,6 +398,7 @@ static char *driver_short_names[] __devinitdata = {
  */
 #define upper_32bit(addr) (sizeof(addr) > 4 ? (u32)((addr) >> 32) : (u32)0)
 
+static int azx_acquire_irq(struct azx *chip, int do_disconnect);
 
 /*
  * Interface for HD codec
@@ -535,6 +538,18 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec)
                schedule_timeout_interruptible(1);
        } while (time_after_eq(timeout, jiffies));
 
+       if (chip->msi) {
+               snd_printk(KERN_WARNING "hda_intel: No response from codec, "
+                          "disabling MSI...\n");
+               free_irq(chip->irq, chip);
+               chip->irq = -1;
+               pci_disable_msi(chip->pci);
+               chip->msi = 0;
+               if (azx_acquire_irq(chip, 1) < 0)
+                       return -1;
+               goto again;
+       }
+
        if (!chip->polling_mode) {
                snd_printk(KERN_WARNING "hda_intel: azx_get_response timeout, "
                           "switching to polling mode...\n");
@@ -1363,6 +1378,20 @@ static int __devinit azx_init_stream(struct azx *chip)
        return 0;
 }
 
+static int azx_acquire_irq(struct azx *chip, int do_disconnect)
+{
+       if (request_irq(chip->pci->irq, azx_interrupt, IRQF_DISABLED|IRQF_SHARED,
+                       "HDA Intel", chip)) {
+               printk(KERN_ERR "hda-intel: unable to grab IRQ %d, "
+                      "disabling device\n", chip->pci->irq);
+               if (do_disconnect)
+                       snd_card_disconnect(chip->card);
+               return -1;
+       }
+       chip->irq = chip->pci->irq;
+       return 0;
+}
+
 
 #ifdef CONFIG_PM
 /*
@@ -1379,12 +1408,16 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state)
                snd_pcm_suspend_all(chip->pcm[i]);
        snd_hda_suspend(chip->bus, state);
        azx_free_cmd_io(chip);
-       if (chip->irq >= 0)
+       if (chip->irq >= 0) {
+               synchronize_irq(chip->irq);
                free_irq(chip->irq, chip);
-       if (!disable_msi)
+               chip->irq = -1;
+       }
+       if (chip->msi)
                pci_disable_msi(chip->pci);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -1393,15 +1426,20 @@ static int azx_resume(struct pci_dev *pci)
        struct snd_card *card = pci_get_drvdata(pci);
        struct azx *chip = card->private_data;
 
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
-       if (!disable_msi)
-               pci_enable_msi(pci);
-       /* FIXME: need proper error handling */
-       request_irq(pci->irq, azx_interrupt, IRQF_DISABLED|IRQF_SHARED,
-                   "HDA Intel", chip);
-       chip->irq = pci->irq;
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "hda-intel: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
+       if (chip->msi)
+               if (pci_enable_msi(pci) < 0)
+                       chip->msi = 0;
+       if (azx_acquire_irq(chip, 1) < 0)
+               return -EIO;
        azx_init_chip(chip);
        snd_hda_resume(chip->bus);
        snd_power_change_state(card, SNDRV_CTL_POWER_D0);
@@ -1431,15 +1469,14 @@ static int azx_free(struct azx *chip)
                /* disable position buffer */
                azx_writel(chip, DPLBASE, 0);
                azx_writel(chip, DPUBASE, 0);
-
-               synchronize_irq(chip->irq);
        }
 
        if (chip->irq >= 0) {
+               synchronize_irq(chip->irq);
                free_irq(chip->irq, (void*)chip);
-               if (!disable_msi)
-                       pci_disable_msi(chip->pci);
        }
+       if (chip->msi)
+               pci_disable_msi(chip->pci);
        if (chip->remap_addr)
                iounmap(chip->remap_addr);
 
@@ -1494,6 +1531,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
        chip->pci = pci;
        chip->irq = -1;
        chip->driver_type = driver_type;
+       chip->msi = !disable_msi;
 
        chip->position_fix = position_fix;
        chip->single_cmd = single_cmd;
@@ -1523,16 +1561,14 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
                goto errout;
        }
 
-       if (!disable_msi)
-               pci_enable_msi(pci);
+       if (chip->msi)
+               if (pci_enable_msi(pci) < 0)
+                       chip->msi = 0;
 
-       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);
+       if (azx_acquire_irq(chip, 0) < 0) {
                err = -EBUSY;
                goto errout;
        }
-       chip->irq = pci->irq;
 
        pci_set_master(pci);
        synchronize_irq(chip->irq);
@@ -1677,6 +1713,7 @@ static struct pci_device_id azx_ids[] = {
        { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB450 */
        { 0x1002, 0x4383, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB600 */
        { 0x1002, 0x793b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS600 HDMI */
+       { 0x1002, 0x7919, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS690 HDMI */
        { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */
        { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */
        { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */
index 511df07fa2a3fdb2a0788ea965136817ff859dd8..edd22dec8286e0161b57a0ce4570bf060a572b3b 100644 (file)
@@ -818,6 +818,8 @@ static struct hda_board_config ad1986a_cfg_tbl[] = {
          .config = AD1986A_LAPTOP_EAPD }, /* ASUS A6J */
        { .pci_subvendor = 0x1043, .pci_subdevice = 0x11f7,
          .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5A */
+       { .pci_subvendor = 0x1043, .pci_subdevice = 0x1263,
+         .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5F */
        { .pci_subvendor = 0x1043, .pci_subdevice = 0x1297,
          .config = AD1986A_LAPTOP_EAPD }, /* ASUS Z62F */
        { .pci_subvendor = 0x103c, .pci_subdevice = 0x30af,
index a27440ffd1c87e313e1fcd770fc1c5bb5394ec8e..7333f275decdfc36b34ad5a090272b5c182d64b6 100644 (file)
@@ -161,5 +161,6 @@ static int patch_atihdmi(struct hda_codec *codec)
  */
 struct hda_codec_preset snd_hda_preset_atihdmi[] = {
        { .id = 0x1002793c, .name = "ATI RS600 HDMI", .patch = patch_atihdmi },
+       { .id = 0x1002791a, .name = "ATI RS690 HDMI", .patch = patch_atihdmi },
        {} /* terminator */
 };
index 84a3eb8aacc243721d462cd6f9ea3fa48ead4862..0d728c6f697c47c001b7672bb146757ffe3ec1a6 100644 (file)
@@ -1799,7 +1799,7 @@ static int alc_build_pcms(struct hda_codec *codec)
        /* SPDIF for stream index #1 */
        if (spec->multiout.dig_out_nid || spec->dig_in_nid) {
                codec->num_pcms = 2;
-               info++;
+               info = spec->pcm_rec + 1;
                info->name = spec->stream_name_digital;
                if (spec->multiout.dig_out_nid &&
                    spec->stream_digital_playback) {
@@ -1820,7 +1820,7 @@ static int alc_build_pcms(struct hda_codec *codec)
        if (spec->num_adc_nids > 1 && spec->stream_analog_capture &&
            spec->adc_nids) {
                codec->num_pcms = 3;
-               info++;
+               info = spec->pcm_rec + 2;
                info->name = spec->stream_name_analog;
                /* No playback stream for second PCM */
                info->stream[SNDRV_PCM_STREAM_PLAYBACK] = alc_pcm_null_playback;
index f4319b8d4644641f9a42cf76a8af42c7b2a93bc9..9c1bce7afa867b169a33271b0b053bbce7ebf830 100644 (file)
@@ -1961,6 +1961,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
                .name = "Tyan Thunder K8WE",
                .type = AC97_TUNE_HP_ONLY
        },
+       {
+               .subvendor = 0x10f7,
+               .subdevice = 0x834c,
+               .name = "Panasonic CF-R4",
+               .type = AC97_TUNE_HP_ONLY,
+       },
        {
                .subvendor = 0x110a,
                .subdevice = 0x0056,
@@ -2476,10 +2482,14 @@ static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state)
        if (chip->device_type == DEVICE_INTEL_ICH4)
                chip->sdm_saved = igetbyte(chip, ICHREG(SDM));
 
-       if (chip->irq >= 0)
+       if (chip->irq >= 0) {
+               synchronize_irq(chip->irq);
                free_irq(chip->irq, chip);
+               chip->irq = -1;
+       }
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -2489,11 +2499,22 @@ static int intel8x0_resume(struct pci_dev *pci)
        struct intel8x0 *chip = card->private_data;
        int i;
 
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "intel8x0: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
-       request_irq(pci->irq, snd_intel8x0_interrupt, IRQF_DISABLED|IRQF_SHARED,
-                   card->shortname, chip);
+       if (request_irq(pci->irq, snd_intel8x0_interrupt,
+                       IRQF_DISABLED|IRQF_SHARED, card->shortname, chip)) {
+               printk(KERN_ERR "intel8x0: unable to grab IRQ %d, "
+                      "disabling device\n", pci->irq);
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        chip->irq = pci->irq;
        synchronize_irq(chip->irq);
        snd_intel8x0_chip_init(chip, 0);
index 6703f5cb5569e702f68cf849effbfd77ba08d42d..bd467c501123f3b3523ce1268c0c7712b381ad9a 100644 (file)
@@ -1045,10 +1045,14 @@ static int intel8x0m_suspend(struct pci_dev *pci, pm_message_t state)
        for (i = 0; i < chip->pcm_devs; i++)
                snd_pcm_suspend_all(chip->pcm[i]);
        snd_ac97_suspend(chip->ac97);
-       if (chip->irq >= 0)
+       if (chip->irq >= 0) {
+               synchronize_irq(chip->irq);
                free_irq(chip->irq, chip);
+               chip->irq = -1;
+       }
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -1057,11 +1061,22 @@ static int intel8x0m_resume(struct pci_dev *pci)
        struct snd_card *card = pci_get_drvdata(pci);
        struct intel8x0m *chip = card->private_data;
 
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "intel8x0m: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
-       request_irq(pci->irq, snd_intel8x0_interrupt, IRQF_DISABLED|IRQF_SHARED,
-                   card->shortname, chip);
+       if (request_irq(pci->irq, snd_intel8x0_interrupt,
+                       IRQF_DISABLED|IRQF_SHARED, card->shortname, chip)) {
+               printk(KERN_ERR "intel8x0m: unable to grab IRQ %d, "
+                      "disabling device\n", pci->irq);
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        chip->irq = pci->irq;
        snd_intel8x0_chip_init(chip, 0);
        snd_ac97_resume(chip->ac97);
index 05605f474a72725297b59f969475b940875095b6..8cab342bbaaf94f5c0ece3a13e093df9752c831f 100644 (file)
@@ -2589,12 +2589,9 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state)
                chip->suspend_mem[index++] = 
                        snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i);
 
-       /* power down apci registers */
-       snd_m3_outw(chip, 0xffff, 0x54);
-       snd_m3_outw(chip, 0xffff, 0x56);
-
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -2607,8 +2604,14 @@ static int m3_resume(struct pci_dev *pci)
        if (chip->suspend_mem == NULL)
                return 0;
 
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "maestor3: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
 
        /* first lets just bring everything back. .*/
index b1bbdb9e3b7b4b1d2bd516b05f6db82cd31fee48..945d21bf187ec2251ee601bf53b0a999b4dda620 100644 (file)
@@ -1390,6 +1390,7 @@ static int nm256_suspend(struct pci_dev *pci, pm_message_t state)
        chip->coeffs_current = 0;
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -1401,8 +1402,17 @@ static int nm256_resume(struct pci_dev *pci)
 
        /* Perform a full reset on the hardware */
        chip->in_resume = 1;
+
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "nm256: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
+       pci_set_master(pci);
+
        snd_nm256_init_chip(chip);
 
        /* restore ac97 */
index ec4899147e1dcd0d221bdf1a5e7c28c2cedb36a0..56e0c01123e70246433cdb0a34c5fb0459465175 100644 (file)
@@ -1178,9 +1178,9 @@ static int riptide_suspend(struct pci_dev *pci, pm_message_t state)
        snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
        snd_pcm_suspend_all(chip->pcm);
        snd_ac97_suspend(chip->ac97);
-       pci_set_power_state(pci, PCI_D3hot);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -1189,9 +1189,14 @@ static int riptide_resume(struct pci_dev *pci)
        struct snd_card *card = pci_get_drvdata(pci);
        struct snd_riptide *chip = card->private_data;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "riptide: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
        snd_riptide_initialize(chip);
        snd_ac97_resume(chip->ac97);
index 0d478871808d0723e339de46aac0b7252fb4cbe5..1fbc4321122f64caed4552487d3af2631fa7397f 100644 (file)
@@ -3966,15 +3966,9 @@ int snd_trident_suspend(struct pci_dev *pci, pm_message_t state)
        snd_ac97_suspend(trident->ac97);
        snd_ac97_suspend(trident->ac97_sec);
 
-       switch (trident->device) {
-       case TRIDENT_DEVICE_ID_DX:
-       case TRIDENT_DEVICE_ID_NX:
-               break;                  /* TODO */
-       case TRIDENT_DEVICE_ID_SI7018:
-               break;
-       }
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -3983,9 +3977,15 @@ int snd_trident_resume(struct pci_dev *pci)
        struct snd_card *card = pci_get_drvdata(pci);
        struct snd_trident *trident = card->private_data;
 
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
-       pci_set_master(pci); /* to be sure */
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "trident: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
+       pci_set_master(pci);
 
        switch (trident->device) {
        case TRIDENT_DEVICE_ID_DX:
index e6990e0bbf237722a578af26de73c4beda076c43..92b0736c0fdbf244591daa7a39746eb6e763813e 100644 (file)
@@ -2185,9 +2185,9 @@ static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state)
                chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10);
        }
 
-       pci_set_power_state(pci, PCI_D3hot);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -2197,9 +2197,15 @@ static int snd_via82xx_resume(struct pci_dev *pci)
        struct via82xx *chip = card->private_data;
        int i;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "via82xx: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
+       pci_set_master(pci);
 
        snd_via82xx_chip_init(chip);
 
index 5ab1cf3d434b7b8a43e12ad84f41e537170554fb..feb27c966256a7df4247aed74fd564d0ebed0a13 100644 (file)
@@ -1032,9 +1032,10 @@ static int snd_via82xx_suspend(struct pci_dev *pci, pm_message_t state)
                snd_via82xx_channel_reset(chip, &chip->devs[i]);
        synchronize_irq(chip->irq);
        snd_ac97_suspend(chip->ac97);
-       pci_set_power_state(pci, PCI_D3hot);
+
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -1044,9 +1045,14 @@ static int snd_via82xx_resume(struct pci_dev *pci)
        struct via82xx_modem *chip = card->private_data;
        int i;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "via82xx-modem: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
 
        snd_via82xx_chip_init(chip);
index e7cd8acab59ae1db98bc54e669f04113ab34e406..af49e8aabf5529331876b4d9e543586cf9854735 100644 (file)
@@ -266,9 +266,9 @@ static int snd_vx222_suspend(struct pci_dev *pci, pm_message_t state)
        int err;
 
        err = snd_vx_suspend(&vx->core, state);
-       pci_set_power_state(pci, PCI_D3hot);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return err;
 }
 
@@ -277,9 +277,14 @@ static int snd_vx222_resume(struct pci_dev *pci)
        struct snd_card *card = pci_get_drvdata(pci);
        struct snd_vx222 *vx = card->private_data;
 
-       pci_restore_state(pci);
-       pci_enable_device(pci);
        pci_set_power_state(pci, PCI_D0);
+       pci_restore_state(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "vx222: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
        return snd_vx_resume(&vx->core);
 }
index ebc6da89edf32238f74a4025ddc3fc4828426764..a40c1085fd208a852391a4e92f45ec8666b34252 100644 (file)
@@ -2218,6 +2218,7 @@ int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state)
        snd_ymfpci_disable_dsp(chip);
        pci_disable_device(pci);
        pci_save_state(pci);
+       pci_set_power_state(pci, pci_choose_state(pci, state));
        return 0;
 }
 
@@ -2227,8 +2228,14 @@ int snd_ymfpci_resume(struct pci_dev *pci)
        struct snd_ymfpci *chip = card->private_data;
        unsigned int i;
 
+       pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
-       pci_enable_device(pci);
+       if (pci_enable_device(pci) < 0) {
+               printk(KERN_ERR "ymfpci: pci_enable_device failed, "
+                      "disabling device\n");
+               snd_card_disconnect(card);
+               return -EIO;
+       }
        pci_set_master(pci);
        snd_ymfpci_aclink_reset(pci);
        snd_ymfpci_codec_ready(chip, 0);