]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik...
authorJohn W. Linville <linville@tuxdriver.com>
Fri, 17 Feb 2006 13:15:41 +0000 (08:15 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 17 Feb 2006 13:15:41 +0000 (08:15 -0500)
360 files changed:
Documentation/fujitsu/frv/kernel-ABI.txt [new file with mode: 0644]
Documentation/hwmon/w83627hf
Documentation/kernel-parameters.txt
Documentation/kprobes.txt
Documentation/mips/AU1xxx_IDE.README
Documentation/powerpc/booting-without-of.txt
Documentation/scsi/ChangeLog.megaraid_sas
MAINTAINERS
Makefile
arch/arm/mach-s3c2410/mach-h1940.c
arch/arm/mach-s3c2410/s3c2400.h [new file with mode: 0644]
arch/frv/Kconfig
arch/frv/Makefile
arch/frv/kernel/break.S
arch/frv/kernel/entry-table.S
arch/frv/kernel/entry.S
arch/frv/kernel/head.S
arch/frv/kernel/irq.c
arch/frv/mm/kmap.c
arch/h8300/Kconfig
arch/h8300/Kconfig.cpu
arch/i386/boot/.gitignore [new file with mode: 0644]
arch/i386/boot/tools/.gitignore [new file with mode: 0644]
arch/i386/kernel/.gitignore [new file with mode: 0644]
arch/i386/kernel/head.S
arch/i386/kernel/smpboot.c
arch/i386/kernel/syscall_table.S
arch/i386/kernel/timers/timer_tsc.c
arch/i386/kernel/vsyscall-sysenter.S
arch/i386/mach-voyager/voyager_smp.c
arch/i386/oprofile/backtrace.c
arch/ia64/ia32/ia32_signal.c
arch/ia64/kernel/entry.S
arch/ia64/kernel/fsys.S
arch/ia64/kernel/mca_drv.c
arch/ia64/sn/kernel/io_init.c
arch/ia64/sn/kernel/irq.c
arch/m68k/Kconfig
arch/m68k/fpsp040/bindec.S
arch/m68k/fpsp040/binstr.S
arch/m68k/fpsp040/bugfix.S
arch/m68k/fpsp040/decbin.S
arch/m68k/fpsp040/do_func.S
arch/m68k/fpsp040/fpsp.h
arch/m68k/fpsp040/gen_except.S
arch/m68k/fpsp040/get_op.S
arch/m68k/fpsp040/kernel_ex.S
arch/m68k/fpsp040/res_func.S
arch/m68k/fpsp040/round.S
arch/m68k/fpsp040/sacos.S
arch/m68k/fpsp040/sasin.S
arch/m68k/fpsp040/satan.S
arch/m68k/fpsp040/satanh.S
arch/m68k/fpsp040/scale.S
arch/m68k/fpsp040/scosh.S
arch/m68k/fpsp040/setox.S
arch/m68k/fpsp040/sgetem.S
arch/m68k/fpsp040/sint.S
arch/m68k/fpsp040/skeleton.S
arch/m68k/fpsp040/slog2.S
arch/m68k/fpsp040/slogn.S
arch/m68k/fpsp040/smovecr.S
arch/m68k/fpsp040/srem_mod.S
arch/m68k/fpsp040/ssin.S
arch/m68k/fpsp040/ssinh.S
arch/m68k/fpsp040/stan.S
arch/m68k/fpsp040/stanh.S
arch/m68k/fpsp040/sto_res.S
arch/m68k/fpsp040/stwotox.S
arch/m68k/fpsp040/tbldo.S
arch/m68k/fpsp040/util.S
arch/m68k/fpsp040/x_bsun.S
arch/m68k/fpsp040/x_fline.S
arch/m68k/fpsp040/x_operr.S
arch/m68k/fpsp040/x_ovfl.S
arch/m68k/fpsp040/x_snan.S
arch/m68k/fpsp040/x_store.S
arch/m68k/fpsp040/x_unfl.S
arch/m68k/fpsp040/x_unimp.S
arch/m68k/fpsp040/x_unsupp.S
arch/m68knommu/Kconfig
arch/mips/Makefile
arch/mips/kernel/process.c
arch/mips/kernel/scall32-o32.S
arch/mips/kernel/signal-common.h
arch/mips/kernel/signal32.c
arch/mips/kernel/signal_n32.c
arch/mips/kernel/smp_mt.c
arch/mips/mm/c-r4k.c
arch/mips/mm/c-tx39.c
arch/parisc/Kconfig
arch/parisc/kernel/syscall_table.S
arch/powerpc/Kconfig
arch/powerpc/Makefile
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/systbl.S
arch/ppc/kernel/misc.S
arch/s390/defconfig
arch/s390/kernel/compat_linux.c
arch/s390/kernel/compat_signal.c
arch/s390/kernel/compat_wrapper.S
arch/s390/kernel/machine_kexec.c
arch/s390/kernel/smp.c
arch/s390/kernel/syscalls.S
arch/s390/lib/delay.c
arch/sparc/kernel/systbls.S
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/systbls.S
arch/v850/Kconfig
arch/x86_64/ia32/ia32entry.S
arch/x86_64/ia32/sys_ia32.c
arch/x86_64/kernel/apic.c
arch/x86_64/kernel/pci-gart.c
arch/x86_64/kernel/time.c
arch/x86_64/kernel/traps.c
arch/x86_64/mm/numa.c
drivers/block/pktcdvd.c
drivers/bluetooth/bt3c_cs.c
drivers/char/drm/drm_pciids.h
drivers/char/esp.c
drivers/char/hpet.c
drivers/char/tipar.c
drivers/char/tty_io.c
drivers/char/watchdog/pcwd.c
drivers/char/watchdog/sa1100_wdt.c
drivers/cpufreq/cpufreq.c
drivers/hwmon/it87.c
drivers/hwmon/vt8231.c
drivers/hwmon/w83781d.c
drivers/i2c/busses/i2c-isa.c
drivers/ide/ide-taskfile.c
drivers/infiniband/core/mad.c
drivers/infiniband/hw/mthca/mthca_cmd.c
drivers/infiniband/hw/mthca/mthca_dev.h
drivers/infiniband/ulp/ipoib/ipoib.h
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
drivers/input/keyboard/Makefile
drivers/input/misc/Makefile
drivers/input/misc/ixp4xx-beeper.c
drivers/input/mouse/logips2pp.c
drivers/input/mouse/trackpoint.c
drivers/input/mouse/trackpoint.h
drivers/input/serio/Makefile
drivers/input/touchscreen/ads7846.c
drivers/isdn/i4l/isdn_tty.c
drivers/message/fusion/mptbase.c
drivers/message/fusion/mptbase.h
drivers/message/fusion/mptctl.c
drivers/message/fusion/mptctl.h
drivers/message/fusion/mptscsih.c
drivers/net/appletalk/cops.h
drivers/net/wireless/Kconfig
drivers/net/wireless/orinoco_cs.c
drivers/parisc/ccio-dma.c
drivers/parisc/sba_iommu.c
drivers/s390/char/sclp.c
drivers/s390/cio/chsc.c
drivers/s390/scsi/zfcp_dbf.c
drivers/s390/scsi/zfcp_def.h
drivers/s390/scsi/zfcp_erp.c
drivers/s390/scsi/zfcp_ext.h
drivers/s390/scsi/zfcp_fsf.c
drivers/s390/scsi/zfcp_scsi.c
drivers/s390/scsi/zfcp_sysfs_adapter.c
drivers/scsi/3w-9xxx.c
drivers/scsi/aacraid/aachba.c
drivers/scsi/aacraid/aacraid.h
drivers/scsi/aacraid/commctrl.c
drivers/scsi/aacraid/comminit.c
drivers/scsi/aacraid/commsup.c
drivers/scsi/aacraid/dpcsup.c
drivers/scsi/aacraid/linit.c
drivers/scsi/gdth.c
drivers/scsi/ipr.c
drivers/scsi/ipr.h
drivers/scsi/iscsi_tcp.c
drivers/scsi/iscsi_tcp.h
drivers/scsi/megaraid.c
drivers/scsi/megaraid.h
drivers/scsi/megaraid/megaraid_sas.c
drivers/scsi/megaraid/megaraid_sas.h
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_iocb.c
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_rscn.c
drivers/scsi/qla2xxx/qla_sup.c
drivers/scsi/sata_mv.c
drivers/scsi/sata_sil.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_sysfs.c
drivers/scsi/scsi_transport_iscsi.c
drivers/scsi/sym53c8xx_2/sym_hipd.c
drivers/serial/ioc4_serial.c
drivers/usb/host/pci-quirks.c
drivers/usb/host/sl811_cs.c
drivers/usb/input/hid-core.c
drivers/usb/misc/Kconfig
drivers/usb/misc/ldusb.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/pl2303.h
drivers/usb/storage/unusual_devs.h
drivers/video/Kconfig
drivers/video/fbmem.c
drivers/video/neofb.c
drivers/video/nvidia/nvidia.c
fs/cifs/file.c
fs/compat.c
fs/exec.c
fs/jbd/checkpoint.c
fs/jbd/commit.c
fs/lockd/clntlock.c
fs/lockd/svc4proc.c
fs/lockd/svcproc.c
fs/ocfs2/dlm/dlmcommon.h
fs/ocfs2/dlm/dlmconvert.c
fs/ocfs2/dlm/dlmlock.c
fs/ocfs2/dlm/dlmmaster.c
fs/ocfs2/dlm/dlmrecovery.c
fs/ocfs2/journal.c
fs/ocfs2/journal.h
fs/reiserfs/super.c
fs/reiserfs/xattr_acl.c
fs/select.c
fs/stat.c
include/asm-alpha/mman.h
include/asm-arm/arch-s3c2410/h1940-latch.h [new file with mode: 0644]
include/asm-arm/mman.h
include/asm-arm26/mman.h
include/asm-cris/mman.h
include/asm-frv/atomic.h
include/asm-frv/cacheflush.h
include/asm-frv/io.h
include/asm-frv/mman.h
include/asm-frv/spr-regs.h
include/asm-frv/system.h
include/asm-frv/uaccess.h
include/asm-frv/unistd.h
include/asm-generic/mman.h [new file with mode: 0644]
include/asm-h8300/mman.h
include/asm-i386/mman.h
include/asm-i386/topology.h
include/asm-i386/unistd.h
include/asm-ia64/mman.h
include/asm-ia64/unistd.h
include/asm-m32r/mman.h
include/asm-m68k/mman.h
include/asm-mips/cpu.h
include/asm-mips/gcc/sgidefs.h [deleted file]
include/asm-mips/mach-generic/timex.h
include/asm-mips/mach-rm200/timex.h [new file with mode: 0644]
include/asm-mips/mman.h
include/asm-mips/r4kcache.h
include/asm-mips/uaccess.h
include/asm-mips/unistd.h
include/asm-parisc/mman.h
include/asm-powerpc/mman.h
include/asm-powerpc/unistd.h
include/asm-s390/bitops.h
include/asm-s390/mman.h
include/asm-s390/setup.h
include/asm-s390/smp.h
include/asm-s390/unistd.h
include/asm-sh/mman.h
include/asm-sparc/mman.h
include/asm-sparc/unistd.h
include/asm-sparc64/mman.h
include/asm-sparc64/unistd.h
include/asm-v850/mman.h
include/asm-x86_64/hpet.h
include/asm-x86_64/ia32_unistd.h
include/asm-x86_64/mman.h
include/asm-xtensa/mman.h
include/linux/compat.h
include/linux/cpumask.h
include/linux/jbd.h
include/linux/kbd_kern.h
include/linux/kexec.h
include/linux/ktime.h
include/linux/lockd/lockd.h
include/linux/netfilter.h
include/linux/netfilter_ipv4.h
include/linux/netlink.h
include/linux/pci_ids.h
include/linux/ptrace.h
include/linux/sched.h
include/linux/syscalls.h
include/linux/time.h
include/linux/tty.h
include/linux/tty_flip.h
include/net/bluetooth/rfcomm.h
include/net/ip.h
include/net/irda/irda.h
include/net/irda/irlap.h
include/net/xfrm.h
include/scsi/iscsi_if.h
include/scsi/scsi.h
include/scsi/scsi_transport_iscsi.h
include/video/neomagic.h
init/initramfs.c
init/main.c
ipc/mqueue.c
ipc/shm.c
kernel/cpuset.c
kernel/fork.c
kernel/hrtimer.c
kernel/panic.c
kernel/power/snapshot.c
kernel/ptrace.c
kernel/sched.c
kernel/signal.c
lib/radix-tree.c
mm/hugetlb.c
mm/madvise.c
mm/page_alloc.c
mm/slab.c
mm/swap.c
mm/vmscan.c
net/802/p8023.c
net/atm/signaling.c
net/bluetooth/hci_sock.c
net/bluetooth/rfcomm/core.c
net/bridge/br_if.c
net/bridge/br_input.c
net/bridge/br_netfilter.c
net/bridge/br_private.h
net/bridge/br_stp_bpdu.c
net/bridge/br_stp_if.c
net/bridge/br_sysfs_if.c
net/core/datagram.c
net/core/rtnetlink.c
net/ipv4/devinet.c
net/ipv4/fib_semantics.c
net/ipv4/icmp.c
net/ipv4/ip_gre.c
net/ipv4/ip_output.c
net/ipv4/ipip.c
net/ipv4/netfilter.c
net/ipv4/netfilter/ip_nat_standalone.c
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
net/ipv4/tcp_input.c
net/ipv4/xfrm4_output.c
net/ipv6/icmp.c
net/ipv6/netfilter/ip6t_REJECT.c
net/ipv6/raw.c
net/irda/irda_device.c
net/irda/irnet/irnet_irda.c
net/netfilter/Kconfig
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_proto_tcp.c
net/netfilter/nf_conntrack_proto_udp.c
net/netlink/af_netlink.c
net/netlink/genetlink.c
net/xfrm/xfrm_policy.c
scripts/kconfig/Makefile

diff --git a/Documentation/fujitsu/frv/kernel-ABI.txt b/Documentation/fujitsu/frv/kernel-ABI.txt
new file mode 100644 (file)
index 0000000..0ed9b0a
--- /dev/null
@@ -0,0 +1,234 @@
+                                =================================
+                                INTERNAL KERNEL ABI FOR FR-V ARCH
+                                =================================
+
+The internal FRV kernel ABI is not quite the same as the userspace ABI. A number of the registers
+are used for special purposed, and the ABI is not consistent between modules vs core, and MMU vs
+no-MMU.
+
+This partly stems from the fact that FRV CPUs do not have a separate supervisor stack pointer, and
+most of them do not have any scratch registers, thus requiring at least one general purpose
+register to be clobbered in such an event. Also, within the kernel core, it is possible to simply
+jump or call directly between functions using a relative offset. This cannot be extended to modules
+for the displacement is likely to be too far. Thus in modules the address of a function to call
+must be calculated in a register and then used, requiring two extra instructions.
+
+This document has the following sections:
+
+ (*) System call register ABI
+ (*) CPU operating modes
+ (*) Internal kernel-mode register ABI
+ (*) Internal debug-mode register ABI
+ (*) Virtual interrupt handling
+
+
+========================
+SYSTEM CALL REGISTER ABI
+========================
+
+When a system call is made, the following registers are effective:
+
+       REGISTERS       CALL                    RETURN
+       =============== ======================= =======================
+       GR7             System call number      Preserved
+       GR8             Syscall arg #1          Return value
+       GR9-GR13        Syscall arg #2-6        Preserved
+
+
+===================
+CPU OPERATING MODES
+===================
+
+The FR-V CPU has three basic operating modes. In order of increasing capability:
+
+  (1) User mode.
+
+      Basic userspace running mode.
+
+  (2) Kernel mode.
+
+      Normal kernel mode. There are many additional control registers available that may be
+      accessed in this mode, in addition to all the stuff available to user mode. This has two
+      submodes:
+
+      (a) Exceptions enabled (PSR.T == 1).
+
+         Exceptions will invoke the appropriate normal kernel mode handler. On entry to the
+         handler, the PSR.T bit will be cleared.
+
+      (b) Exceptions disabled (PSR.T == 0).
+
+         No exceptions or interrupts may happen. Any mandatory exceptions will cause the CPU to
+         halt unless the CPU is told to jump into debug mode instead.
+
+  (3) Debug mode.
+
+      No exceptions may happen in this mode. Memory protection and management exceptions will be
+      flagged for later consideration, but the exception handler won't be invoked. Debugging traps
+      such as hardware breakpoints and watchpoints will be ignored. This mode is entered only by
+      debugging events obtained from the other two modes.
+
+      All kernel mode registers may be accessed, plus a few extra debugging specific registers.
+
+
+=================================
+INTERNAL KERNEL-MODE REGISTER ABI
+=================================
+
+There are a number of permanent register assignments that are set up by entry.S in the exception
+prologue. Note that there is a complete set of exception prologues for each of user->kernel
+transition and kernel->kernel transition. There are also user->debug and kernel->debug mode
+transition prologues.
+
+
+       REGISTER        FLAVOUR USE
+       =============== ======= ====================================================
+       GR1                     Supervisor stack pointer
+       GR15                    Current thread info pointer
+       GR16                    GP-Rel base register for small data
+       GR28                    Current exception frame pointer (__frame)
+       GR29                    Current task pointer (current)
+       GR30                    Destroyed by kernel mode entry
+       GR31            NOMMU   Destroyed by debug mode entry
+       GR31            MMU     Destroyed by TLB miss kernel mode entry
+       CCR.ICC2                Virtual interrupt disablement tracking
+       CCCR.CC3                Cleared by exception prologue (atomic op emulation)
+       SCR0            MMU     See mmu-layout.txt.
+       SCR1            MMU     See mmu-layout.txt.
+       SCR2            MMU     Save for EAR0 (destroyed by icache insns in debug mode)
+       SCR3            MMU     Save for GR31 during debug exceptions
+       DAMR/IAMR       NOMMU   Fixed memory protection layout.
+       DAMR/IAMR       MMU     See mmu-layout.txt.
+
+
+Certain registers are also used or modified across function calls:
+
+       REGISTER        CALL                            RETURN
+       =============== =============================== ===============================
+       GR0             Fixed Zero                      -
+       GR2             Function call frame pointer
+       GR3             Special                         Preserved
+       GR3-GR7         -                               Clobbered
+       GR8             Function call arg #1            Return value (or clobbered)
+       GR9             Function call arg #2            Return value MSW (or clobbered)
+       GR10-GR13       Function call arg #3-#6         Clobbered
+       GR14            -                               Clobbered
+       GR15-GR16       Special                         Preserved
+       GR17-GR27       -                               Preserved
+       GR28-GR31       Special                         Only accessed explicitly
+       LR              Return address after CALL       Clobbered
+       CCR/CCCR        -                               Mostly Clobbered
+
+
+================================
+INTERNAL DEBUG-MODE REGISTER ABI
+================================
+
+This is the same as the kernel-mode register ABI for functions calls. The difference is that in
+debug-mode there's a different stack and a different exception frame. Almost all the global
+registers from kernel-mode (including the stack pointer) may be changed.
+
+       REGISTER        FLAVOUR USE
+       =============== ======= ====================================================
+       GR1                     Debug stack pointer
+       GR16                    GP-Rel base register for small data
+       GR31                    Current debug exception frame pointer (__debug_frame)
+       SCR3            MMU     Saved value of GR31
+
+
+Note that debug mode is able to interfere with the kernel's emulated atomic ops, so it must be
+exceedingly careful not to do any that would interact with the main kernel in this regard. Hence
+the debug mode code (gdbstub) is almost completely self-contained. The only external code used is
+the sprintf family of functions.
+
+Futhermore, break.S is so complicated because single-step mode does not switch off on entry to an
+exception. That means unless manually disabled, single-stepping will blithely go on stepping into
+things like interrupts. See gdbstub.txt for more information.
+
+
+==========================
+VIRTUAL INTERRUPT HANDLING
+==========================
+
+Because accesses to the PSR is so slow, and to disable interrupts we have to access it twice (once
+to read and once to write), we don't actually disable interrupts at all if we don't have to. What
+we do instead is use the ICC2 condition code flags to note virtual disablement, such that if we
+then do take an interrupt, we note the flag, really disable interrupts, set another flag and resume
+execution at the point the interrupt happened. Setting condition flags as a side effect of an
+arithmetic or logical instruction is really fast. This use of the ICC2 only occurs within the
+kernel - it does not affect userspace.
+
+The flags we use are:
+
+ (*) CCR.ICC2.Z [Zero flag]
+
+     Set to virtually disable interrupts, clear when interrupts are virtually enabled. Can be
+     modified by logical instructions without affecting the Carry flag.
+
+ (*) CCR.ICC2.C [Carry flag]
+
+     Clear to indicate hardware interrupts are really disabled, set otherwise.
+
+
+What happens is this:
+
+ (1) Normal kernel-mode operation.
+
+       ICC2.Z is 0, ICC2.C is 1.
+
+ (2) An interrupt occurs. The exception prologue examines ICC2.Z and determines that nothing needs
+     doing. This is done simply with an unlikely BEQ instruction.
+
+ (3) The interrupts are disabled (local_irq_disable)
+
+       ICC2.Z is set to 1.
+
+ (4) If interrupts were then re-enabled (local_irq_enable):
+
+       ICC2.Z would be set to 0.
+
+     A TIHI #2 instruction (trap #2 if condition HI - Z==0 && C==0) would be used to trap if
+     interrupts were now virtually enabled, but physically disabled - which they're not, so the
+     trap isn't taken. The kernel would then be back to state (1).
+
+ (5) An interrupt occurs. The exception prologue examines ICC2.Z and determines that the interrupt
+     shouldn't actually have happened. It jumps aside, and there disabled interrupts by setting
+     PSR.PIL to 14 and then it clears ICC2.C.
+
+ (6) If interrupts were then saved and disabled again (local_irq_save):
+
+       ICC2.Z would be shifted into the save variable and masked off (giving a 1).
+
+       ICC2.Z would then be set to 1 (thus unchanged), and ICC2.C would be unaffected (ie: 0).
+
+ (7) If interrupts were then restored from state (6) (local_irq_restore):
+
+       ICC2.Z would be set to indicate the result of XOR'ing the saved value (ie: 1) with 1, which
+       gives a result of 0 - thus leaving ICC2.Z set.
+
+       ICC2.C would remain unaffected (ie: 0).
+
+     A TIHI #2 instruction would be used to again assay the current state, but this would do
+     nothing as Z==1.
+
+ (8) If interrupts were then enabled (local_irq_enable):
+
+       ICC2.Z would be cleared. ICC2.C would be left unaffected. Both flags would now be 0.
+
+     A TIHI #2 instruction again issued to assay the current state would then trap as both Z==0
+     [interrupts virtually enabled] and C==0 [interrupts really disabled] would then be true.
+
+ (9) The trap #2 handler would simply enable hardware interrupts (set PSR.PIL to 0), set ICC2.C to
+     1 and return.
+
+(10) Immediately upon returning, the pending interrupt would be taken.
+
+(11) The interrupt handler would take the path of actually processing the interrupt (ICC2.Z is
+     clear, BEQ fails as per step (2)).
+
+(12) The interrupt handler would then set ICC2.C to 1 since hardware interrupts are definitely
+     enabled - or else the kernel wouldn't be here.
+
+(13) On return from the interrupt handler, things would be back to state (1).
+
+This trap (#2) is only available in kernel mode. In user mode it will result in SIGILL.
index 5d23776e99076b795053109ea577b97211975194..bbeaba68044352e3442bb31721156a1c9c5e105e 100644 (file)
@@ -36,6 +36,10 @@ Module Parameters
   (default is 1)
   Use 'init=0' to bypass initializing the chip.
   Try this if your computer crashes when you load the module.
+* reset: int
+  (default is 0)
+  The driver used to reset the chip on load, but does no more. Use
+  'reset=1' to restore the old behavior. Report if you need to do this.
 
 Description
 -----------
index 84370363da809a67733cd346e429af2e56bef91c..ac75b57edf2e71050d4eacd1b1b91d2aaa987076 100644 (file)
@@ -1133,6 +1133,8 @@ running once the system is up.
                                Mechanism 1.
                conf2           [IA-32] Force use of PCI Configuration
                                Mechanism 2.
+               nommconf        [IA-32,X86_64] Disable use of MMCONFIG for PCI
+                               Configuration
                nosort          [IA-32] Don't sort PCI devices according to
                                order given by the PCI BIOS. This sorting is
                                done to get a device order compatible with
index 0ea5a0c6e8277f9691f21aed46edfa923d30adf4..2c3b1eae42801ae38fe9fe4eb2174f15b44c89f3 100644 (file)
@@ -136,17 +136,20 @@ Kprobes, jprobes, and return probes are implemented on the following
 architectures:
 
 - i386
-- x86_64 (AMD-64, E64MT)
+- x86_64 (AMD-64, EM64T)
 - ppc64
-- ia64 (Support for probes on certain instruction types is still in progress.)
+- ia64 (Does not support probes on instruction slot1.)
 - sparc64 (Return probes not yet implemented.)
 
 3. Configuring Kprobes
 
 When configuring the kernel using make menuconfig/xconfig/oldconfig,
-ensure that CONFIG_KPROBES is set to "y".  Under "Kernel hacking",
-look for "Kprobes".  You may have to enable "Kernel debugging"
-(CONFIG_DEBUG_KERNEL) before you can enable Kprobes.
+ensure that CONFIG_KPROBES is set to "y".  Under "Instrumentation
+Support", look for "Kprobes".
+
+So that you can load and unload Kprobes-based instrumentation modules,
+make sure "Loadable module support" (CONFIG_MODULES) and "Module
+unloading" (CONFIG_MODULE_UNLOAD) are set to "y".
 
 You may also want to ensure that CONFIG_KALLSYMS and perhaps even
 CONFIG_KALLSYMS_ALL are set to "y", since kallsyms_lookup_name()
@@ -262,18 +265,18 @@ at any time after the probe has been registered.
 
 5. Kprobes Features and Limitations
 
-As of Linux v2.6.12, Kprobes allows multiple probes at the same
-address.  Currently, however, there cannot be multiple jprobes on
-the same function at the same time.
+Kprobes allows multiple probes at the same address.  Currently,
+however, there cannot be multiple jprobes on the same function at
+the same time.
 
 In general, you can install a probe anywhere in the kernel.
 In particular, you can probe interrupt handlers.  Known exceptions
 are discussed in this section.
 
-For obvious reasons, it's a bad idea to install a probe in
-the code that implements Kprobes (mostly kernel/kprobes.c and
-arch/*/kernel/kprobes.c).  A patch in the v2.6.13 timeframe instructs
-Kprobes to reject such requests.
+The register_*probe functions will return -EINVAL if you attempt
+to install a probe in the code that implements Kprobes (mostly
+kernel/kprobes.c and arch/*/kernel/kprobes.c, but also functions such
+as do_page_fault and notifier_call_chain).
 
 If you install a probe in an inline-able function, Kprobes makes
 no attempt to chase down all inline instances of the function and
@@ -290,18 +293,14 @@ from the accidental ones.  Don't drink and probe.
 
 Kprobes makes no attempt to prevent probe handlers from stepping on
 each other -- e.g., probing printk() and then calling printk() from a
-probe handler.  As of Linux v2.6.12, if a probe handler hits a probe,
-that second probe's handlers won't be run in that instance.
-
-In Linux v2.6.12 and previous versions, Kprobes' data structures are
-protected by a single lock that is held during probe registration and
-unregistration and while handlers are run.  Thus, no two handlers
-can run simultaneously.  To improve scalability on SMP systems,
-this restriction will probably be removed soon, in which case
-multiple handlers (or multiple instances of the same handler) may
-run concurrently on different CPUs.  Code your handlers accordingly.
-
-Kprobes does not use semaphores or allocate memory except during
+probe handler.  If a probe handler hits a probe, that second probe's
+handlers won't be run in that instance, and the kprobe.nmissed member
+of the second probe will be incremented.
+
+As of Linux v2.6.15-rc1, multiple handlers (or multiple instances of
+the same handler) may run concurrently on different CPUs.
+
+Kprobes does not use mutexes or allocate memory except during
 registration and unregistration.
 
 Probe handlers are run with preemption disabled.  Depending on the
@@ -316,11 +315,18 @@ address instead of the real return address for kretprobed functions.
 (As far as we can tell, __builtin_return_address() is used only
 for instrumentation and error reporting.)
 
-If the number of times a function is called does not match the
-number of times it returns, registering a return probe on that
-function may produce undesirable results.  We have the do_exit()
-and do_execve() cases covered.  do_fork() is not an issue.  We're
-unaware of other specific cases where this could be a problem.
+If the number of times a function is called does not match the number
+of times it returns, registering a return probe on that function may
+produce undesirable results.  We have the do_exit() case covered.
+do_execve() and do_fork() are not an issue.  We're unaware of other
+specific cases where this could be a problem.
+
+If, upon entry to or exit from a function, the CPU is running on
+a stack other than that of the current task, registering a return
+probe on that function may produce undesirable results.  For this
+reason, Kprobes doesn't support return probes (or kprobes or jprobes)
+on the x86_64 version of __switch_to(); the registration functions
+return -EINVAL.
 
 6. Probe Overhead
 
@@ -347,14 +353,12 @@ k = 0.77 usec; j = 1.31; r = 1.26; kr = 1.45; jr = 1.99
 
 7. TODO
 
-a. SystemTap (http://sourceware.org/systemtap): Work in progress
-to provide a simplified programming interface for probe-based
-instrumentation.
-b. Improved SMP scalability: Currently, work is in progress to handle
-multiple kprobes in parallel.
-c. Kernel return probes for sparc64.
-d. Support for other architectures.
-e. User-space probes.
+a. SystemTap (http://sourceware.org/systemtap): Provides a simplified
+programming interface for probe-based instrumentation.  Try it out.
+b. Kernel return probes for sparc64.
+c. Support for other architectures.
+d. User-space probes.
+e. Watchpoint probes (which fire on data references).
 
 8. Kprobes Example
 
@@ -411,8 +415,7 @@ int init_module(void)
                printk("Couldn't find %s to plant kprobe\n", "do_fork");
                return -1;
        }
-       ret = register_kprobe(&kp);
-       if (ret < 0) {
+       if ((ret = register_kprobe(&kp) < 0)) {
                printk("register_kprobe failed, returned %d\n", ret);
                return -1;
        }
index a7e4c4ea3560faf6dfc2a4f48eeb79ed3950c970..afb31c141d9d281a3a5b406cffb29220961d02cc 100644 (file)
@@ -95,11 +95,13 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
 CONFIG_IDEDMA_PCI_AUTO=y
 CONFIG_BLK_DEV_IDE_AU1XXX=y
 CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y
-CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON=y
 CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128
 CONFIG_BLK_DEV_IDEDMA=y
 CONFIG_IDEDMA_AUTO=y
 
+Also define 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to enable
+the burst support on DBDMA controller.
+
 If the used system need the USB support enable the following kernel configs for
 high IDE to USB throughput.
 
@@ -115,6 +117,8 @@ CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128
 CONFIG_BLK_DEV_IDEDMA=y
 CONFIG_IDEDMA_AUTO=y
 
+Also undefine 'IDE_AU1XXX_BURSTMODE' in 'drivers/ide/mips/au1xxx-ide.c' to
+disable the burst support on DBDMA controller.
 
 ADD NEW HARD DISC TO WHITE OR BLACK LIST
 ----------------------------------------
index 54e5f9b1536d7eac8765d8317c2ce7c3994c429f..d02c64953dcdb63443a653cdf79691823368f694 100644 (file)
@@ -44,7 +44,6 @@
                            compiler and the textural representation of
                            the tree that can be "compiled" by dtc.
 
-
    November 21, 2005: Rev 0.5
                         - Additions/generalizations for 32-bit
                         - Changed to reflect the new arch/powerpc
@@ -1307,6 +1306,65 @@ platforms are moved over to use the flattened-device-tree model.
        };
 
 
+   f) Freescale SOC USB controllers
+
+   The device node for a USB controller that is part of a Freescale
+   SOC is as described in the document "Open Firmware Recommended
+   Practice : Universal Serial Bus" with the following modifications
+   and additions :  
+
+   Required properties :
+    - compatible : Should be "fsl-usb2-mph" for multi port host usb
+      controllers, or "fsl-usb2-dr" for dual role usb controllers
+    - phy_type : For multi port host usb controllers, should be one of
+      "ulpi", or "serial". For dual role usb controllers, should be
+      one of "ulpi", "utmi", "utmi_wide", or "serial".
+    - reg : Offset and length of the register set for the device
+    - port0 : boolean; if defined, indicates port0 is connected for
+      fsl-usb2-mph compatible controllers.  Either this property or
+      "port1" (or both) must be defined for "fsl-usb2-mph" compatible 
+      controllers.
+    - port1 : boolean; if defined, indicates port1 is connected for
+      fsl-usb2-mph compatible controllers.  Either this property or
+      "port0" (or both) must be defined for "fsl-usb2-mph" compatible 
+      controllers.
+
+   Recommended properties :
+    - interrupts : <a b> where a is the interrupt number and b is a
+      field that represents an encoding of the sense and level
+      information for the interrupt.  This should be encoded based on
+      the information in section 2) depending on the type of interrupt
+      controller you have.
+    - interrupt-parent : the phandle for the interrupt controller that
+      services interrupts for this device.
+
+   Example multi port host usb controller device node : 
+       usb@22000 {
+               device_type = "usb";
+               compatible = "fsl-usb2-mph";
+               reg = <22000 1000>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               interrupt-parent = <700>;
+               interrupts = <27 1>;
+               phy_type = "ulpi";
+               port0;
+               port1;
+       };
+
+   Example dual role usb controller device node : 
+       usb@23000 {
+               device_type = "usb";
+               compatible = "fsl-usb2-dr";
+               reg = <23000 1000>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               interrupt-parent = <700>;
+               interrupts = <26 1>;
+               phy = "ulpi";
+       };
+
+
    More devices will be defined as this spec matures.
 
 
index f8c16cbf56ba0a96f97392ea514430daffbb5576..2dafa63bd370bd1632f08f73687e210f08636494 100644 (file)
@@ -1,3 +1,26 @@
+1 Release Date    : Wed Feb 03 14:31:44 PST 2006 - Sumant Patro <Sumant.Patro@lsil.com>
+2 Current Version : 00.00.02.04
+3 Older Version   : 00.00.02.04 
+
+i.     Support for 1078 type (ppc IOP) controller, device id : 0x60 added.
+       During initialization, depending on the device id, the template members 
+       are initialized with function pointers specific to the ppc or 
+       xscale controllers.  
+
+               -Sumant Patro <Sumant.Patro@lsil.com>
+               
+1 Release Date    : Fri Feb 03 14:16:25 PST 2006 - Sumant Patro 
+                                                       <Sumant.Patro@lsil.com>
+2 Current Version : 00.00.02.04
+3 Older Version   : 00.00.02.02 
+i.     Register 16 byte CDB capability with scsi midlayer 
+
+       "Ths patch properly registers the 16 byte command length capability of the 
+       megaraid_sas controlled hardware with the scsi midlayer. All megaraid_sas 
+       hardware supports 16 byte CDB's."
+
+               -Joshua Giles <joshua_giles@dell.com> 
+
 1 Release Date    : Mon Jan 23 14:09:01 PST 2006 - Sumant Patro <Sumant.Patro@lsil.com>
 2 Current Version : 00.00.02.02
 3 Older Version   : 00.00.02.01 
index b22db521cec1eb5735878615f1dc70968a5c9f4e..9c592aa0280ca1d0ca8c0c43a85295319b676be3 100644 (file)
@@ -2232,7 +2232,23 @@ P:       Martin Schwidefsky
 M:     schwidefsky@de.ibm.com
 M:     linux390@de.ibm.com
 L:     linux-390@vm.marist.edu
-W:     http://oss.software.ibm.com/developerworks/opensource/linux390
+W:     http://www.ibm.com/developerworks/linux/linux390/
+S:     Supported
+
+S390 NETWORK DRIVERS
+P:     Frank Pavlic
+M:     fpavlic@de.ibm.com
+M:     linux390@de.ibm.com
+L:     linux-390@vm.marist.edu
+W:     http://www.ibm.com/developerworks/linux/linux390/
+S:     Supported
+
+S390 ZFCP DRIVER
+P:     Andreas Herrmann
+M:     aherrman@de.ibm.com
+M:     linux390@de.ibm.com
+L:     linux-390@vm.marist.edu
+W:     http://www.ibm.com/developerworks/linux/linux390/
 S:     Supported
 
 SAA7146 VIDEO4LINUX-2 DRIVER
index a1158d1c051e348b86ba840fe7da5400714b0b72..48d569d46ae1c023e6e9f0311612e50f78cb90bb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 16
-EXTRAVERSION =-rc2
+EXTRAVERSION =-rc3
 NAME=Sliding Snow Leopard
 
 # *DOCUMENTATION*
@@ -106,13 +106,12 @@ KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
 $(if $(KBUILD_OUTPUT),, \
      $(error output directory "$(saved-output)" does not exist))
 
-.PHONY: $(MAKECMDGOALS) cdbuilddir
-$(MAKECMDGOALS) _all: cdbuilddir
+.PHONY: $(MAKECMDGOALS)
 
-cdbuilddir:
+$(filter-out _all,$(MAKECMDGOALS)) _all:
        $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
        KBUILD_SRC=$(CURDIR) \
-       KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $(MAKECMDGOALS)
+       KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $@
 
 # Leave processing to above invocation of make
 skip-makefile := 1
index 1c316f14ed94db669ae0ff00092bf446904eefac..646a3a5d33a50547ead10b3a201abc1e82ee3ced 100644 (file)
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
-//#include <asm/debug-ll.h>
+
 #include <asm/arch/regs-serial.h>
 #include <asm/arch/regs-lcd.h>
 
+#include <asm/arch/h1940-latch.h>
 #include <asm/arch/fb.h>
 
 #include <linux/serial_core.h>
 #include "cpu.h"
 
 static struct map_desc h1940_iodesc[] __initdata = {
-       /* nothing here yet */
+       [0] = {
+               .virtual        = (unsigned long)H1940_LATCH,
+               .pfn            = __phys_to_pfn(H1940_PA_LATCH),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE
+       },
 };
 
 #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
@@ -92,6 +98,25 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = {
        }
 };
 
+/* Board control latch control */
+
+static unsigned int latch_state = H1940_LATCH_DEFAULT;
+
+void h1940_latch_control(unsigned int clear, unsigned int set)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+
+       latch_state &= ~clear;
+       latch_state |= set;
+
+       __raw_writel(latch_state, H1940_LATCH);
+
+       local_irq_restore(flags);
+}
+
+EXPORT_SYMBOL_GPL(h1940_latch_control);
 
 
 /**
diff --git a/arch/arm/mach-s3c2410/s3c2400.h b/arch/arm/mach-s3c2410/s3c2400.h
new file mode 100644 (file)
index 0000000..8b2394e
--- /dev/null
@@ -0,0 +1,31 @@
+/* arch/arm/mach-s3c2410/s3c2400.h
+ *
+ * Copyright (c) 2004 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Header file for S3C2400 cpu support
+ *
+ * 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.
+ *
+ * Modifications:
+ *     09-Fev-2006 LCVR  First version, based on s3c2410.h
+*/
+
+#ifdef CONFIG_CPU_S3C2400
+
+extern  int s3c2400_init(void);
+
+extern void s3c2400_map_io(struct map_desc *mach_desc, int size);
+
+extern void s3c2400_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+
+extern void s3c2400_init_clocks(int xtal);
+
+#else
+#define s3c2400_init_clocks NULL
+#define s3c2400_init_uarts NULL
+#define s3c2400_map_io NULL
+#define s3c2400_init NULL
+#endif
index 60a617aff8ba465d83b38f09ebf9cbdc1dbe684c..e0838371237093e3f4800d5c12ccc604d363526f 100644 (file)
@@ -25,6 +25,10 @@ config GENERIC_HARDIRQS
        bool
        default n
 
+config TIME_LOW_RES
+       bool
+       default y
+
 mainmenu "Fujitsu FR-V Kernel Configuration"
 
 source "init/Kconfig"
index 90c0fb8d9dc3de577f3bbc011a4911821881a5fc..d163747d17c0e5a45f4be201007b498fbf84cc22 100644 (file)
@@ -81,7 +81,7 @@ endif
 # - reserve CC3 for use with atomic ops
 # - all the extra registers are dealt with only at context switch time
 CFLAGS         += -mno-fdpic -mgpr-32 -msoft-float -mno-media
-CFLAGS         += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15
+CFLAGS         += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15 -ffixed-icc2
 AFLAGS         += -mno-fdpic
 ASFLAGS                += -mno-fdpic
 
index 33233dc23e292602637b1e1752c8f86f687b1215..687c48d62dde73b8d67a8a6bc2cd76dfcb61d773 100644 (file)
@@ -200,12 +200,20 @@ __break_step:
        movsg           bpcsr,gr2
        sethi.p         %hi(__entry_kernel_external_interrupt),gr3
        setlo           %lo(__entry_kernel_external_interrupt),gr3
-       subcc           gr2,gr3,gr0,icc0
+       subcc.p         gr2,gr3,gr0,icc0
+       sethi           %hi(__entry_uspace_external_interrupt),gr3
+       setlo.p         %lo(__entry_uspace_external_interrupt),gr3
        beq             icc0,#2,__break_step_kernel_external_interrupt
-       sethi.p         %hi(__entry_uspace_external_interrupt),gr3
-       setlo           %lo(__entry_uspace_external_interrupt),gr3
-       subcc           gr2,gr3,gr0,icc0
+       subcc.p         gr2,gr3,gr0,icc0
+       sethi           %hi(__entry_kernel_external_interrupt_virtually_disabled),gr3
+       setlo.p         %lo(__entry_kernel_external_interrupt_virtually_disabled),gr3
        beq             icc0,#2,__break_step_uspace_external_interrupt
+       subcc.p         gr2,gr3,gr0,icc0
+       sethi           %hi(__entry_kernel_external_interrupt_virtual_reenable),gr3
+       setlo.p         %lo(__entry_kernel_external_interrupt_virtual_reenable),gr3
+       beq             icc0,#2,__break_step_kernel_external_interrupt_virtually_disabled
+       subcc           gr2,gr3,gr0,icc0
+       beq             icc0,#2,__break_step_kernel_external_interrupt_virtual_reenable
 
        LEDS            0x2007,gr2
 
@@ -254,6 +262,9 @@ __break_step_kernel_softprog_interrupt:
 # step through an external interrupt from kernel mode
        .globl          __break_step_kernel_external_interrupt
 __break_step_kernel_external_interrupt:
+       # deal with virtual interrupt disablement
+       beq             icc2,#0,__break_step_kernel_external_interrupt_virtually_disabled
+
        sethi.p         %hi(__entry_kernel_external_interrupt_reentry),gr3
        setlo           %lo(__entry_kernel_external_interrupt_reentry),gr3
 
@@ -294,6 +305,64 @@ __break_return_as_kernel_prologue:
 #endif
        rett            #1
 
+# we single-stepped into an interrupt handler whilst interrupts were merely virtually disabled
+# need to really disable interrupts, set flag, fix up and return
+__break_step_kernel_external_interrupt_virtually_disabled:
+       movsg           psr,gr2
+       andi            gr2,#~PSR_PIL,gr2
+       ori             gr2,#PSR_PIL_14,gr2     /* debugging interrupts only */
+       movgs           gr2,psr
+
+       ldi             @(gr31,#REG_CCR),gr3
+       movgs           gr3,ccr
+       subcc.p         gr0,gr0,gr0,icc2        /* leave Z set, clear C */
+
+       # exceptions must've been enabled and we must've been in supervisor mode
+       setlos          BPSR_BET|BPSR_BS,gr3
+       movgs           gr3,bpsr
+
+       # return to where the interrupt happened
+       movsg           pcsr,gr2
+       movgs           gr2,bpcsr
+
+       lddi.p          @(gr31,#REG_GR(2)),gr2
+
+       xor             gr31,gr31,gr31
+       movgs           gr0,brr
+#ifdef CONFIG_MMU
+       movsg           scr3,gr31
+#endif
+       rett            #1
+
+# we stepped through into the virtual interrupt reenablement trap
+#
+# we also want to single step anyway, but after fixing up so that we get an event on the
+# instruction after the broken-into exception returns
+       .globl          __break_step_kernel_external_interrupt_virtual_reenable
+__break_step_kernel_external_interrupt_virtual_reenable:
+       movsg           psr,gr2
+       andi            gr2,#~PSR_PIL,gr2
+       movgs           gr2,psr
+
+       ldi             @(gr31,#REG_CCR),gr3
+       movgs           gr3,ccr
+       subicc          gr0,#1,gr0,icc2         /* clear Z, set C */
+
+       # save the adjusted ICC2
+       movsg           ccr,gr3
+       sti             gr3,@(gr31,#REG_CCR)
+
+       # exceptions must've been enabled and we must've been in supervisor mode
+       setlos          BPSR_BET|BPSR_BS,gr3
+       movgs           gr3,bpsr
+
+       # return to where the trap happened
+       movsg           pcsr,gr2
+       movgs           gr2,bpcsr
+
+       # and then process the single step
+       bra             __break_continue
+
 # step through an internal exception from uspace mode
        .globl          __break_step_uspace_softprog_interrupt
 __break_step_uspace_softprog_interrupt:
index 9b9243e2103cd00b5f164a76ad6b270834ec8c4c..81568acea9cdb0fe1b31a4b39ac5a094e587fbbb 100644 (file)
@@ -116,6 +116,8 @@ __break_kerneltrap_fixup_table:
        .long           __break_step_uspace_external_interrupt
        .section .trap.kernel
        .org            \tbr_tt
+       # deal with virtual interrupt disablement
+       beq             icc2,#0,__entry_kernel_external_interrupt_virtually_disabled
        bra             __entry_kernel_external_interrupt
        .section .trap.fixup.kernel
        .org            \tbr_tt >> 2
@@ -259,25 +261,52 @@ __trap_fixup_kernel_data_tlb_miss:
        .org            TBR_TT_TRAP0
        .rept           127
        bra             __entry_uspace_softprog_interrupt
-       bra             __break_step_uspace_softprog_interrupt
-       .long           0,0
+       .long           0,0,0
        .endr
        .org            TBR_TT_BREAK
        bra             __entry_break
        .long           0,0,0
 
+       .section        .trap.fixup.user
+       .org            TBR_TT_TRAP0 >> 2
+       .rept           127
+       .long           __break_step_uspace_softprog_interrupt
+       .endr
+       .org            TBR_TT_BREAK >> 2
+       .long           0
+
        # miscellaneous kernel mode entry points
        .section        .trap.kernel
        .org            TBR_TT_TRAP0
-       .rept           127
        bra             __entry_kernel_softprog_interrupt
-       bra             __break_step_kernel_softprog_interrupt
-       .long           0,0
+       .org            TBR_TT_TRAP1
+       bra             __entry_kernel_softprog_interrupt
+
+       # trap #2 in kernel - reenable interrupts
+       .org            TBR_TT_TRAP2
+       bra             __entry_kernel_external_interrupt_virtual_reenable
+
+       # miscellaneous kernel traps
+       .org            TBR_TT_TRAP3
+       .rept           124
+       bra             __entry_kernel_softprog_interrupt
+       .long           0,0,0
        .endr
        .org            TBR_TT_BREAK
        bra             __entry_break
        .long           0,0,0
 
+       .section        .trap.fixup.kernel
+       .org            TBR_TT_TRAP0 >> 2
+       .long           __break_step_kernel_softprog_interrupt
+       .long           __break_step_kernel_softprog_interrupt
+       .long           __break_step_kernel_external_interrupt_virtual_reenable
+       .rept           124
+       .long           __break_step_kernel_softprog_interrupt
+       .endr
+       .org            TBR_TT_BREAK >> 2
+       .long           0
+
        # miscellaneous debug mode entry points
        .section        .trap.break
        .org            TBR_TT_BREAK
index 5f6548388b74a6d765a23f77e10aa6b793d9be22..1d21c8d34d8ab0b7770599f5ce95f67e28b20886 100644 (file)
@@ -141,7 +141,10 @@ __entry_uspace_external_interrupt_reentry:
 
        movsg           gner0,gr4
        movsg           gner1,gr5
-       stdi            gr4,@(gr28,#REG_GNER0)
+       stdi.p          gr4,@(gr28,#REG_GNER0)
+
+       # interrupts start off fully disabled in the interrupt handler
+       subcc           gr0,gr0,gr0,icc2                /* set Z and clear C */
 
        # set up kernel global registers
        sethi.p         %hi(__kernel_current_task),gr5
@@ -193,9 +196,8 @@ __entry_uspace_external_interrupt_reentry:
         .type          __entry_kernel_external_interrupt,@function
 __entry_kernel_external_interrupt:
        LEDS            0x6210
-
-       sub             sp,gr15,gr31
-       LEDS32
+//     sub             sp,gr15,gr31
+//     LEDS32
 
        # set up the stack pointer
        or.p            sp,gr0,gr30
@@ -231,7 +233,10 @@ __entry_kernel_external_interrupt_reentry:
        stdi            gr24,@(gr28,#REG_GR(24))
        stdi            gr26,@(gr28,#REG_GR(26))
        sti             gr29,@(gr28,#REG_GR(29))
-       stdi            gr30,@(gr28,#REG_GR(30))
+       stdi.p          gr30,@(gr28,#REG_GR(30))
+
+       # note virtual interrupts will be fully enabled upon return
+       subicc          gr0,#1,gr0,icc2                 /* clear Z, set C */
 
        movsg           tbr ,gr20
        movsg           psr ,gr22
@@ -267,7 +272,10 @@ __entry_kernel_external_interrupt_reentry:
 
        movsg           gner0,gr4
        movsg           gner1,gr5
-       stdi            gr4,@(gr28,#REG_GNER0)
+       stdi.p          gr4,@(gr28,#REG_GNER0)
+
+       # interrupts start off fully disabled in the interrupt handler
+       subcc           gr0,gr0,gr0,icc2                        /* set Z and clear C */
 
        # set the return address
        sethi.p         %hi(__entry_return_from_kernel_interrupt),gr4
@@ -291,6 +299,45 @@ __entry_kernel_external_interrupt_reentry:
 
        .size           __entry_kernel_external_interrupt,.-__entry_kernel_external_interrupt
 
+###############################################################################
+#
+# deal with interrupts that were actually virtually disabled
+# - we need to really disable them, flag the fact and return immediately
+# - if you change this, you must alter break.S also
+#
+###############################################################################
+       .balign         L1_CACHE_BYTES
+       .globl          __entry_kernel_external_interrupt_virtually_disabled
+       .type           __entry_kernel_external_interrupt_virtually_disabled,@function
+__entry_kernel_external_interrupt_virtually_disabled:
+       movsg           psr,gr30
+       andi            gr30,#~PSR_PIL,gr30
+       ori             gr30,#PSR_PIL_14,gr30           ; debugging interrupts only
+       movgs           gr30,psr
+       subcc           gr0,gr0,gr0,icc2                ; leave Z set, clear C
+       rett            #0
+
+       .size           __entry_kernel_external_interrupt_virtually_disabled,.-__entry_kernel_external_interrupt_virtually_disabled
+
+###############################################################################
+#
+# deal with re-enablement of interrupts that were pending when virtually re-enabled
+# - set ICC2.C, re-enable the real interrupts and return
+# - we can clear ICC2.Z because we shouldn't be here if it's not 0 [due to TIHI]
+# - if you change this, you must alter break.S also
+#
+###############################################################################
+       .balign         L1_CACHE_BYTES
+       .globl          __entry_kernel_external_interrupt_virtual_reenable
+       .type           __entry_kernel_external_interrupt_virtual_reenable,@function
+__entry_kernel_external_interrupt_virtual_reenable:
+       movsg           psr,gr30
+       andi            gr30,#~PSR_PIL,gr30             ; re-enable interrupts
+       movgs           gr30,psr
+       subicc          gr0,#1,gr0,icc2                 ; clear Z, set C
+       rett            #0
+
+       .size           __entry_kernel_external_interrupt_virtual_reenable,.-__entry_kernel_external_interrupt_virtual_reenable
 
 ###############################################################################
 #
@@ -335,6 +382,7 @@ __entry_uspace_softprog_interrupt_reentry:
 
        sethi.p         %hi(__entry_return_from_user_exception),gr23
        setlo           %lo(__entry_return_from_user_exception),gr23
+
        bra             __entry_common
 
        .size           __entry_uspace_softprog_interrupt,.-__entry_uspace_softprog_interrupt
@@ -495,7 +543,10 @@ __entry_common:
 
        movsg           gner0,gr4
        movsg           gner1,gr5
-       stdi            gr4,@(gr28,#REG_GNER0)
+       stdi.p          gr4,@(gr28,#REG_GNER0)
+
+       # set up virtual interrupt disablement
+       subicc          gr0,#1,gr0,icc2                 /* clear Z flag, set C flag */
 
        # set up kernel global registers
        sethi.p         %hi(__kernel_current_task),gr5
@@ -1418,11 +1469,27 @@ sys_call_table:
        .long sys_add_key
        .long sys_request_key
        .long sys_keyctl
-       .long sys_ni_syscall // sys_vperfctr_open
-       .long sys_ni_syscall // sys_vperfctr_control    /* 290 */
-       .long sys_ni_syscall // sys_vperfctr_unlink
-       .long sys_ni_syscall // sys_vperfctr_iresume
-       .long sys_ni_syscall // sys_vperfctr_read
+       .long sys_ioprio_set
+       .long sys_ioprio_get            /* 290 */
+       .long sys_inotify_init
+       .long sys_inotify_add_watch
+       .long sys_inotify_rm_watch
+       .long sys_migrate_pages
+       .long sys_openat                /* 295 */
+       .long sys_mkdirat
+       .long sys_mknodat
+       .long sys_fchownat
+       .long sys_futimesat
+       .long sys_newfstatat            /* 300 */
+       .long sys_unlinkat
+       .long sys_renameat
+       .long sys_linkat
+       .long sys_symlinkat
+       .long sys_readlinkat            /* 305 */
+       .long sys_fchmodat
+       .long sys_faccessat
+       .long sys_pselect6
+       .long sys_ppoll
 
 
 syscall_table_size = (. - sys_call_table)
index c73b4fe9f6ca4be6f20121b931ab32d9ec93ce15..29a5265489b7ec2333bc7ede45332c18ccb0b971 100644 (file)
@@ -513,6 +513,9 @@ __head_mmu_enabled:
        movgs           gr0,ccr
        movgs           gr0,cccr
 
+       # initialise the virtual interrupt handling
+       subcc           gr0,gr0,gr0,icc2                /* set Z, clear C */
+
 #ifdef CONFIG_MMU
        movgs           gr3,scr2
        movgs           gr3,scr3
index 59580c59c62ca899c0a150b59b41f16161d47e6e..27ab4c30aac677396a6cd975e8fb1d99f904e6e5 100644 (file)
@@ -287,18 +287,11 @@ asmlinkage void do_IRQ(void)
        struct irq_source *source;
        int level, cpu;
 
+       irq_enter();
+
        level = (__frame->tbr >> 4) & 0xf;
        cpu = smp_processor_id();
 
-#if 0
-       {
-               static u32 irqcount;
-               *(volatile u32 *) 0xe1200004 = ~((irqcount++ << 8) | level);
-               *(volatile u16 *) 0xffc00100 = (u16) ~0x9999;
-               mb();
-       }
-#endif
-
        if ((unsigned long) __frame - (unsigned long) (current + 1) < 512)
                BUG();
 
@@ -308,40 +301,12 @@ asmlinkage void do_IRQ(void)
 
        kstat_this_cpu.irqs[level]++;
 
-       irq_enter();
-
        for (source = frv_irq_levels[level].sources; source; source = source->next)
                source->doirq(source);
 
-       irq_exit();
-
        __clr_MASK(level);
 
-       /* only process softirqs if we didn't interrupt another interrupt handler */
-       if ((__frame->psr & PSR_PIL) == PSR_PIL_0)
-               if (local_softirq_pending())
-                       do_softirq();
-
-#ifdef CONFIG_PREEMPT
-       local_irq_disable();
-       while (--current->preempt_count == 0) {
-               if (!(__frame->psr & PSR_S) ||
-                   current->need_resched == 0 ||
-                   in_interrupt())
-                       break;
-               current->preempt_count++;
-               local_irq_enable();
-               preempt_schedule();
-               local_irq_disable();
-       }
-#endif
-
-#if 0
-       {
-               *(volatile u16 *) 0xffc00100 = (u16) ~0x6666;
-               mb();
-       }
-#endif
+       irq_exit();
 
 } /* end do_IRQ() */
 
index 539f45e6d15ee1bd78aa549b7470bedc2983dd11..c54f18e65ea6e31873dd3a16a3f1216c5f261478 100644 (file)
@@ -43,15 +43,6 @@ void iounmap(void *addr)
 {
 }
 
-/*
- * __iounmap unmaps nearly everything, so be careful
- * it doesn't free currently pointer/page tables anymore but it
- * wans't used anyway and might be added later.
- */
-void __iounmap(void *addr, unsigned long size)
-{
-}
-
 /*
  * Set new cache mode for some kernel address space.
  * The caller must push data for that range itself, if such data may already
index 80940d712acf76b6bea39df0cc27a618d0f632b1..98308b018a3514c3456b7bee5677e315083bc6ed 100644 (file)
@@ -33,6 +33,10 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
+config TIME_LOW_RES
+       bool
+       default y
+
 config ISA
        bool
        default y
index a380167a13cf6f661fb294704c6b7d6d67f65988..582797db9603f1fa19b3a0d2fae692bf1510efb2 100644 (file)
@@ -169,7 +169,7 @@ endif
 
 config CPU_H8300H
        bool
-       depends on (H8002 || H83007 || H83048 || H83068)
+       depends on (H83002 || H83007 || H83048 || H83068)
        default y
 
 config CPU_H8S
diff --git a/arch/i386/boot/.gitignore b/arch/i386/boot/.gitignore
new file mode 100644 (file)
index 0000000..495f20c
--- /dev/null
@@ -0,0 +1,3 @@
+bootsect
+bzImage
+setup
diff --git a/arch/i386/boot/tools/.gitignore b/arch/i386/boot/tools/.gitignore
new file mode 100644 (file)
index 0000000..378eac2
--- /dev/null
@@ -0,0 +1 @@
+build
diff --git a/arch/i386/kernel/.gitignore b/arch/i386/kernel/.gitignore
new file mode 100644 (file)
index 0000000..40836ad
--- /dev/null
@@ -0,0 +1 @@
+vsyscall.lds
index 5884469f6bfee904cd6e33fd444b08a14b2188e5..2bee6499edd98a9b658aaed95787fbd05cb690ac 100644 (file)
@@ -398,7 +398,11 @@ ignore_int:
        pushl 32(%esp)
        pushl 40(%esp)
        pushl $int_msg
+#ifdef CONFIG_EARLY_PRINTK
+       call early_printk
+#else
        call printk
+#endif
        addl $(5*4),%esp
        popl %ds
        popl %es
index 255adb498268bd0f27b0020fd4402682d0432a1a..fb00ab7b7612821e0c273df1d8f7f98b9a2aafb1 100644 (file)
@@ -87,11 +87,7 @@ EXPORT_SYMBOL(cpu_online_map);
 cpumask_t cpu_callin_map;
 cpumask_t cpu_callout_map;
 EXPORT_SYMBOL(cpu_callout_map);
-#ifdef CONFIG_HOTPLUG_CPU
-cpumask_t cpu_possible_map = CPU_MASK_ALL;
-#else
 cpumask_t cpu_possible_map;
-#endif
 EXPORT_SYMBOL(cpu_possible_map);
 static cpumask_t smp_commenced_mask;
 
index 5a8b3fb6d27bed1728326ecc606afa94307a378c..ac687d00a1ce7e759d4903068120754fd225b398 100644 (file)
@@ -299,7 +299,7 @@ ENTRY(sys_call_table)
        .long sys_mknodat
        .long sys_fchownat
        .long sys_futimesat
-       .long sys_newfstatat            /* 300 */
+       .long sys_fstatat64             /* 300 */
        .long sys_unlinkat
        .long sys_renameat
        .long sys_linkat
index 7c86e3c5f1c1eb48fd4a30acba88416c488efcdd..a7f5a2aceba2d335402a48168d749f2736dadf41 100644 (file)
@@ -282,6 +282,10 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
        if (val != CPUFREQ_RESUMECHANGE)
                write_seqlock_irq(&xtime_lock);
        if (!ref_freq) {
+               if (!freq->old){
+                       ref_freq = freq->new;
+                       goto end;
+               }
                ref_freq = freq->old;
                loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy;
 #ifndef CONFIG_SMP
@@ -307,6 +311,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
 #endif
        }
 
+end:
        if (val != CPUFREQ_RESUMECHANGE)
                write_sequnlock_irq(&xtime_lock);
 
index 4daefb2ec1b281fb5e9169e2440f54cb840d2354..76b728159403376456b118b7615ae5ef5a5ae3fb 100644 (file)
@@ -7,6 +7,21 @@
  *    for details.
  */
 
+/*
+ * The caller puts arg2 in %ecx, which gets pushed. The kernel will use
+ * %ecx itself for arg2. The pushing is because the sysexit instruction
+ * (found in entry.S) requires that we clobber %ecx with the desired %esp.
+ * User code might expect that %ecx is unclobbered though, as it would be
+ * for returning via the iret instruction, so we must push and pop.
+ *
+ * The caller puts arg3 in %edx, which the sysexit instruction requires
+ * for %eip. Thus, exactly as for arg2, we must push and pop.
+ *
+ * Arg6 is different. The caller puts arg6 in %ebp. Since the sysenter
+ * instruction clobbers %esp, the user's %esp won't even survive entry
+ * into the kernel. We store %esp in %ebp. Code in entry.S must fetch
+ * arg6 from the stack.
+ */
        .text
        .globl __kernel_vsyscall
        .type __kernel_vsyscall,@function
index 72a1b9cae2e41beb4b80bd4a523382504ff67e9f..6e4c3baef6cc220af1e4d26a8808c77685120f60 100644 (file)
@@ -240,7 +240,7 @@ static cpumask_t smp_commenced_mask = CPU_MASK_NONE;
 cpumask_t cpu_callin_map = CPU_MASK_NONE;
 cpumask_t cpu_callout_map = CPU_MASK_NONE;
 EXPORT_SYMBOL(cpu_callout_map);
-cpumask_t cpu_possible_map = CPU_MASK_ALL;
+cpumask_t cpu_possible_map = CPU_MASK_NONE;
 EXPORT_SYMBOL(cpu_possible_map);
 
 /* The per processor IRQ masks (these are usually kept in sync) */
index acc18138fb2269de1f9fd7c29390f3c6b779b56c..c049ce414f010359c0c312e08c6bd903b683797d 100644 (file)
@@ -20,7 +20,20 @@ struct frame_head {
 } __attribute__((packed));
 
 static struct frame_head *
-dump_backtrace(struct frame_head * head)
+dump_kernel_backtrace(struct frame_head * head)
+{
+       oprofile_add_trace(head->ret);
+
+       /* frame pointers should strictly progress back up the stack
+        * (towards higher addresses) */
+       if (head >= head->ebp)
+               return NULL;
+
+       return head->ebp;
+}
+
+static struct frame_head *
+dump_user_backtrace(struct frame_head * head)
 {
        struct frame_head bufhead[2];
 
@@ -105,10 +118,10 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth)
 
        if (!user_mode_vm(regs)) {
                while (depth-- && valid_kernel_stack(head, regs))
-                       head = dump_backtrace(head);
+                       head = dump_kernel_backtrace(head);
                return;
        }
 
        while (depth-- && head)
-               head = dump_backtrace(head);
+               head = dump_user_backtrace(head);
 }
index 5856510210fac55247f15294469103c55d49dc6c..b3355a9ca2c3fb3b3b654dae5f7817936758b47c 100644 (file)
@@ -515,6 +515,7 @@ sys32_signal (int sig, unsigned int handler)
 
        sigact_set_handler(&new_sa, handler, 0);
        new_sa.sa.sa_flags = SA_ONESHOT | SA_NOMASK;
+       sigemptyset(&new_sa.sa.sa_mask);
 
        ret = do_sigaction(sig, &new_sa, &old_sa);
 
index 7a6ffd6137895f2abd629ecc936f107251ef6b96..27b222c277e4d77049b35c6bf972dd2995156f4f 100644 (file)
@@ -1601,5 +1601,21 @@ sys_call_table:
        data8 sys_inotify_add_watch
        data8 sys_inotify_rm_watch
        data8 sys_migrate_pages                 // 1280
+       data8 sys_openat
+       data8 sys_mkdirat
+       data8 sys_mknodat
+       data8 sys_fchownat
+       data8 sys_futimesat                     // 1285
+       data8 sys_newfstatat
+       data8 sys_unlinkat
+       data8 sys_renameat
+       data8 sys_linkat
+       data8 sys_symlinkat                     // 1290
+       data8 sys_readlinkat
+       data8 sys_fchmodat
+       data8 sys_faccessat
+       data8 sys_ni_syscall                    // reserved for pselect
+       data8 sys_ni_syscall                    // 1295 reserved for ppoll
+       data8 sys_unshare
 
        .org sys_call_table + 8*NR_syscalls     // guard against failures to increase NR_syscalls
index ce423910ca976553b363ca42ee29f923423c563a..ac6055c83115a7d20d1bbeb0f2806b2816f7cc46 100644 (file)
@@ -878,31 +878,8 @@ fsyscall_table:
        data8 0                         // timer_delete
        data8 0                         // clock_settime
        data8 fsys_clock_gettime        // clock_gettime
-       data8 0                         // clock_getres         // 1255
-       data8 0                         // clock_nanosleep
-       data8 0                         // fstatfs64
-       data8 0                         // statfs64
-       data8 0
-       data8 0                                                 // 1260
-       data8 0
-       data8 0                         // mq_open
-       data8 0                         // mq_unlink
-       data8 0                         // mq_timedsend
-       data8 0                         // mq_timedreceive      // 1265
-       data8 0                         // mq_notify
-       data8 0                         // mq_getsetattr
-       data8 0                         // kexec_load
-       data8 0
-       data8 0                                                 // 1270
-       data8 0
-       data8 0
-       data8 0
-       data8 0
-       data8 0                                                 // 1275
-       data8 0
-       data8 0
-       data8 0
-       data8 0
-       data8 0                                                 // 1280
+       #define __NR_syscall_last       1255
+
+       .space 8*(NR_syscalls + 1024 - __NR_syscall_last), 0
 
        .org fsyscall_table + 8*NR_syscalls     // guard against failures to increase NR_syscalls
index 3492e3211a4416ce615a1d0f14810be94aa6178d..8fd93afa75a7bea9a2b687d70537ce21c8094164 100644 (file)
@@ -437,6 +437,9 @@ recover_from_read_error(slidx_table_t *slidx,
         *    the process not have any locks of kernel.
         */
 
+       /* Is minstate valid? */
+       if (!peidx_bottom(peidx) || !(peidx_bottom(peidx)->valid.minstate))
+               return 0;
        psr1 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_ipsr);
 
        /*
index d7e4d79e16a8d425747d45abed163a124c98b6da..3437c2390429daff50c60e1700dde33e66645198 100644 (file)
@@ -617,15 +617,15 @@ void sn_bus_store_sysdata(struct pci_dev *dev)
 void sn_bus_free_sysdata(void)
 {
        struct sysdata_el *element;
-       struct list_head *list;
+       struct list_head *list, *safe;
 
-sn_sysdata_free_start:
-       list_for_each(list, &sn_sysdata_list) {
+       list_for_each_safe(list, safe, &sn_sysdata_list) {
                element = list_entry(list, struct sysdata_el, entry);
                list_del(&element->entry);
+               list_del(&(((struct pcidev_info *)
+                            (element->sysdata))->pdi_list));
                kfree(element->sysdata);
                kfree(element);
-               goto sn_sysdata_free_start;
        }
        return;
 }
index 74d87d903d5d9928aa1bbaaaad282df6a2269062..c373113d073a5f23a18fa051239b66f37f516243 100644 (file)
@@ -299,7 +299,9 @@ void sn_irq_unfixup(struct pci_dev *pci_dev)
                return;
 
        sn_irq_info = SN_PCIDEV_INFO(pci_dev)->pdi_sn_irq_info;
-       if (!sn_irq_info || !sn_irq_info->irq_irq) {
+       if (!sn_irq_info)
+               return;
+       if (!sn_irq_info->irq_irq) {
                kfree(sn_irq_info);
                return;
        }
index 96b91982805316769128ac8e5a00791b5b4cf8bf..8849439e88dd35f997238d0fbee9e4eea3c342ed 100644 (file)
@@ -21,6 +21,10 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
+config TIME_LOW_RES
+       bool
+       default y
+
 config ARCH_MAY_HAVE_PC_FDC
        bool
        depends on Q40 || (BROKEN && SUN3X)
index 3ba446a99a12372992071f99130541fac45505c4..72f1159cb804cdef7bc2e819afa605bb9f5c226c 100644 (file)
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |BINDEC    idnt    2,1 | Motorola 040 Floating Point Software Package
 
index d53555c0a2b6e75df76c964edce4758b524a9b6f..8a05ba92a8a0f1d493c447044c4d3ef4c7f72c97 100644 (file)
@@ -60,9 +60,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |BINSTR    idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 942c4f6f4fd1c2429e1236c500d39791d5171dba..3bb9c84bb0582d1d012ff40be4ef7bc6d02f57d0 100644 (file)
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |BUGFIX    idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 2160609e328deb32235d81d75db7f238b306695a..16ed796bad87f375b98e21e5804aa375c4648858 100644 (file)
@@ -69,9 +69,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |DECBIN    idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 81f6a9856dceab8474ae99c7d9f062429841b16e..3eff99a804138c39232ed25c05dc6ec7cbeb5b56 100644 (file)
@@ -22,9 +22,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 DO_FUNC:       |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 984a4eb8010adb842a30fbd8298faac63523aa80..5df4cd7729340ad1208d65253729880b1cf1f1e2 100644 (file)
@@ -5,9 +5,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |      fpsp.h --- stack frame offsets during FPSP exception handling
 |
index 401d06f39f7308a4678bfe40cb062a566e502e06..3642cb7e3641748743a799d164dd941be57aff3e 100644 (file)
@@ -29,9 +29,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 GEN_EXCEPT:    |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index c7c2f37274259763964080bdd377e9a14a957a3e..64c36d79ef836ca97a8bbdbe741addcb4c1a452e 100644 (file)
@@ -54,9 +54,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 GET_OP:    |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 476b711967ceb39957c4dcd0dbd34da6768d5f8b..45bcf3455d341e6ae9ebdbdd28e36caa76038f94 100644 (file)
@@ -12,9 +12,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 KERNEL_EX:    |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 8f6b95217865fbed19a6acae1d906b0b960d865f..d9cdf4383545b7aa21dd8b5d6976f38890611e68 100644 (file)
@@ -16,9 +16,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 RES_FUNC:    |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 00f98068783f32bdcaa373d04c212b54683fab2a..f84ae0dd435864d660e9054821cc199fa3135602 100644 (file)
@@ -8,9 +8,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |ROUND idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 83b00ab1c48fe4762574464b2432ecf3a0e6bd44..513c7cca7318d004b5e96b395f2333ff4f575847 100644 (file)
@@ -38,9 +38,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |SACOS idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 5647a60439031ecac86d566c3ef1b67b148f2f91..2a269a58ceaa8ccde03ab59e77c740d34f44c128 100644 (file)
@@ -38,9 +38,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |SASIN idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 20dae222d51e48e06637825067d9b28776564f5c..c8a664998f92d659c2a44937657a1b461fa02600 100644 (file)
@@ -43,9 +43,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |satan idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 20f07810bcdab2fc34e8561fce0ad71dc977d74d..ba91f77a75716e92edc25f6911bd0d81f4c307b2 100644 (file)
@@ -45,9 +45,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |satanh        idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 5c9b805265f23ff2f555e7c352bd150db4329eea..04829dd4f1f48172b978a7d582fcd8f57067cb7b 100644 (file)
@@ -21,9 +21,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |SCALE    idnt    2,1 | Motorola 040 Floating Point Software Package
 
index e81edbb87642007749d43bd57e5bb59aa164c268..07d3a4d7c86d5c7fb4c1527c47b18c04c7770125 100644 (file)
@@ -49,9 +49,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |SCOSH idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 0aa75f9bf7d1872f0b47ffa2b64efe585f26cb98..145af5447581f1f3719549dd9cf7494c02dc44be 100644 (file)
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |setox idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 0fcbd045ba757171b18309861b0eca269aa50506..d9234f4aed57c8801c2a23b99fe4a2d91bdd2ec5 100644 (file)
@@ -24,9 +24,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |SGETEM        idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 0f9bd28e55a0bb4ce1c3a550bd6c5fb86352d30b..0e92d4e5d231b4687348f83a79317560288fe218 100644 (file)
@@ -51,9 +51,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |SINT    idnt    2,1 | Motorola 040 Floating Point Software Package
 
index a1629194e3fd917260604e372371416a1def8b64..a8f41615d94a7283db6638117c59eb91b41f8df8 100644 (file)
@@ -30,9 +30,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |
 |      Modified for Linux-1.3.x by Jes Sorensen (jds@kom.auc.dk)
index 517fa45632463772b3b42d27d4a84267df4b3026..fac2c738382e87c2031055d4f773593a8e797557 100644 (file)
@@ -96,9 +96,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |SLOG2    idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 2aaa0725c035d98696e962f2d662359b54bd4ccc..d98eaf641ec4c65b6997ba01b309958120aaeb17 100644 (file)
@@ -63,9 +63,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |slogn idnt    2,1 | Motorola 040 Floating Point Software Package
 
index a0127fa55e9c061de1cfddad596484de448a57cc..73c36512081b1c66b56cb99f18fed73e8c736012 100644 (file)
@@ -15,9 +15,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |SMOVECR       idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 8c8d7f50cc68df573f4418c1282422ce8feb6520..a27e70c9a0eb3608b21cbebc9c86770736697596 100644 (file)
@@ -66,9 +66,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 SREM_MOD:    |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 043c91cdd6574d4840d0566eefeb349389c8b17b..a1ef8e01bf06703bd732abcd89053e7cec214226 100644 (file)
@@ -83,9 +83,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |SSIN  idnt    2,1 | Motorola 040 Floating Point Software Package
 
index c8b3308bb1438f2ccec917137957563fffe8d9c3..8a560edc7653e903580c74490b0f4d69a2f43f2a 100644 (file)
@@ -49,9 +49,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |SSINH idnt    2,1 | Motorola 040 Floating Point Software Package
 
index b5c2a196e617fec38e16e33eb10411a5ab9f2499..f8553aaececbc64d76be7908e57b43869089558e 100644 (file)
@@ -50,9 +50,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |STAN  idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 33b009802243e30e8e2aeb3606194006725753a3..7e12e59ee8c7cc02f163df53fe157aba7b7777e8 100644 (file)
@@ -49,9 +49,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |STANH idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 0cdca3b060adcac513e7bc9c2394b7cc8b3ffec3..484b47d4eaad3038a29a3094743f9ad7e5a0bd29 100644 (file)
@@ -19,9 +19,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 STO_RES:       |idnt   2,1 | Motorola 040 Floating Point Software Package
 
index 4e3c1407d3df0a10503e592692cb1422e44621ae..0d5e6a1436a638c59f0fc123974f43c418169d69 100644 (file)
@@ -76,9 +76,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |STWOTOX       idnt    2,1 | Motorola 040 Floating Point Software Package
 
index fe60cf4d20d7adc69a74f235711cc20bb2603bca..fd5c37a5a2b97cc24de7bfc0892ca79e54226d04 100644 (file)
@@ -17,9 +17,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |TBLDO idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 452f3d65857b568334f317d5c9020b71708e249d..65b26fa88c60a4918368a2990396ecb1d19b44c6 100644 (file)
@@ -16,9 +16,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 |UTIL  idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 039247b09c8bbae60349c6f760150a3e9407e4c5..d5a576bfac79447b12d7117119c854fb5757a39d 100644 (file)
@@ -13,9 +13,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 X_BSUN:        |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 3917710b0fdecba7c10b1c4c895d249b616ed683..264e126d1db7bc19ffd2d6151b9abb6f5f30e7c2 100644 (file)
@@ -13,9 +13,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 X_FLINE:       |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index b0f54bcb49a75ff90a47c25e9a55c667a4f3f73f..e2c371c3a45dbf084f79076a9058fe6a87dbd087 100644 (file)
@@ -43,9 +43,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 X_OPERR:       |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 22cb8b42c7b6aa79e4dd0166ea4e6de51a18b445..6fe4989ee31f7c5644f521dc42213fa870038551 100644 (file)
@@ -35,9 +35,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 X_OVFL:        |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 039af573312ecfa5b3081207e24dcf83ec266521..4ed7664163781bccaebf477566550cb6404d776d 100644 (file)
@@ -22,9 +22,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 X_SNAN:        |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 4282fa67d449cad22859bc7b4e64e6c0d9252dd2..402dc0c0ebc04d814b69f55636ae1320bf24b747 100644 (file)
@@ -11,9 +11,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 X_STORE:       |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 077fcc230fcc5fde1f1e4bd4df6ba54f9093f9e6..eb772ff3b812c71747de877f3a815b81300454cb 100644 (file)
@@ -21,9 +21,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 X_UNFL:        |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 920cb9410e9e5455418503c525a8690be2c6903f..6f382b21228b68c568e63c8567c7ca27873d78ae 100644 (file)
@@ -22,9 +22,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 X_UNIMP:       |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index 4ec57285b683a5a19c57f66dfa58de3963179ad0..d7cf46208c62900833e892c1e09f9d3784de7b3d 100644 (file)
@@ -23,9 +23,8 @@
 |              Copyright (C) Motorola, Inc. 1990
 |                      All Rights Reserved
 |
-|      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
-|      The copyright notice above does not evidence any
-|      actual or intended publication of such source code.
+|       For details on the license for this file, please see the
+|       file, README, in this same directory.
 
 X_UNSUPP:      |idnt    2,1 | Motorola 040 Floating Point Software Package
 
index e2a6e864896080a42b2cd76e98e43b63d67dc92e..e50858dbc23777ba6ef85b08bb9c70bef6dd211c 100644 (file)
@@ -29,6 +29,10 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
+config TIME_LOW_RES
+       bool
+       default y
+
 source "init/Kconfig"
 
 menu "Processor type and features"
index 6a57407df1bcd1627c86e22de5f3228ad488c9d9..38c0f3360d517aa05794879a8a2a342ca1d86f18 100644 (file)
@@ -94,7 +94,6 @@ endif
 # machines may also.  Since BFD is incredibly buggy with respect to
 # crossformat linking we rely on the elf2ecoff tool for format conversion.
 #
-cflags-y                       += -I $(TOPDIR)/include/asm/gcc
 cflags-y                       += -G 0 -mno-abicalls -fno-pic -pipe
 LDFLAGS_vmlinux                        += -G 0 -static -n -nostdlib
 MODFLAGS                       += -mlong-calls
index 5232fc752935385a7346c7d9702eebd425106c85..092679c2dca9b83bd3e66503d83413daf29853d7 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/a.out.h>
 #include <linux/init.h>
 #include <linux/completion.h>
+#include <linux/kallsyms.h>
 
 #include <asm/abi.h>
 #include <asm/bootinfo.h>
@@ -272,46 +273,19 @@ long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
 
 static struct mips_frame_info {
        void *func;
-       int omit_fp;    /* compiled without fno-omit-frame-pointer */
-       int frame_offset;
+       unsigned long func_size;
+       int frame_size;
        int pc_offset;
-} schedule_frame, mfinfo[] = {
-       { schedule, 0 },        /* must be first */
-       /* arch/mips/kernel/semaphore.c */
-       { __down, 1 },
-       { __down_interruptible, 1 },
-       /* kernel/sched.c */
-#ifdef CONFIG_PREEMPT
-       { preempt_schedule, 0 },
-#endif
-       { wait_for_completion, 0 },
-       { interruptible_sleep_on, 0 },
-       { interruptible_sleep_on_timeout, 0 },
-       { sleep_on, 0 },
-       { sleep_on_timeout, 0 },
-       { yield, 0 },
-       { io_schedule, 0 },
-       { io_schedule_timeout, 0 },
-#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT)
-       { __preempt_spin_lock, 0 },
-       { __preempt_write_lock, 0 },
-#endif
-       /* kernel/timer.c */
-       { schedule_timeout, 1 },
-/*     { nanosleep_restart, 1 }, */
-       /* lib/rwsem-spinlock.c */
-       { __down_read, 1 },
-       { __down_write, 1 },
-};
+} *schedule_frame, mfinfo[64];
+static int mfinfo_num;
 
-static int mips_frame_info_initialized;
 static int __init get_frame_info(struct mips_frame_info *info)
 {
        int i;
        void *func = info->func;
        union mips_instruction *ip = (union mips_instruction *)func;
        info->pc_offset = -1;
-       info->frame_offset = info->omit_fp ? 0 : -1;
+       info->frame_size = 0;
        for (i = 0; i < 128; i++, ip++) {
                /* if jal, jalr, jr, stop. */
                if (ip->j_format.opcode == jal_op ||
@@ -320,6 +294,23 @@ static int __init get_frame_info(struct mips_frame_info *info)
                      ip->r_format.func == jr_op)))
                        break;
 
+               if (info->func_size && i >= info->func_size / 4)
+                       break;
+               if (
+#ifdef CONFIG_32BIT
+                   ip->i_format.opcode == addiu_op &&
+#endif
+#ifdef CONFIG_64BIT
+                   ip->i_format.opcode == daddiu_op &&
+#endif
+                   ip->i_format.rs == 29 &&
+                   ip->i_format.rt == 29) {
+                       /* addiu/daddiu sp,sp,-imm */
+                       if (info->frame_size)
+                               continue;
+                       info->frame_size = - ip->i_format.simmediate;
+               }
+
                if (
 #ifdef CONFIG_32BIT
                    ip->i_format.opcode == sw_op &&
@@ -327,31 +318,20 @@ static int __init get_frame_info(struct mips_frame_info *info)
 #ifdef CONFIG_64BIT
                    ip->i_format.opcode == sd_op &&
 #endif
-                   ip->i_format.rs == 29)
-               {
+                   ip->i_format.rs == 29 &&
+                   ip->i_format.rt == 31) {
                        /* sw / sd $ra, offset($sp) */
-                       if (ip->i_format.rt == 31) {
-                               if (info->pc_offset != -1)
-                                       continue;
-                               info->pc_offset =
-                                       ip->i_format.simmediate / sizeof(long);
-                       }
-                       /* sw / sd $s8, offset($sp) */
-                       if (ip->i_format.rt == 30) {
-//#if 0        /* gcc 3.4 does aggressive optimization... */
-                               if (info->frame_offset != -1)
-                                       continue;
-//#endif
-                               info->frame_offset =
-                                       ip->i_format.simmediate / sizeof(long);
-                       }
+                       if (info->pc_offset != -1)
+                               continue;
+                       info->pc_offset =
+                               ip->i_format.simmediate / sizeof(long);
                }
        }
-       if (info->pc_offset == -1 || info->frame_offset == -1) {
-               printk("Can't analyze prologue code at %p\n", func);
+       if (info->pc_offset == -1 || info->frame_size == 0) {
+               if (func == schedule)
+                       printk("Can't analyze prologue code at %p\n", func);
                info->pc_offset = -1;
-               info->frame_offset = -1;
-               return -1;
+               info->frame_size = 0;
        }
 
        return 0;
@@ -359,25 +339,36 @@ static int __init get_frame_info(struct mips_frame_info *info)
 
 static int __init frame_info_init(void)
 {
-       int i, found;
-       for (i = 0; i < ARRAY_SIZE(mfinfo); i++)
-               if (get_frame_info(&mfinfo[i]))
-                       return -1;
-       schedule_frame = mfinfo[0];
-       /* bubble sort */
-       do {
-               struct mips_frame_info tmp;
-               found = 0;
-               for (i = 1; i < ARRAY_SIZE(mfinfo); i++) {
-                       if (mfinfo[i-1].func > mfinfo[i].func) {
-                               tmp = mfinfo[i];
-                               mfinfo[i] = mfinfo[i-1];
-                               mfinfo[i-1] = tmp;
-                               found = 1;
-                       }
-               }
-       } while (found);
-       mips_frame_info_initialized = 1;
+       int i;
+#ifdef CONFIG_KALLSYMS
+       char *modname;
+       char namebuf[KSYM_NAME_LEN + 1];
+       unsigned long start, size, ofs;
+       extern char __sched_text_start[], __sched_text_end[];
+       extern char __lock_text_start[], __lock_text_end[];
+
+       start = (unsigned long)__sched_text_start;
+       for (i = 0; i < ARRAY_SIZE(mfinfo); i++) {
+               if (start == (unsigned long)schedule)
+                       schedule_frame = &mfinfo[i];
+               if (!kallsyms_lookup(start, &size, &ofs, &modname, namebuf))
+                       break;
+               mfinfo[i].func = (void *)(start + ofs);
+               mfinfo[i].func_size = size;
+               start += size - ofs;
+               if (start >= (unsigned long)__lock_text_end)
+                       break;
+               if (start == (unsigned long)__sched_text_end)
+                       start = (unsigned long)__lock_text_start;
+       }
+#else
+       mfinfo[0].func = schedule;
+       schedule_frame = &mfinfo[0];
+#endif
+       for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++)
+               get_frame_info(&mfinfo[i]);
+
+       mfinfo_num = i;
        return 0;
 }
 
@@ -394,47 +385,52 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
        if (t->reg31 == (unsigned long) ret_from_fork)
                return t->reg31;
 
-       if (schedule_frame.pc_offset < 0)
+       if (!schedule_frame || schedule_frame->pc_offset < 0)
                return 0;
-       return ((unsigned long *)t->reg29)[schedule_frame.pc_offset];
+       return ((unsigned long *)t->reg29)[schedule_frame->pc_offset];
 }
 
 /* get_wchan - a maintenance nightmare^W^Wpain in the ass ...  */
 unsigned long get_wchan(struct task_struct *p)
 {
        unsigned long stack_page;
-       unsigned long frame, pc;
+       unsigned long pc;
+#ifdef CONFIG_KALLSYMS
+       unsigned long frame;
+#endif
 
        if (!p || p == current || p->state == TASK_RUNNING)
                return 0;
 
        stack_page = (unsigned long)task_stack_page(p);
-       if (!stack_page || !mips_frame_info_initialized)
+       if (!stack_page || !mfinfo_num)
                return 0;
 
        pc = thread_saved_pc(p);
+#ifdef CONFIG_KALLSYMS
        if (!in_sched_functions(pc))
                return pc;
 
-       frame = ((unsigned long *)p->thread.reg30)[schedule_frame.frame_offset];
+       frame = p->thread.reg29 + schedule_frame->frame_size;
        do {
                int i;
 
                if (frame < stack_page || frame > stack_page + THREAD_SIZE - 32)
                        return 0;
 
-               for (i = ARRAY_SIZE(mfinfo) - 1; i >= 0; i--) {
+               for (i = mfinfo_num - 1; i >= 0; i--) {
                        if (pc >= (unsigned long) mfinfo[i].func)
                                break;
                }
                if (i < 0)
                        break;
 
-               if (mfinfo[i].omit_fp)
-                       break;
                pc = ((unsigned long *)frame)[mfinfo[i].pc_offset];
-               frame = ((unsigned long *)frame)[mfinfo[i].frame_offset];
+               if (!mfinfo[i].frame_size)
+                       break;
+               frame += mfinfo[i].frame_size;
        } while (in_sched_functions(pc));
+#endif
 
        return pc;
 }
index d7c4a38ed5aee4f226aaf10513414086dc250687..d83e033dbc87ec6cb7fc8a731753208df5f95b21 100644 (file)
@@ -623,7 +623,7 @@ einval:     li      v0, -EINVAL
        sys     sys_mknodat             4       /* 4290 */
        sys     sys_fchownat            5
        sys     sys_futimesat           3
-       sys     sys_newfstatat          4
+       sys     sys_fstatat64           4
        sys     sys_unlinkat            3
        sys     sys_renameat            4       /* 4295 */
        sys     sys_linkat              4
index 0fbc492d24b4a50f97bf2249e2e0905f171ab4e3..36bfc2588aa351cb1776edfe14a9663f11f972ba 100644 (file)
@@ -176,7 +176,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
        if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0))
                sp = current->sas_ss_sp + current->sas_ss_size;
 
-       return (void __user *)((sp - frame_size) & (ICACHE_REFILLS_WORKAROUND_WAR ? 32 : ALMASK));
+       return (void __user *)((sp - frame_size) & (ICACHE_REFILLS_WORKAROUND_WAR ? ~(cpu_icache_line_size()-1) : ALMASK));
 }
 
 static inline int install_sigtramp(unsigned int __user *tramp,
index da3271e1fdac096e9cab303cddd6ece3d9f50f5f..8a8b8dd90417a242f49e295a01db11672655652f 100644 (file)
@@ -537,7 +537,7 @@ _sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
        /* The ucontext contains a stack32_t, so we must convert!  */
        if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
                goto badframe;
-       st.ss_size = (long) sp;
+       st.ss_sp = (void *)(long) sp;
        if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size))
                goto badframe;
        if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags))
index 384fc4a639a49653d785c4fd817fff429569b2bb..5a3776096f074f794ffe2647c7e4d0ac9bd3f38e 100644 (file)
@@ -108,7 +108,7 @@ _sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
        /* The ucontext contains a stack32_t, so we must convert!  */
        if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp))
                goto badframe;
-       st.ss_size = (long) sp;
+       st.ss_sp = (void *)(long) sp;
        if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size))
                goto badframe;
        if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags))
index 794a1c3de2a493b62ac2f60f38c3665d30763489..c930364830d0661defb72b56f6729e7c6af17179 100644 (file)
@@ -68,6 +68,8 @@ void __init sanitize_tlb_entries(void)
 
        set_c0_mvpcontrol(MVPCONTROL_VPC);
 
+       back_to_back_c0_hazard();
+
        /* Disable TLB sharing */
        clear_c0_mvpcontrol(MVPCONTROL_STLB);
 
@@ -102,35 +104,6 @@ void __init sanitize_tlb_entries(void)
        clear_c0_mvpcontrol(MVPCONTROL_VPC);
 }
 
-#if 0
-/*
- * Use c0_MVPConf0 to find out how many CPUs are available, setting up
- * phys_cpu_present_map and the logical/physical mappings.
- */
-void __init prom_build_cpu_map(void)
-{
-       int i, num, ncpus;
-
-       cpus_clear(phys_cpu_present_map);
-
-       /* assume we boot on cpu 0.... */
-       cpu_set(0, phys_cpu_present_map);
-       __cpu_number_map[0] = 0;
-       __cpu_logical_map[0] = 0;
-
-       if (cpu_has_mipsmt) {
-               ncpus = ((read_c0_mvpconf0() & (MVPCONF0_PVPE)) >> MVPCONF0_PVPE_SHIFT) + 1;
-               for (i=1, num=0; i< NR_CPUS && i<ncpus; i++) {
-                       cpu_set(i, phys_cpu_present_map);
-                       __cpu_number_map[i] = ++num;
-                       __cpu_logical_map[num] = i;
-               }
-
-               printk(KERN_INFO "%i available secondary CPU(s)\n", num);
-       }
-}
-#endif
-
 static void ipi_resched_dispatch (struct pt_regs *regs)
 {
        do_IRQ(MIPS_CPU_IPI_RESCHED_IRQ, regs);
@@ -222,6 +195,9 @@ void prom_prepare_cpus(unsigned int max_cpus)
 
                                /* set config to be the same as vpe0, particularly kseg0 coherency alg */
                                write_vpe_c0_config( read_c0_config());
+
+                               /* Propagate Config7 */
+                               write_vpe_c0_config7(read_c0_config7());
                        }
 
                }
index e51c38cef88e82465493e425c8d5dc9c7d57cbdb..1b71d91e82689f9f0effd43b5bbafdff5c96a565 100644 (file)
@@ -471,61 +471,29 @@ struct flush_icache_range_args {
 static inline void local_r4k_flush_icache_range(void *args)
 {
        struct flush_icache_range_args *fir_args = args;
-       unsigned long dc_lsize = cpu_dcache_line_size();
-       unsigned long ic_lsize = cpu_icache_line_size();
-       unsigned long sc_lsize = cpu_scache_line_size();
        unsigned long start = fir_args->start;
        unsigned long end = fir_args->end;
-       unsigned long addr, aend;
 
        if (!cpu_has_ic_fills_f_dc) {
                if (end - start > dcache_size) {
                        r4k_blast_dcache();
                } else {
                        R4600_HIT_CACHEOP_WAR_IMPL;
-                       addr = start & ~(dc_lsize - 1);
-                       aend = (end - 1) & ~(dc_lsize - 1);
-
-                       while (1) {
-                               /* Hit_Writeback_Inv_D */
-                               protected_writeback_dcache_line(addr);
-                               if (addr == aend)
-                                       break;
-                               addr += dc_lsize;
-                       }
+                       protected_blast_dcache_range(start, end);
                }
 
                if (!cpu_icache_snoops_remote_store) {
-                       if (end - start > scache_size) {
+                       if (end - start > scache_size)
                                r4k_blast_scache();
-                       } else {
-                               addr = start & ~(sc_lsize - 1);
-                               aend = (end - 1) & ~(sc_lsize - 1);
-
-                               while (1) {
-                                       /* Hit_Writeback_Inv_SD */
-                                       protected_writeback_scache_line(addr);
-                                       if (addr == aend)
-                                               break;
-                                       addr += sc_lsize;
-                               }
-                       }
+                       else
+                               protected_blast_scache_range(start, end);
                }
        }
 
        if (end - start > icache_size)
                r4k_blast_icache();
-       else {
-               addr = start & ~(ic_lsize - 1);
-               aend = (end - 1) & ~(ic_lsize - 1);
-               while (1) {
-                       /* Hit_Invalidate_I */
-                       protected_flush_icache_line(addr);
-                       if (addr == aend)
-                               break;
-                       addr += ic_lsize;
-               }
-       }
+       else
+               protected_blast_icache_range(start, end);
 }
 
 static void r4k_flush_icache_range(unsigned long start, unsigned long end)
@@ -619,27 +587,14 @@ static void r4k_flush_icache_page(struct vm_area_struct *vma,
 
 static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
 {
-       unsigned long end, a;
-
        /* Catch bad driver code */
        BUG_ON(size == 0);
 
        if (cpu_has_subset_pcaches) {
-               unsigned long sc_lsize = cpu_scache_line_size();
-
-               if (size >= scache_size) {
+               if (size >= scache_size)
                        r4k_blast_scache();
-                       return;
-               }
-
-               a = addr & ~(sc_lsize - 1);
-               end = (addr + size - 1) & ~(sc_lsize - 1);
-               while (1) {
-                       flush_scache_line(a);   /* Hit_Writeback_Inv_SD */
-                       if (a == end)
-                               break;
-                       a += sc_lsize;
-               }
+               else
+                       blast_scache_range(addr, addr + size);
                return;
        }
 
@@ -651,17 +606,8 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
        if (size >= dcache_size) {
                r4k_blast_dcache();
        } else {
-               unsigned long dc_lsize = cpu_dcache_line_size();
-
                R4600_HIT_CACHEOP_WAR_IMPL;
-               a = addr & ~(dc_lsize - 1);
-               end = (addr + size - 1) & ~(dc_lsize - 1);
-               while (1) {
-                       flush_dcache_line(a);   /* Hit_Writeback_Inv_D */
-                       if (a == end)
-                               break;
-                       a += dc_lsize;
-               }
+               blast_dcache_range(addr, addr + size);
        }
 
        bc_wback_inv(addr, size);
@@ -669,44 +615,22 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
 
 static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
 {
-       unsigned long end, a;
-
        /* Catch bad driver code */
        BUG_ON(size == 0);
 
        if (cpu_has_subset_pcaches) {
-               unsigned long sc_lsize = cpu_scache_line_size();
-
-               if (size >= scache_size) {
+               if (size >= scache_size)
                        r4k_blast_scache();
-                       return;
-               }
-
-               a = addr & ~(sc_lsize - 1);
-               end = (addr + size - 1) & ~(sc_lsize - 1);
-               while (1) {
-                       flush_scache_line(a);   /* Hit_Writeback_Inv_SD */
-                       if (a == end)
-                               break;
-                       a += sc_lsize;
-               }
+               else
+                       blast_scache_range(addr, addr + size);
                return;
        }
 
        if (size >= dcache_size) {
                r4k_blast_dcache();
        } else {
-               unsigned long dc_lsize = cpu_dcache_line_size();
-
                R4600_HIT_CACHEOP_WAR_IMPL;
-               a = addr & ~(dc_lsize - 1);
-               end = (addr + size - 1) & ~(dc_lsize - 1);
-               while (1) {
-                       flush_dcache_line(a);   /* Hit_Writeback_Inv_D */
-                       if (a == end)
-                               break;
-                       a += dc_lsize;
-               }
+               blast_dcache_range(addr, addr + size);
        }
 
        bc_inv(addr, size);
index 0a97a9434ebacf0f45ded71f676f280a2cf58694..7c572bea4a986b8e95d46d37262b933cd16c38c4 100644 (file)
@@ -44,8 +44,6 @@ __asm__ __volatile__( \
 /* TX39H-style cache flush routines. */
 static void tx39h_flush_icache_all(void)
 {
-       unsigned long start = KSEG0;
-       unsigned long end = (start + icache_size);
        unsigned long flags, config;
 
        /* disable icache (set ICE#) */
@@ -53,33 +51,18 @@ static void tx39h_flush_icache_all(void)
        config = read_c0_conf();
        write_c0_conf(config & ~TX39_CONF_ICE);
        TX39_STOP_STREAMING();
-
-       /* invalidate icache */
-       while (start < end) {
-               cache16_unroll32(start, Index_Invalidate_I);
-               start += 0x200;
-       }
-
+       blast_icache16();
        write_c0_conf(config);
        local_irq_restore(flags);
 }
 
 static void tx39h_dma_cache_wback_inv(unsigned long addr, unsigned long size)
 {
-       unsigned long end, a;
-       unsigned long dc_lsize = current_cpu_data.dcache.linesz;
-
        /* Catch bad driver code */
        BUG_ON(size == 0);
 
        iob();
-       a = addr & ~(dc_lsize - 1);
-       end = (addr + size - 1) & ~(dc_lsize - 1);
-       while (1) {
-               invalidate_dcache_line(a); /* Hit_Invalidate_D */
-               if (a == end) break;
-               a += dc_lsize;
-       }
+       blast_inv_dcache_range(addr, addr + size);
 }
 
 
@@ -241,42 +224,21 @@ static void tx39_flush_data_cache_page(unsigned long addr)
 
 static void tx39_flush_icache_range(unsigned long start, unsigned long end)
 {
-       unsigned long dc_lsize = current_cpu_data.dcache.linesz;
-       unsigned long addr, aend;
-
        if (end - start > dcache_size)
                tx39_blast_dcache();
-       else {
-               addr = start & ~(dc_lsize - 1);
-               aend = (end - 1) & ~(dc_lsize - 1);
-
-               while (1) {
-                       /* Hit_Writeback_Inv_D */
-                       protected_writeback_dcache_line(addr);
-                       if (addr == aend)
-                               break;
-                       addr += dc_lsize;
-               }
-       }
+       else
+               protected_blast_dcache_range(start, end);
 
        if (end - start > icache_size)
                tx39_blast_icache();
        else {
                unsigned long flags, config;
-               addr = start & ~(dc_lsize - 1);
-               aend = (end - 1) & ~(dc_lsize - 1);
                /* disable icache (set ICE#) */
                local_irq_save(flags);
                config = read_c0_conf();
                write_c0_conf(config & ~TX39_CONF_ICE);
                TX39_STOP_STREAMING();
-               while (1) {
-                       /* Hit_Invalidate_I */
-                       protected_flush_icache_line(addr);
-                       if (addr == aend)
-                               break;
-                       addr += dc_lsize;
-               }
+               protected_blast_icache_range(start, end);
                write_c0_conf(config);
                local_irq_restore(flags);
        }
@@ -311,7 +273,7 @@ static void tx39_flush_icache_page(struct vm_area_struct *vma, struct page *page
 
 static void tx39_dma_cache_wback_inv(unsigned long addr, unsigned long size)
 {
-       unsigned long end, a;
+       unsigned long end;
 
        if (((size | addr) & (PAGE_SIZE - 1)) == 0) {
                end = addr + size;
@@ -322,20 +284,13 @@ static void tx39_dma_cache_wback_inv(unsigned long addr, unsigned long size)
        } else if (size > dcache_size) {
                tx39_blast_dcache();
        } else {
-               unsigned long dc_lsize = current_cpu_data.dcache.linesz;
-               a = addr & ~(dc_lsize - 1);
-               end = (addr + size - 1) & ~(dc_lsize - 1);
-               while (1) {
-                       flush_dcache_line(a); /* Hit_Writeback_Inv_D */
-                       if (a == end) break;
-                       a += dc_lsize;
-               }
+               blast_dcache_range(addr, addr + size);
        }
 }
 
 static void tx39_dma_cache_inv(unsigned long addr, unsigned long size)
 {
-       unsigned long end, a;
+       unsigned long end;
 
        if (((size | addr) & (PAGE_SIZE - 1)) == 0) {
                end = addr + size;
@@ -346,14 +301,7 @@ static void tx39_dma_cache_inv(unsigned long addr, unsigned long size)
        } else if (size > dcache_size) {
                tx39_blast_dcache();
        } else {
-               unsigned long dc_lsize = current_cpu_data.dcache.linesz;
-               a = addr & ~(dc_lsize - 1);
-               end = (addr + size - 1) & ~(dc_lsize - 1);
-               while (1) {
-                       invalidate_dcache_line(a); /* Hit_Invalidate_D */
-                       if (a == end) break;
-                       a += dc_lsize;
-               }
+               blast_inv_dcache_range(addr, addr + size);
        }
 }
 
index 7c914a4c67c3e928b20f44a1acc6ffa90e05a95d..eca33cfa8a4c5dab12d927acf389b703a4f87528 100644 (file)
@@ -29,6 +29,11 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default y
 
+config TIME_LOW_RES
+       bool
+       depends on SMP
+       default y
+
 config GENERIC_ISA_DMA
        bool
 
index 51d2480627d1847d32926008df85f6c741ff931f..71011eadb872d54d495dbcd0e0d919ed0c0db165 100644 (file)
        ENTRY_SAME(inotify_init)
        ENTRY_SAME(inotify_add_watch)   /* 270 */
        ENTRY_SAME(inotify_rm_watch)
-       ENTRY_COMP(pselect6)
-       ENTRY_COMP(ppoll)
+       ENTRY_SAME(ni_syscall)          /* 271 ENTRY_COMP(pselect6) */
+       ENTRY_SAME(ni_syscall)          /* 272 ENTRY_COMP(ppoll) */
        ENTRY_SAME(migrate_pages)
        ENTRY_COMP(openat)              /* 275 */
        ENTRY_SAME(mkdirat)
        ENTRY_SAME(mknodat)
        ENTRY_SAME(fchownat)
        ENTRY_COMP(futimesat)
-       ENTRY_COMP(newfstatat)          /* 280 */
+       ENTRY_SAME(fstatat64)           /* 280 */
        ENTRY_SAME(unlinkat)
        ENTRY_SAME(renameat)
        ENTRY_SAME(linkat)
index df338c5cc9103c067185ebd26ebf7f36ad426dc9..80d114a3a837d0f3697fc25c7f31067c83bbfa26 100644 (file)
@@ -83,6 +83,12 @@ config GENERIC_TBSYNC
        default y if PPC32 && SMP
        default n
 
+config DEFAULT_UIMAGE
+       bool
+       help
+         Used to allow a board to specify it wants a uImage built by default
+       default n
+
 menu "Processor support"
 choice
        prompt "Processor Type"
index 44dd82b791d17075f2ff44ea1ed2eb47c1024759..5500ab55d042840db244abf496d7b66a7087f825 100644 (file)
@@ -142,6 +142,7 @@ drivers-$(CONFIG_OPROFILE)  += arch/powerpc/oprofile/
 # Default to zImage, override when needed
 defaultimage-y                 := zImage
 defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
+defaultimage-$(CONFIG_DEFAULT_UIMAGE) := uImage
 KBUILD_IMAGE := $(defaultimage-y)
 all: $(KBUILD_IMAGE)
 
@@ -167,6 +168,8 @@ endef
 
 archclean:
        $(Q)$(MAKE) $(clean)=$(boot)
+
+archmrproper:
        $(Q)rm -rf arch/$(ARCH)/include
 
 archprepare: checkbin
index c287980b7e65f3551444053609f20528e1efadb6..80e9fe2632b84a054b7151e1a4634f76be349f57 100644 (file)
@@ -12,10 +12,10 @@ endif
 
 obj-y                          := semaphore.o cputable.o ptrace.o syscalls.o \
                                   irq.o align.o signal_32.o pmc.o vdso.o \
-                                  init_task.o process.o
+                                  init_task.o process.o systbl.o
 obj-y                          += vdso32/
 obj-$(CONFIG_PPC64)            += setup_64.o binfmt_elf32.o sys_ppc32.o \
-                                  signal_64.o ptrace32.o systbl.o \
+                                  signal_64.o ptrace32.o \
                                   paca.o cpu_setup_power4.o \
                                   firmware.o sysfs.o idle_64.o
 obj-$(CONFIG_PPC64)            += vdso64/
@@ -46,7 +46,7 @@ extra-$(CONFIG_8xx)           := head_8xx.o
 extra-y                                += vmlinux.lds
 
 obj-y                          += time.o prom.o traps.o setup-common.o udbg.o
-obj-$(CONFIG_PPC32)            += entry_32.o setup_32.o misc_32.o systbl.o
+obj-$(CONFIG_PPC32)            += entry_32.o setup_32.o misc_32.o
 obj-$(CONFIG_PPC64)            += misc_64.o dma_64.o iommu.o
 obj-$(CONFIG_PPC_MULTIPLATFORM)        += prom_init.o
 obj-$(CONFIG_MODULES)          += ppc_ksyms.o
index 007b15ee36d2f435a43dff536ea799c1a4f0e10f..8a9f994ed9170ec6e0a934db1c7671771ad5019e 100644 (file)
@@ -36,8 +36,6 @@
 #ifdef CONFIG_PPC64
 #define sys_sigpending sys_ni_syscall
 #define sys_old_getrlimit sys_ni_syscall
-#else
-#define ppc_rtas       sys_ni_syscall
 #endif
 
 _GLOBAL(sys_call_table)
@@ -323,3 +321,4 @@ SYSCALL(spu_run)
 SYSCALL(spu_create)
 COMPAT_SYS(pselect6)
 COMPAT_SYS(ppoll)
+SYSCALL(unshare)
index c3427eed8345c9164fadb4895bc9ed6aad0a3268..5a936566fd6155bdf1b4ba71ba26164e7d2eef63 100644 (file)
@@ -1048,286 +1048,3 @@ _GLOBAL(name) \
        blr
 
 SYSCALL(execve)
-
-/* Why isn't this a) automatic, b) written in 'C'? */
-       .data
-       .align 4
-_GLOBAL(sys_call_table)
-       .long sys_restart_syscall /* 0 */
-       .long sys_exit
-       .long ppc_fork
-       .long sys_read
-       .long sys_write
-       .long sys_open          /* 5 */
-       .long sys_close
-       .long sys_waitpid
-       .long sys_creat
-       .long sys_link
-       .long sys_unlink        /* 10 */
-       .long sys_execve
-       .long sys_chdir
-       .long sys_time
-       .long sys_mknod
-       .long sys_chmod         /* 15 */
-       .long sys_lchown
-       .long sys_ni_syscall                    /* old break syscall holder */
-       .long sys_stat
-       .long sys_lseek
-       .long sys_getpid        /* 20 */
-       .long sys_mount
-       .long sys_oldumount
-       .long sys_setuid
-       .long sys_getuid
-       .long sys_stime         /* 25 */
-       .long sys_ptrace
-       .long sys_alarm
-       .long sys_fstat
-       .long sys_pause
-       .long sys_utime         /* 30 */
-       .long sys_ni_syscall                    /* old stty syscall holder */
-       .long sys_ni_syscall                    /* old gtty syscall holder */
-       .long sys_access
-       .long sys_nice
-       .long sys_ni_syscall    /* 35 */        /* old ftime syscall holder */
-       .long sys_sync
-       .long sys_kill
-       .long sys_rename
-       .long sys_mkdir
-       .long sys_rmdir         /* 40 */
-       .long sys_dup
-       .long sys_pipe
-       .long sys_times
-       .long sys_ni_syscall                    /* old prof syscall holder */
-       .long sys_brk           /* 45 */
-       .long sys_setgid
-       .long sys_getgid
-       .long sys_signal
-       .long sys_geteuid
-       .long sys_getegid       /* 50 */
-       .long sys_acct
-       .long sys_umount                        /* recycled never used phys() */
-       .long sys_ni_syscall                    /* old lock syscall holder */
-       .long sys_ioctl
-       .long sys_fcntl         /* 55 */
-       .long sys_ni_syscall                    /* old mpx syscall holder */
-       .long sys_setpgid
-       .long sys_ni_syscall                    /* old ulimit syscall holder */
-       .long sys_olduname
-       .long sys_umask         /* 60 */
-       .long sys_chroot
-       .long sys_ustat
-       .long sys_dup2
-       .long sys_getppid
-       .long sys_getpgrp       /* 65 */
-       .long sys_setsid
-       .long sys_sigaction
-       .long sys_sgetmask
-       .long sys_ssetmask
-       .long sys_setreuid      /* 70 */
-       .long sys_setregid
-       .long sys_sigsuspend
-       .long sys_sigpending
-       .long sys_sethostname
-       .long sys_setrlimit     /* 75 */
-       .long sys_old_getrlimit
-       .long sys_getrusage
-       .long sys_gettimeofday
-       .long sys_settimeofday
-       .long sys_getgroups     /* 80 */
-       .long sys_setgroups
-       .long ppc_select
-       .long sys_symlink
-       .long sys_lstat
-       .long sys_readlink      /* 85 */
-       .long sys_uselib
-       .long sys_swapon
-       .long sys_reboot
-       .long old_readdir
-       .long sys_mmap          /* 90 */
-       .long sys_munmap
-       .long sys_truncate
-       .long sys_ftruncate
-       .long sys_fchmod
-       .long sys_fchown        /* 95 */
-       .long sys_getpriority
-       .long sys_setpriority
-       .long sys_ni_syscall                    /* old profil syscall holder */
-       .long sys_statfs
-       .long sys_fstatfs       /* 100 */
-       .long sys_ni_syscall
-       .long sys_socketcall
-       .long sys_syslog
-       .long sys_setitimer
-       .long sys_getitimer     /* 105 */
-       .long sys_newstat
-       .long sys_newlstat
-       .long sys_newfstat
-       .long sys_uname
-       .long sys_ni_syscall    /* 110 */
-       .long sys_vhangup
-       .long sys_ni_syscall    /* old 'idle' syscall */
-       .long sys_ni_syscall
-       .long sys_wait4
-       .long sys_swapoff       /* 115 */
-       .long sys_sysinfo
-       .long sys_ipc
-       .long sys_fsync
-       .long sys_sigreturn
-       .long ppc_clone         /* 120 */
-       .long sys_setdomainname
-       .long sys_newuname
-       .long sys_ni_syscall
-       .long sys_adjtimex
-       .long sys_mprotect      /* 125 */
-       .long sys_sigprocmask
-       .long sys_ni_syscall    /* old sys_create_module */
-       .long sys_init_module
-       .long sys_delete_module
-       .long sys_ni_syscall    /* old sys_get_kernel_syms */   /* 130 */
-       .long sys_quotactl
-       .long sys_getpgid
-       .long sys_fchdir
-       .long sys_bdflush
-       .long sys_sysfs         /* 135 */
-       .long sys_personality
-       .long sys_ni_syscall    /* for afs_syscall */
-       .long sys_setfsuid
-       .long sys_setfsgid
-       .long sys_llseek        /* 140 */
-       .long sys_getdents
-       .long ppc_select
-       .long sys_flock
-       .long sys_msync
-       .long sys_readv         /* 145 */
-       .long sys_writev
-       .long sys_getsid
-       .long sys_fdatasync
-       .long sys_sysctl
-       .long sys_mlock         /* 150 */
-       .long sys_munlock
-       .long sys_mlockall
-       .long sys_munlockall
-       .long sys_sched_setparam
-       .long sys_sched_getparam        /* 155 */
-       .long sys_sched_setscheduler
-       .long sys_sched_getscheduler
-       .long sys_sched_yield
-       .long sys_sched_get_priority_max
-       .long sys_sched_get_priority_min  /* 160 */
-       .long sys_sched_rr_get_interval
-       .long sys_nanosleep
-       .long sys_mremap
-       .long sys_setresuid
-       .long sys_getresuid     /* 165 */
-       .long sys_ni_syscall            /* old sys_query_module */
-       .long sys_poll
-       .long sys_nfsservctl
-       .long sys_setresgid
-       .long sys_getresgid     /* 170 */
-       .long sys_prctl
-       .long sys_rt_sigreturn
-       .long sys_rt_sigaction
-       .long sys_rt_sigprocmask
-       .long sys_rt_sigpending /* 175 */
-       .long sys_rt_sigtimedwait
-       .long sys_rt_sigqueueinfo
-       .long sys_rt_sigsuspend
-       .long sys_pread64
-       .long sys_pwrite64      /* 180 */
-       .long sys_chown
-       .long sys_getcwd
-       .long sys_capget
-       .long sys_capset
-       .long sys_sigaltstack   /* 185 */
-       .long sys_sendfile
-       .long sys_ni_syscall            /* streams1 */
-       .long sys_ni_syscall            /* streams2 */
-       .long ppc_vfork
-       .long sys_getrlimit     /* 190 */
-       .long sys_readahead
-       .long sys_mmap2
-       .long sys_truncate64
-       .long sys_ftruncate64
-       .long sys_stat64        /* 195 */
-       .long sys_lstat64
-       .long sys_fstat64
-       .long sys_pciconfig_read
-       .long sys_pciconfig_write
-       .long sys_pciconfig_iobase      /* 200 */
-       .long sys_ni_syscall            /* 201 - reserved - MacOnLinux - new */
-       .long sys_getdents64
-       .long sys_pivot_root
-       .long sys_fcntl64
-       .long sys_madvise       /* 205 */
-       .long sys_mincore
-       .long sys_gettid
-       .long sys_tkill
-       .long sys_setxattr
-       .long sys_lsetxattr     /* 210 */
-       .long sys_fsetxattr
-       .long sys_getxattr
-       .long sys_lgetxattr
-       .long sys_fgetxattr
-       .long sys_listxattr     /* 215 */
-       .long sys_llistxattr
-       .long sys_flistxattr
-       .long sys_removexattr
-       .long sys_lremovexattr
-       .long sys_fremovexattr  /* 220 */
-       .long sys_futex
-       .long sys_sched_setaffinity
-       .long sys_sched_getaffinity
-       .long sys_ni_syscall
-       .long sys_ni_syscall    /* 225 - reserved for Tux */
-       .long sys_sendfile64
-       .long sys_io_setup
-       .long sys_io_destroy
-       .long sys_io_getevents
-       .long sys_io_submit     /* 230 */
-       .long sys_io_cancel
-       .long sys_set_tid_address
-       .long sys_fadvise64
-       .long sys_exit_group
-       .long sys_lookup_dcookie /* 235 */
-       .long sys_epoll_create
-       .long sys_epoll_ctl
-       .long sys_epoll_wait
-       .long sys_remap_file_pages
-       .long sys_timer_create  /* 240 */
-       .long sys_timer_settime
-       .long sys_timer_gettime
-       .long sys_timer_getoverrun
-       .long sys_timer_delete
-       .long sys_clock_settime /* 245 */
-       .long sys_clock_gettime
-       .long sys_clock_getres
-       .long sys_clock_nanosleep
-       .long sys_swapcontext
-       .long sys_tgkill        /* 250 */
-       .long sys_utimes
-       .long sys_statfs64
-       .long sys_fstatfs64
-       .long ppc_fadvise64_64
-       .long sys_ni_syscall            /* 255 - rtas (used on ppc64) */
-       .long sys_debug_setcontext
-       .long sys_ni_syscall            /* 257 reserved for vserver */
-       .long sys_ni_syscall            /* 258 reserved for new sys_remap_file_pages */
-       .long sys_ni_syscall            /* 259 reserved for new sys_mbind */
-       .long sys_ni_syscall            /* 260 reserved for new sys_get_mempolicy */
-       .long sys_ni_syscall            /* 261 reserved for new sys_set_mempolicy */
-       .long sys_mq_open
-       .long sys_mq_unlink
-       .long sys_mq_timedsend
-       .long sys_mq_timedreceive       /* 265 */
-       .long sys_mq_notify
-       .long sys_mq_getsetattr
-       .long sys_kexec_load
-       .long sys_add_key
-       .long sys_request_key           /* 270 */
-       .long sys_keyctl
-       .long sys_waitid
-       .long sys_ioprio_set
-       .long sys_ioprio_get
-       .long sys_inotify_init          /* 275 */
-       .long sys_inotify_add_watch
-       .long sys_inotify_rm_watch
index 3525c91204d4f87d19af240ddfbc26b58ee1d660..f8d0cd540a06bb734f37272ef3a883e0f34ecb4f 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.16-rc1
-# Thu Jan 19 10:58:53 2006
+# Linux kernel version: 2.6.16-rc2
+# Wed Feb  8 10:44:39 2006
 #
 CONFIG_MMU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -12,7 +12,6 @@ CONFIG_S390=y
 # Code maturity level options
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 
@@ -154,6 +153,7 @@ CONFIG_NET=y
 #
 # Networking options
 #
+# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -607,6 +607,7 @@ CONFIG_MSDOS_PARTITION=y
 # Instrumentation Support
 #
 # CONFIG_PROFILING is not set
+# CONFIG_STATISTICS is not set
 
 #
 # Kernel hacking
@@ -624,7 +625,7 @@ CONFIG_DEBUG_MUTEXES=y
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_KOBJECT is not set
 # CONFIG_DEBUG_INFO is not set
-# CONFIG_DEBUG_FS is not set
+CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_VM is not set
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
index cc20f0e3a7d300f26cc1607a0a6b92c39d576fe1..2d021626c1a64f9ab55779b2cc004ab092508d78 100644 (file)
@@ -905,6 +905,26 @@ asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * sta
        return ret;
 }
 
+asmlinkage long sys32_fstatat(unsigned int dfd, char __user *filename,
+                             struct stat64_emu31 __user* statbuf, int flag)
+{
+       struct kstat stat;
+       int error = -EINVAL;
+
+       if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
+               goto out;
+
+       if (flag & AT_SYMLINK_NOFOLLOW)
+               error = vfs_lstat_fd(dfd, filename, &stat);
+       else
+               error = vfs_stat_fd(dfd, filename, &stat);
+
+       if (!error)
+               error = cp_stat64(statbuf, &stat);
+out:
+       return error;
+}
+
 /*
  * Linux/i386 didn't use to be able to handle more than
  * 4 system call parameters, so these system calls used a memory
index ef706694a0c1d3897ab28330576901214d8d3a62..5291b5f8788db723d8464483d1fafaccd9d3ac7c 100644 (file)
@@ -195,9 +195,6 @@ sys32_sigaction(int sig, const struct old_sigaction32 __user *act,
        return ret;
 }
 
-int
-do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact);
-
 asmlinkage long
 sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
           struct sigaction32 __user *oact,  size_t sigsetsize)
index 83b33fe1923c0bbd53da91beadf66bdff8e964c4..dd2d6c3e8df86c2813580a9ccbf250bb78313246 100644 (file)
@@ -1523,13 +1523,13 @@ compat_sys_futimesat_wrapper:
        llgtr   %r4,%r4                 # struct timeval *
        jg      compat_sys_futimesat
 
-       .globl compat_sys_newfstatat_wrapper
-compat_sys_newfstatat_wrapper:
+       .globl sys32_fstatat_wrapper
+sys32_fstatat_wrapper:
        llgfr   %r2,%r2                 # unsigned int
        llgtr   %r3,%r3                 # char *
-       llgtr   %r4,%r4                 # struct stat *
+       llgtr   %r4,%r4                 # struct stat64 *
        lgfr    %r5,%r5                 # int
-       jg      compat_sys_newfstatat
+       jg      sys32_fstatat
 
        .globl sys_unlinkat_wrapper
 sys_unlinkat_wrapper:
@@ -1602,3 +1602,8 @@ compat_sys_ppoll_wrapper:
        llgtr   %r5,%r5                 # const sigset_t *
        llgfr   %r6,%r6                 # size_t
        jg      compat_sys_ppoll
+
+       .globl sys_unshare_wrapper
+sys_unshare_wrapper:
+       llgfr   %r2,%r2                 # unsigned long
+       jg      sys_unshare
index f0ed5c642c74cb6480426b106d1cc3e0aa05eed1..bad81b5832db51c0c84aabcd84a3c53409c1704e 100644 (file)
  * on the S390 architecture.
  */
 
-#include <asm/cio.h>
-#include <asm/setup.h>
 #include <linux/device.h>
 #include <linux/mm.h>
 #include <linux/kexec.h>
 #include <linux/delay.h>
+#include <asm/cio.h>
+#include <asm/setup.h>
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/system.h>
+#include <asm/smp.h>
 
 static void kexec_halt_all_cpus(void *);
 
index cbfcfd02a43a503447380c55f5ab852d248e545b..0d1ad5dbe2b16ac035f8c4c3feb53593e09c041d 100644 (file)
@@ -52,7 +52,7 @@ extern volatile int __cpu_logical_map[];
 struct _lowcore *lowcore_ptr[NR_CPUS];
 
 cpumask_t cpu_online_map;
-cpumask_t cpu_possible_map;
+cpumask_t cpu_possible_map = CPU_MASK_ALL;
 
 static struct task_struct *current_set[NR_CPUS];
 
@@ -514,9 +514,6 @@ __init smp_check_cpus(unsigned int max_cpus)
                num_cpus++;
        }
 
-       for (cpu = 1; cpu < max_cpus; cpu++)
-               cpu_set(cpu, cpu_possible_map);
-
        printk("Detected %d CPU's\n",(int) num_cpus);
        printk("Boot cpu address %2X\n", boot_cpu_addr);
 }
@@ -810,7 +807,6 @@ void __devinit smp_prepare_boot_cpu(void)
 
        cpu_set(0, cpu_online_map);
        cpu_set(0, cpu_present_map);
-       cpu_set(0, cpu_possible_map);
        S390_lowcore.percpu_offset = __per_cpu_offset[0];
        current_set[0] = current;
 }
index 3280345efacd7c6e4c2cdd45c9f7e9b059748a13..84921fe8d2662dd01eb988a200a38bcaaa0935a1 100644 (file)
@@ -301,7 +301,7 @@ SYSCALL(sys_mkdirat,sys_mkdirat,sys_mkdirat_wrapper)
 SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper)   /* 290 */
 SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper)
 SYSCALL(sys_futimesat,sys_futimesat,compat_sys_futimesat_wrapper)
-SYSCALL(sys_newfstatat,sys_newfstatat,compat_sys_newfstatat_wrapper)
+SYSCALL(sys_fstatat64,sys_newfstatat,sys32_fstatat_wrapper)
 SYSCALL(sys_unlinkat,sys_unlinkat,sys_unlinkat_wrapper)
 SYSCALL(sys_renameat,sys_renameat,sys_renameat_wrapper)        /* 295 */
 SYSCALL(sys_linkat,sys_linkat,sys_linkat_wrapper)
@@ -311,3 +311,4 @@ SYSCALL(sys_fchmodat,sys_fchmodat,sys_fchmodat_wrapper)
 SYSCALL(sys_faccessat,sys_faccessat,sys_faccessat_wrapper)     /* 300 */
 SYSCALL(sys_pselect6,sys_pselect6,compat_sys_pselect6_wrapper)
 SYSCALL(sys_ppoll,sys_ppoll,compat_sys_ppoll_wrapper)
+SYSCALL(sys_unshare,sys_unshare,sys_unshare_wrapper)
index e96c35bddac778030a7de4c184e4d781248a0fe4..71f0a2fb30786674b601391b3d4ffca1d604256b 100644 (file)
@@ -30,7 +30,7 @@ void __delay(unsigned long loops)
          */
         __asm__ __volatile__(
                 "0: brct %0,0b"
-                : /* no outputs */ : "r" (loops/2) );
+                : /* no outputs */ : "r" ((loops/2) + 1));
 }
 
 /*
index c0314705d73a15654639abfb6d33c627dbc55e55..768de64b371fd0be3a7065ce26d4fbb550d78ea6 100644 (file)
@@ -76,7 +76,7 @@ sys_call_table:
 /*270*/        .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
 /*275*/        .long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
 /*280*/        .long sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl, sys_openat
-/*285*/        .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_newfstatat
+/*285*/        .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
 /*290*/        .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
 /*295*/        .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
 
index 9264ccbaaafad7ec436f3a8b68221731dac0c143..417727bd87bab0ef5604b554189cac6c8e3d3434 100644 (file)
@@ -428,6 +428,27 @@ asmlinkage long compat_sys_fstat64(unsigned int fd,
        return error;
 }
 
+asmlinkage long compat_sys_fstatat64(unsigned int dfd, char __user *filename,
+               struct compat_stat64 __user * statbuf, int flag)
+{
+       struct kstat stat;
+       int error = -EINVAL;
+
+       if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
+               goto out;
+
+       if (flag & AT_SYMLINK_NOFOLLOW)
+               error = vfs_lstat_fd(dfd, filename, &stat);
+       else
+               error = vfs_stat_fd(dfd, filename, &stat);
+
+       if (!error)
+               error = cp_compat_stat64(&stat, statbuf);
+
+out:
+       return error;
+}
+
 asmlinkage long compat_sys_sysfs(int option, u32 arg1, u32 arg2)
 {
        return sys_sysfs(option, arg1, arg2);
index 5928b3c33e2721d659c0e4b9c9b90a55eaf4101b..c3adb7ac167d1b84c8bfd13cb412a98804d90951 100644 (file)
@@ -77,7 +77,7 @@ sys_call_table32:
 /*270*/        .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink
        .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid
 /*280*/        .word sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl, compat_sys_openat
-       .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_newfstatat
+       .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64
 /*285*/        .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
        .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare
 
@@ -146,7 +146,7 @@ sys_call_table:
 /*270*/        .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
        .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
 /*280*/        .word sys_nis_syscall, sys_add_key, sys_request_key, sys_keyctl, sys_openat
-       .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, compat_sys_newfstatat
+       .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
 /*285*/        .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
        .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
 
index 04494638b96387203fefc91aebab3be1045bf681..e7fc3e500342edc9384b458e8b7d89e156a194d1 100644 (file)
@@ -28,6 +28,10 @@ config GENERIC_IRQ_PROBE
        bool
        default y
 
+config TIME_LOW_RES
+       bool
+       default y
+
 # Turn off some random 386 crap that can affect device config
 config ISA
        bool
index ada4535d0161d785d1d3b5121630cb9189dc0afc..00dee176c08ef6cab15397fda3f0ebcf8819c549 100644 (file)
@@ -677,7 +677,7 @@ ia32_sys_call_table:
        .quad sys_mknodat
        .quad sys_fchownat
        .quad compat_sys_futimesat
-       .quad compat_sys_newfstatat     /* 300 */
+       .quad sys32_fstatat             /* 300 */
        .quad sys_unlinkat
        .quad sys_renameat
        .quad sys_linkat
index 54481af5344ab2c19be4427fa1c576bd17b2a5e7..2bc55af9541922aa1163790cb27c6cb8df84d6dc 100644 (file)
@@ -180,6 +180,28 @@ sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf)
        return ret;
 }
 
+asmlinkage long
+sys32_fstatat(unsigned int dfd, char __user *filename,
+             struct stat64 __user* statbuf, int flag)
+{
+       struct kstat stat;
+       int error = -EINVAL;
+
+       if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
+               goto out;
+
+       if (flag & AT_SYMLINK_NOFOLLOW)
+               error = vfs_lstat_fd(dfd, filename, &stat);
+       else
+               error = vfs_stat_fd(dfd, filename, &stat);
+
+       if (!error)
+               error = cp_stat64(statbuf, &stat);
+
+out:
+       return error;
+}
+
 /*
  * Linux/i386 didn't use to be able to handle more than
  * 4 system call parameters, so these system calls used a memory
index 6147770b43471be8b5fd721cde035af84aaf0184..7a0a3e8d5d7265ed23e1f0cf0ae1f108b64645e8 100644 (file)
@@ -708,7 +708,7 @@ static void setup_APIC_timer(unsigned int clocks)
        local_irq_save(flags);
 
        /* wait for irq slice */
-       if (vxtime.hpet_address) {
+       if (vxtime.hpet_address && hpet_use_timer) {
                int trigger = hpet_readl(HPET_T0_CMP);
                while (hpet_readl(HPET_COUNTER) >= trigger)
                        /* do nothing */ ;
index 2fe23a6c361bbfa77524472027e47680b2bf05b4..dd0718dc178b1a8fa31ccdf150cc7145c3e14b01 100644 (file)
@@ -310,7 +310,7 @@ void gart_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, int di
 
        for (i = 0; i < nents; i++) {
                struct scatterlist *s = &sg[i];
-               if (!s->dma_length || !s->length)
+               if (!s->dma_length)
                        break;
                dma_unmap_single(dev, s->dma_address, s->dma_length, dir);
        }
@@ -364,7 +364,6 @@ static int __dma_map_cont(struct scatterlist *sg, int start, int stopat,
                
                BUG_ON(i > start && s->offset);
                if (i == start) {
-                       *sout = *s; 
                        sout->dma_address = iommu_bus_base;
                        sout->dma_address += iommu_page*PAGE_SIZE + s->offset;
                        sout->dma_length = s->length;
@@ -379,7 +378,7 @@ static int __dma_map_cont(struct scatterlist *sg, int start, int stopat,
                        SET_LEAK(iommu_page);
                        addr += PAGE_SIZE;
                        iommu_page++;
-       } 
+               }
        } 
        BUG_ON(iommu_page - iommu_start != pages);      
        return 0;
@@ -391,7 +390,6 @@ static inline int dma_map_cont(struct scatterlist *sg, int start, int stopat,
 {
        if (!need) { 
                BUG_ON(stopat - start != 1);
-               *sout = sg[start]; 
                sout->dma_length = sg[start].length; 
                return 0;
        } 
index dba7237be5c1c2b2b2e8ae28a5ca5a5ecf34aa65..3c58c30506a104c00d505b234b6261947fc4c8a3 100644 (file)
@@ -59,7 +59,7 @@ static int notsc __initdata = 0;
 unsigned int cpu_khz;                                  /* TSC clocks / usec, not used here */
 static unsigned long hpet_period;                      /* fsecs / HPET clock */
 unsigned long hpet_tick;                               /* HPET clocks / interrupt */
-static int hpet_use_timer;                             /* Use counter of hpet for time keeping, otherwise PIT */
+int hpet_use_timer;                            /* Use counter of hpet for time keeping, otherwise PIT */
 unsigned long vxtime_hz = PIT_TICK_RATE;
 int report_lost_ticks;                         /* command line option */
 unsigned long long monotonic_base;
@@ -326,7 +326,10 @@ static noinline void handle_lost_ticks(int lost, struct pt_regs *regs)
            print_symbol("rip %s\n", regs->rip);
            if (vxtime.mode == VXTIME_TSC && vxtime.hpet_address) {
                    printk(KERN_WARNING "Falling back to HPET\n");
-                   vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
+                   if (hpet_use_timer)
+                       vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
+                   else
+                       vxtime.last = hpet_readl(HPET_COUNTER);
                    vxtime.mode = VXTIME_HPET;
                    do_gettimeoffset = do_gettimeoffset_hpet;
            }
@@ -988,7 +991,10 @@ void __init time_init_gtod(void)
                notsc = 1;
        if (vxtime.hpet_address && notsc) {
                timetype = hpet_use_timer ? "HPET" : "PIT/HPET";
-               vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
+               if (hpet_use_timer)
+                       vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
+               else
+                       vxtime.last = hpet_readl(HPET_COUNTER);
                vxtime.mode = VXTIME_HPET;
                do_gettimeoffset = do_gettimeoffset_hpet;
 #ifdef CONFIG_X86_PM_TIMER
index ee1b2da9e5e7d168de7de4053eaaed737dd4c3e9..28d50dc540e89c2633770e4087bcef476c101e09 100644 (file)
@@ -90,6 +90,20 @@ static inline void conditional_sti(struct pt_regs *regs)
                local_irq_enable();
 }
 
+static inline void preempt_conditional_sti(struct pt_regs *regs)
+{
+       preempt_disable();
+       if (regs->eflags & X86_EFLAGS_IF)
+               local_irq_enable();
+}
+
+static inline void preempt_conditional_cli(struct pt_regs *regs)
+{
+       if (regs->eflags & X86_EFLAGS_IF)
+               local_irq_disable();
+       preempt_enable_no_resched();
+}
+
 static int kstack_depth_to_print = 10;
 
 #ifdef CONFIG_KALLSYMS
@@ -693,7 +707,7 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs,
                                                SIGTRAP) == NOTIFY_STOP)
                return;
 
-       conditional_sti(regs);
+       preempt_conditional_sti(regs);
 
        /* Mask out spurious debug traps due to lazy DR7 setting */
        if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) {
@@ -738,11 +752,13 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs,
 
 clear_dr7:
        set_debugreg(0UL, 7);
+       preempt_conditional_cli(regs);
        return;
 
 clear_TF_reenable:
        set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
        regs->eflags &= ~TF_MASK;
+       preempt_conditional_cli(regs);
 }
 
 static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr)
index 6ef9f9a762356c955fe3927fbed882b663e0dd2e..22e51beee8d377cc4adcb5173414f7ce2bddadc4 100644 (file)
@@ -351,7 +351,7 @@ void __init init_cpu_to_node(void)
                        continue;
                if (apicid_to_node[apicid] == NUMA_NO_NODE)
                        continue;
-               cpu_to_node[i] = apicid_to_node[apicid];
+               numa_set_node(i,apicid_to_node[apicid]);
        }
 }
 
index 4e7dbcc425ff69d7f1f3c851e47d7ed5c60351b6..93e44d0292ab7aa56c04c4552ef2607bb6add19b 100644 (file)
@@ -645,7 +645,7 @@ static void pkt_copy_bio_data(struct bio *src_bio, int seg, int offs, struct pag
  * b) The data can be used as cache to avoid read requests if we receive a
  *    new write request for the same zone.
  */
-static void pkt_make_local_copy(struct packet_data *pkt, struct page **pages, int *offsets)
+static void pkt_make_local_copy(struct packet_data *pkt, struct bio_vec *bvec)
 {
        int f, p, offs;
 
@@ -653,15 +653,15 @@ static void pkt_make_local_copy(struct packet_data *pkt, struct page **pages, in
        p = 0;
        offs = 0;
        for (f = 0; f < pkt->frames; f++) {
-               if (pages[f] != pkt->pages[p]) {
-                       void *vfrom = kmap_atomic(pages[f], KM_USER0) + offsets[f];
+               if (bvec[f].bv_page != pkt->pages[p]) {
+                       void *vfrom = kmap_atomic(bvec[f].bv_page, KM_USER0) + bvec[f].bv_offset;
                        void *vto = page_address(pkt->pages[p]) + offs;
                        memcpy(vto, vfrom, CD_FRAMESIZE);
                        kunmap_atomic(vfrom, KM_USER0);
-                       pages[f] = pkt->pages[p];
-                       offsets[f] = offs;
+                       bvec[f].bv_page = pkt->pages[p];
+                       bvec[f].bv_offset = offs;
                } else {
-                       BUG_ON(offsets[f] != offs);
+                       BUG_ON(bvec[f].bv_offset != offs);
                }
                offs += CD_FRAMESIZE;
                if (offs >= PAGE_SIZE) {
@@ -991,18 +991,17 @@ try_next_bio:
 static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt)
 {
        struct bio *bio;
-       struct page *pages[PACKET_MAX_SIZE];
-       int offsets[PACKET_MAX_SIZE];
        int f;
        int frames_write;
+       struct bio_vec *bvec = pkt->w_bio->bi_io_vec;
 
        for (f = 0; f < pkt->frames; f++) {
-               pages[f] = pkt->pages[(f * CD_FRAMESIZE) / PAGE_SIZE];
-               offsets[f] = (f * CD_FRAMESIZE) % PAGE_SIZE;
+               bvec[f].bv_page = pkt->pages[(f * CD_FRAMESIZE) / PAGE_SIZE];
+               bvec[f].bv_offset = (f * CD_FRAMESIZE) % PAGE_SIZE;
        }
 
        /*
-        * Fill-in pages[] and offsets[] with data from orig_bios.
+        * Fill-in bvec with data from orig_bios.
         */
        frames_write = 0;
        spin_lock(&pkt->lock);
@@ -1024,11 +1023,11 @@ static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt)
                        }
 
                        if (src_bvl->bv_len - src_offs >= CD_FRAMESIZE) {
-                               pages[f] = src_bvl->bv_page;
-                               offsets[f] = src_bvl->bv_offset + src_offs;
+                               bvec[f].bv_page = src_bvl->bv_page;
+                               bvec[f].bv_offset = src_bvl->bv_offset + src_offs;
                        } else {
                                pkt_copy_bio_data(bio, segment, src_offs,
-                                                 pages[f], offsets[f]);
+                                                 bvec[f].bv_page, bvec[f].bv_offset);
                        }
                        src_offs += CD_FRAMESIZE;
                        frames_write++;
@@ -1042,7 +1041,7 @@ static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt)
        BUG_ON(frames_write != pkt->write_size);
 
        if (test_bit(PACKET_MERGE_SEGS, &pd->flags) || (pkt->write_size < pkt->frames)) {
-               pkt_make_local_copy(pkt, pages, offsets);
+               pkt_make_local_copy(pkt, bvec);
                pkt->cache_valid = 1;
        } else {
                pkt->cache_valid = 0;
@@ -1055,17 +1054,9 @@ static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt)
        pkt->w_bio->bi_bdev = pd->bdev;
        pkt->w_bio->bi_end_io = pkt_end_io_packet_write;
        pkt->w_bio->bi_private = pkt;
-       for (f = 0; f < pkt->frames; f++) {
-               if ((f + 1 < pkt->frames) && (pages[f + 1] == pages[f]) &&
-                   (offsets[f + 1] = offsets[f] + CD_FRAMESIZE)) {
-                       if (!bio_add_page(pkt->w_bio, pages[f], CD_FRAMESIZE * 2, offsets[f]))
-                               BUG();
-                       f++;
-               } else {
-                       if (!bio_add_page(pkt->w_bio, pages[f], CD_FRAMESIZE, offsets[f]))
-                               BUG();
-               }
-       }
+       for (f = 0; f < pkt->frames; f++)
+               if (!bio_add_page(pkt->w_bio, bvec[f].bv_page, CD_FRAMESIZE, bvec[f].bv_offset))
+                       BUG();
        VPRINTK("pktcdvd: vcnt=%d\n", pkt->w_bio->bi_vcnt);
 
        atomic_set(&pkt->io_wait, 1);
@@ -1548,7 +1539,7 @@ static int pkt_good_disc(struct pktcdvd_device *pd, disc_information *di)
                case 0x12: /* DVD-RAM */
                        return 0;
                default:
-                       printk("pktcdvd: Wrong disc profile (%x)\n", pd->mmc3_profile);
+                       VPRINTK("pktcdvd: Wrong disc profile (%x)\n", pd->mmc3_profile);
                        return 1;
        }
 
@@ -1894,8 +1885,8 @@ static int pkt_open_write(struct pktcdvd_device *pd)
        unsigned int write_speed, media_write_speed, read_speed;
 
        if ((ret = pkt_probe_settings(pd))) {
-               DPRINTK("pktcdvd: %s failed probe\n", pd->name);
-               return -EIO;
+               VPRINTK("pktcdvd: %s failed probe\n", pd->name);
+               return -EROFS;
        }
 
        if ((ret = pkt_set_write_settings(pd))) {
@@ -2053,10 +2044,9 @@ static int pkt_open(struct inode *inode, struct file *file)
                        goto out_dec;
                }
        } else {
-               if (pkt_open_dev(pd, file->f_mode & FMODE_WRITE)) {
-                       ret = -EIO;
+               ret = pkt_open_dev(pd, file->f_mode & FMODE_WRITE);
+               if (ret)
                        goto out_dec;
-               }
                /*
                 * needed here as well, since ext2 (among others) may change
                 * the blocksize at mount time
@@ -2436,11 +2426,12 @@ static int pkt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
                 * The door gets locked when the device is opened, so we
                 * have to unlock it or else the eject command fails.
                 */
-               pkt_lock_door(pd, 0);
+               if (pd->refcnt == 1)
+                       pkt_lock_door(pd, 0);
                return blkdev_ioctl(pd->bdev->bd_inode, file, cmd, arg);
 
        default:
-               printk("pktcdvd: Unknown ioctl for %s (%x)\n", pd->name, cmd);
+               VPRINTK("pktcdvd: Unknown ioctl for %s (%x)\n", pd->name, cmd);
                return -ENOTTY;
        }
 
index e522d19ad886854206e17600632a4ad2e1616780..7e21b1ff27c4213fb78de899fc03f11fe7fe0e58 100644 (file)
@@ -474,18 +474,6 @@ static int bt3c_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long
 /* ======================== Card services HCI interaction ======================== */
 
 
-static struct device *bt3c_device(void)
-{
-       static struct device dev = {
-               .bus_id = "pcmcia",
-       };
-       kobject_set_name(&dev.kobj, "bt3c");
-       kobject_init(&dev.kobj);
-
-       return &dev;
-}
-
-
 static int bt3c_load_firmware(bt3c_info_t *info, unsigned char *firmware, int count)
 {
        char *ptr = (char *) firmware;
@@ -574,6 +562,7 @@ static int bt3c_open(bt3c_info_t *info)
 {
        const struct firmware *firmware;
        struct hci_dev *hdev;
+       client_handle_t handle;
        int err;
 
        spin_lock_init(&(info->lock));
@@ -605,8 +594,10 @@ static int bt3c_open(bt3c_info_t *info)
 
        hdev->owner = THIS_MODULE;
 
+       handle = info->link.handle;
+
        /* Load firmware */
-       err = request_firmware(&firmware, "BT3CPCC.bin", bt3c_device());
+       err = request_firmware(&firmware, "BT3CPCC.bin", &handle_to_dev(handle));
        if (err < 0) {
                BT_ERR("Firmware request failed");
                goto error;
index 8fd6357a48da1ae648874cedcb1973d8110afe6d..2c17e88a88476cdbb5a305806f6f15d2a80755f2 100644 (file)
@@ -85,7 +85,6 @@
        {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \
        {0x1002, 0x596A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
        {0x1002, 0x596B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
-       {0x1002, 0x5b60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \
        {0x1002, 0x5c61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|CHIP_IS_MOBILITY}, \
        {0x1002, 0x5c62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
        {0x1002, 0x5c63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280|CHIP_IS_MOBILITY}, \
index 57539d8f9f7c861770c21843fbe38b1b7097151f..09dc4b01232c018e95733b303a86ee8c2f9ed1ba 100644 (file)
@@ -150,17 +150,6 @@ static void rs_wait_until_sent(struct tty_struct *, int);
 /* Standard COM flags (except for COM4, because of the 8514 problem) */
 #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
 
-/*
- * tmp_buf is used as a temporary buffer by serial_write.  We need to
- * lock it in case the memcpy_fromfs blocks while swapping in a page,
- * and some other program tries to do a serial write at the same time.
- * Since the lock will only come under contention when the system is
- * swapping and available memory is low, it makes sense to share one
- * buffer across all the serial ports, since it significantly saves
- * memory if large numbers of serial ports are open.
- */
-static unsigned char *tmp_buf;
-
 static inline int serial_paranoia_check(struct esp_struct *info,
                                        char *name, const char *routine)
 {
@@ -1267,7 +1256,7 @@ static int rs_write(struct tty_struct * tty,
        if (serial_paranoia_check(info, tty->name, "rs_write"))
                return 0;
 
-       if (!tty || !info->xmit_buf || !tmp_buf)
+       if (!tty || !info->xmit_buf)
                return 0;
            
        while (1) {
@@ -2291,11 +2280,7 @@ static int esp_open(struct tty_struct *tty, struct file * filp)
        tty->driver_data = info;
        info->tty = tty;
 
-       if (!tmp_buf) {
-               tmp_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL);
-               if (!tmp_buf)
-                       return -ENOMEM;
-       }
+       spin_unlock_irqrestore(&info->lock, flags);
        
        /*
         * Start up serial port
@@ -2602,9 +2587,6 @@ static void __exit espserial_exit(void)
                free_pages((unsigned long)dma_buffer,
                        get_order(DMA_BUFFER_SZ));
 
-       if (tmp_buf)
-               free_page((unsigned long)tmp_buf);
-
        while (free_pio_buf) {
                pio_buf = free_pio_buf->next;
                kfree(free_pio_buf);
index 66a2fee06eb9151607ac97fb617962f8563b0e8c..ef140ebde117339ab7c99120df2837f9499aadf7 100644 (file)
@@ -956,22 +956,18 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
                }
        } else if (res->type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) {
                struct acpi_resource_extended_irq *irqp;
-               int i;
+               int i, irq;
 
                irqp = &res->data.extended_irq;
 
-               if (irqp->interrupt_count > 0) {
-                       hdp->hd_nirqs = irqp->interrupt_count;
-
-                       for (i = 0; i < hdp->hd_nirqs; i++) {
-                               int rc =
-                                   acpi_register_gsi(irqp->interrupts[i],
-                                                     irqp->triggering,
-                                                     irqp->polarity);
-                               if (rc < 0)
-                                       return AE_ERROR;
-                               hdp->hd_irq[i] = rc;
-                       }
+               for (i = 0; i < irqp->interrupt_count; i++) {
+                       irq = acpi_register_gsi(irqp->interrupts[i],
+                                     irqp->triggering, irqp->polarity);
+                       if (irq < 0)
+                               return AE_ERROR;
+
+                       hdp->hd_irq[hdp->hd_nirqs] = irq;
+                       hdp->hd_nirqs++;
                }
        }
 
index 41a94bc79f67f4536f8ce164f9f3a3bae263da4e..eb2eb3e12d6a0ed07a48046e0df136a504342470 100644 (file)
@@ -250,12 +250,17 @@ tipar_open(struct inode *inode, struct file *file)
 {
        unsigned int minor = iminor(inode) - TIPAR_MINOR;
 
-       if (minor > tp_count - 1)
+       if (tp_count == 0 || minor > tp_count - 1)
                return -ENXIO;
 
        if (test_and_set_bit(minor, &opened))
                return -EBUSY;
 
+       if (!table[minor].dev) {
+               printk(KERN_ERR "%s: NULL device for minor %u\n",
+                               __FUNCTION__, minor);
+               return -ENXIO;
+       }
        parport_claim_or_block(table[minor].dev);
        init_ti_parallel(minor);
        parport_release(table[minor].dev);
@@ -510,16 +515,20 @@ tipar_init_module(void)
                err = PTR_ERR(tipar_class);
                goto out_chrdev;
        }
-       if (parport_register_driver(&tipar_driver)) {
+       if (parport_register_driver(&tipar_driver) || tp_count == 0) {
                printk(KERN_ERR "tipar: unable to register with parport\n");
                err = -EIO;
-               goto out;
+               goto out_class;
        }
 
        err = 0;
        goto out;
 
+out_class:
+       class_destroy(tipar_class);
+
 out_chrdev:
+       devfs_remove("ticables/par");
        unregister_chrdev(TIPAR_MAJOR, "tipar");
 out:
        return err;     
index 076e07c1da38dc441592d8a98d83804d4ff8afea..e9bba94fc898388ff09bd8a9e2116442e07ca104 100644 (file)
@@ -268,6 +268,8 @@ static struct tty_buffer *tty_buffer_alloc(size_t size)
        p->size = size;
        p->next = NULL;
        p->active = 0;
+       p->commit = 0;
+       p->read = 0;
        p->char_buf_ptr = (char *)(p->data);
        p->flag_buf_ptr = (unsigned char *)p->char_buf_ptr + size;
 /*     printk("Flip create %p\n", p); */
@@ -298,6 +300,8 @@ static struct tty_buffer *tty_buffer_find(struct tty_struct *tty, size_t size)
                        *tbh = t->next;
                        t->next = NULL;
                        t->used = 0;
+                       t->commit = 0;
+                       t->read = 0;
                        /* DEBUG ONLY */
                        memset(t->data, '*', size);
 /*                     printk("Flip recycle %p\n", t); */
@@ -335,6 +339,7 @@ int tty_buffer_request_room(struct tty_struct *tty, size_t size)
                        if (b != NULL) {
                                b->next = n;
                                b->active = 0;
+                               b->commit = b->used;
                        } else
                                tty->buf.head = n;
                        tty->buf.tail = n;
@@ -1836,7 +1841,6 @@ static void release_dev(struct file * filp)
                tty_closing = tty->count <= 1;
                o_tty_closing = o_tty &&
                        (o_tty->count <= (pty_master ? 1 : 0));
-               up(&tty_sem);
                do_sleep = 0;
 
                if (tty_closing) {
@@ -1864,6 +1868,7 @@ static void release_dev(struct file * filp)
 
                printk(KERN_WARNING "release_dev: %s: read/write wait queue "
                                    "active!\n", tty_name(tty, buf));
+               up(&tty_sem);
                schedule();
        }       
 
@@ -1872,8 +1877,6 @@ static void release_dev(struct file * filp)
         * both sides, and we've completed the last operation that could 
         * block, so it's safe to proceed with closing.
         */
-        
-       down(&tty_sem);
        if (pty_master) {
                if (--o_tty->count < 0) {
                        printk(KERN_WARNING "release_dev: bad pty slave count "
@@ -1887,7 +1890,6 @@ static void release_dev(struct file * filp)
                       tty->count, tty_name(tty, buf));
                tty->count = 0;
        }
-       up(&tty_sem);
        
        /*
         * We've decremented tty->count, so we need to remove this file
@@ -1932,6 +1934,8 @@ static void release_dev(struct file * filp)
                read_unlock(&tasklist_lock);
        }
 
+       up(&tty_sem);
+
        /* check whether both sides are closing ... */
        if (!tty_closing || (o_tty && !o_tty_closing))
                return;
@@ -2752,6 +2756,9 @@ static void flush_to_ldisc(void *private_)
        unsigned long   flags;
        struct tty_ldisc *disc;
        struct tty_buffer *tbuf;
+       int count;
+       char *char_buf;
+       unsigned char *flag_buf;
 
        disc = tty_ldisc_ref(tty);
        if (disc == NULL)       /*  !TTY_LDISC */
@@ -2765,16 +2772,20 @@ static void flush_to_ldisc(void *private_)
                goto out;
        }
        spin_lock_irqsave(&tty->buf.lock, flags);
-       while((tbuf = tty->buf.head) != NULL && !tbuf->active) {
+       while((tbuf = tty->buf.head) != NULL) {
+               while ((count = tbuf->commit - tbuf->read) != 0) {
+                       char_buf = tbuf->char_buf_ptr + tbuf->read;
+                       flag_buf = tbuf->flag_buf_ptr + tbuf->read;
+                       tbuf->read += count;
+                       spin_unlock_irqrestore(&tty->buf.lock, flags);
+                       disc->receive_buf(tty, char_buf, flag_buf, count);
+                       spin_lock_irqsave(&tty->buf.lock, flags);
+               }
+               if (tbuf->active)
+                       break;
                tty->buf.head = tbuf->next;
                if (tty->buf.head == NULL)
                        tty->buf.tail = NULL;
-               spin_unlock_irqrestore(&tty->buf.lock, flags);
-               /* printk("Process buffer %p for %d\n", tbuf, tbuf->used); */
-               disc->receive_buf(tty, tbuf->char_buf_ptr,
-                                      tbuf->flag_buf_ptr,
-                                      tbuf->used);
-               spin_lock_irqsave(&tty->buf.lock, flags);
                tty_buffer_free(tty, tbuf);
        }
        spin_unlock_irqrestore(&tty->buf.lock, flags);
@@ -2871,8 +2882,10 @@ void tty_flip_buffer_push(struct tty_struct *tty)
 {
        unsigned long flags;
        spin_lock_irqsave(&tty->buf.lock, flags);
-       if (tty->buf.tail != NULL)
+       if (tty->buf.tail != NULL) {
                tty->buf.tail->active = 0;
+               tty->buf.tail->commit = tty->buf.tail->used;
+       }
        spin_unlock_irqrestore(&tty->buf.lock, flags);
 
        if (tty->low_latency)
index 37c9e13ad3acfc1c20c9592b4c89c6ead8bfff51..8d6b249ad66b8f44c12a4c5f21f421ba17db3f2f 100644 (file)
  *     More info available at http://www.berkprod.com/ or http://www.pcwatchdog.com/
  */
 
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/types.h>
-#include <linux/timer.h>
-#include <linux/jiffies.h>
-#include <linux/config.h>
-#include <linux/wait.h>
-#include <linux/slab.h>
-#include <linux/ioport.h>
-#include <linux/delay.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/watchdog.h>
-#include <linux/notifier.h>
-#include <linux/init.h>
-#include <linux/spinlock.h>
-#include <linux/reboot.h>
+#include <linux/config.h>      /* For CONFIG_WATCHDOG_NOWAYOUT/... */
+#include <linux/module.h>      /* For module specific items */
+#include <linux/moduleparam.h> /* For new moduleparam's */
+#include <linux/types.h>       /* For standard types (like size_t) */
+#include <linux/errno.h>       /* For the -ENODEV/... values */
+#include <linux/kernel.h>      /* For printk/panic/... */
+#include <linux/delay.h>       /* For mdelay function */
+#include <linux/timer.h>       /* For timer related operations */
+#include <linux/jiffies.h>     /* For jiffies stuff */
+#include <linux/miscdevice.h>  /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
+#include <linux/watchdog.h>    /* For the watchdog specific items */
+#include <linux/notifier.h>    /* For notifier support */
+#include <linux/reboot.h>      /* For reboot_notifier stuff */
+#include <linux/init.h>                /* For __init/__exit/... */
+#include <linux/fs.h>          /* For file operations */
+#include <linux/ioport.h>      /* For io-port access */
+#include <linux/spinlock.h>    /* For spin_lock/spin_unlock/... */
 #include <linux/sched.h>       /* TASK_INTERRUPTIBLE, set_current_state() and friends */
-#include <asm/uaccess.h>
-#include <asm/io.h>
+#include <linux/slab.h>                /* For kmalloc */
 
-#define WD_VER                  "1.16 (06/12/2004)"
-#define PFX                    "pcwd: "
+#include <asm/uaccess.h>       /* For copy_to_user/put_user/... */
+#include <asm/io.h>            /* For inb/outb/... */
+
+/* Module and version information */
+#define WATCHDOG_VERSION "1.16"
+#define WATCHDOG_DATE "03 Jan 2006"
+#define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog"
+#define WATCHDOG_NAME "pcwd"
+#define PFX WATCHDOG_NAME ": "
+#define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION " (" WATCHDOG_DATE ")\n"
+#define WD_VER WATCHDOG_VERSION " (" WATCHDOG_DATE ")"
 
 /*
  * It should be noted that PCWD_REVISION_B was removed because A and B
 
 /*
  * These are the defines that describe the control status bits for the
- * PC Watchdog card, revision A.
- */
+ * PCI-PC Watchdog card.
+*/
+/* Port 1 : Control Status #1 for the PC Watchdog card, revision A. */
 #define WD_WDRST                0x01   /* Previously reset state */
 #define WD_T110                 0x02   /* Temperature overheat sense */
 #define WD_HRTBT                0x04   /* Heartbeat sense */
 #define WD_RLY2                 0x08   /* External relay triggered */
 #define WD_SRLY2                0x80   /* Software external relay triggered */
-
-/*
- * These are the defines that describe the control status bits for the
- * PC Watchdog card, revision C.
- */
+/* Port 1 : Control Status #1 for the PC Watchdog card, revision C. */
 #define WD_REVC_WTRP            0x01   /* Watchdog Trip status */
 #define WD_REVC_HRBT            0x02   /* Watchdog Heartbeat */
 #define WD_REVC_TTRP            0x04   /* Temperature Trip status */
+/* Port 2 : Control Status #2 */
+#define WD_WDIS                        0x10    /* Watchdog Disabled */
+#define WD_ENTP                        0x20    /* Watchdog Enable Temperature Trip */
+#define WD_SSEL                        0x40    /* Watchdog Switch Select (1:SW1 <-> 0:SW2) */
+#define WD_WCMD                        0x80    /* Watchdog Command Mode */
 
 /* max. time we give an ISA watchdog card to process a command */
 /* 500ms for each 4 bit response (according to spec.) */
 #define ISA_COMMAND_TIMEOUT     1000
 
 /* Watchdog's internal commands */
-#define CMD_ISA_IDLE                    0x00
-#define CMD_ISA_VERSION_INTEGER         0x01
-#define CMD_ISA_VERSION_TENTH           0x02
-#define CMD_ISA_VERSION_HUNDRETH        0x03
-#define CMD_ISA_VERSION_MINOR           0x04
-#define CMD_ISA_SWITCH_SETTINGS         0x05
-#define CMD_ISA_DELAY_TIME_2SECS        0x0A
-#define CMD_ISA_DELAY_TIME_4SECS        0x0B
-#define CMD_ISA_DELAY_TIME_8SECS        0x0C
+#define CMD_ISA_IDLE                   0x00
+#define CMD_ISA_VERSION_INTEGER                0x01
+#define CMD_ISA_VERSION_TENTH          0x02
+#define CMD_ISA_VERSION_HUNDRETH       0x03
+#define CMD_ISA_VERSION_MINOR          0x04
+#define CMD_ISA_SWITCH_SETTINGS                0x05
+#define CMD_ISA_DELAY_TIME_2SECS       0x0A
+#define CMD_ISA_DELAY_TIME_4SECS       0x0B
+#define CMD_ISA_DELAY_TIME_8SECS       0x0C
 
 /*
  * We are using an kernel timer to do the pinging of the watchdog
@@ -130,15 +140,17 @@ static int cards_found;
 /* internal variables */
 static atomic_t open_allowed = ATOMIC_INIT(1);
 static char expect_close;
-static struct timer_list timer;
-static unsigned long next_heartbeat;
 static int temp_panic;
-static int revision;                   /* The card's revision */
-static int supports_temp;              /* Wether or not the card has a temperature device */
-static int command_mode;               /* Wether or not the card is in command mode */
-static int initial_status;             /* The card's boot status */
-static int current_readport;           /* The cards I/O address */
-static spinlock_t io_lock;
+static struct {                                /* this is private data for each ISA-PC watchdog card */
+       int revision;                   /* The card's revision */
+       int supports_temp;              /* Wether or not the card has a temperature device */
+       int command_mode;               /* Wether or not the card is in command mode */
+       int boot_status;                /* The card's boot status */
+       int io_addr;                    /* The cards I/O address */
+       spinlock_t io_lock;             /* the lock for io operations */
+       struct timer_list timer;        /* The timer that pings the watchdog */
+       unsigned long next_heartbeat;   /* the next_heartbeat for the timer */
+} pcwd_private;
 
 /* module parameters */
 #define WATCHDOG_HEARTBEAT 60          /* 60 sec default heartbeat */
@@ -161,14 +173,14 @@ static int send_isa_command(int cmd)
        int port0, last_port0;  /* Double read for stabilising */
 
        /* The WCMD bit must be 1 and the command is only 4 bits in size */
-       control_status = (cmd & 0x0F) | 0x80;
-       outb_p(control_status, current_readport + 2);
+       control_status = (cmd & 0x0F) | WD_WCMD;
+       outb_p(control_status, pcwd_private.io_addr + 2);
        udelay(ISA_COMMAND_TIMEOUT);
 
-       port0 = inb_p(current_readport);
+       port0 = inb_p(pcwd_private.io_addr);
        for (i = 0; i < 25; ++i) {
                last_port0 = port0;
-               port0 = inb_p(current_readport);
+               port0 = inb_p(pcwd_private.io_addr);
 
                if (port0 == last_port0)
                        break;  /* Data is stable */
@@ -184,7 +196,7 @@ static int set_command_mode(void)
        int i, found=0, count=0;
 
        /* Set the card into command mode */
-       spin_lock(&io_lock);
+       spin_lock(&pcwd_private.io_lock);
        while ((!found) && (count < 3)) {
                i = send_isa_command(CMD_ISA_IDLE);
 
@@ -192,15 +204,15 @@ static int set_command_mode(void)
                        found = 1;
                else if (i == 0xF3) {
                        /* Card does not like what we've done to it */
-                       outb_p(0x00, current_readport + 2);
+                       outb_p(0x00, pcwd_private.io_addr + 2);
                        udelay(1200);   /* Spec says wait 1ms */
-                       outb_p(0x00, current_readport + 2);
+                       outb_p(0x00, pcwd_private.io_addr + 2);
                        udelay(ISA_COMMAND_TIMEOUT);
                }
                count++;
        }
-       spin_unlock(&io_lock);
-       command_mode = found;
+       spin_unlock(&pcwd_private.io_lock);
+       pcwd_private.command_mode = found;
 
        return(found);
 }
@@ -208,12 +220,95 @@ static int set_command_mode(void)
 static void unset_command_mode(void)
 {
        /* Set the card into normal mode */
-       spin_lock(&io_lock);
-       outb_p(0x00, current_readport + 2);
+       spin_lock(&pcwd_private.io_lock);
+       outb_p(0x00, pcwd_private.io_addr + 2);
        udelay(ISA_COMMAND_TIMEOUT);
-       spin_unlock(&io_lock);
+       spin_unlock(&pcwd_private.io_lock);
+
+       pcwd_private.command_mode = 0;
+}
+
+static inline void pcwd_check_temperature_support(void)
+{
+       if (inb(pcwd_private.io_addr) != 0xF0)
+               pcwd_private.supports_temp = 1;
+}
+
+static inline char *get_firmware(void)
+{
+       int one, ten, hund, minor;
+       char *ret;
+
+       ret = kmalloc(6, GFP_KERNEL);
+       if(ret == NULL)
+               return NULL;
+
+       if (set_command_mode()) {
+               one = send_isa_command(CMD_ISA_VERSION_INTEGER);
+               ten = send_isa_command(CMD_ISA_VERSION_TENTH);
+               hund = send_isa_command(CMD_ISA_VERSION_HUNDRETH);
+               minor = send_isa_command(CMD_ISA_VERSION_MINOR);
+               sprintf(ret, "%c.%c%c%c", one, ten, hund, minor);
+       }
+       else
+               sprintf(ret, "ERROR");
+
+       unset_command_mode();
+       return(ret);
+}
+
+static inline int pcwd_get_option_switches(void)
+{
+       int option_switches=0;
+
+       if (set_command_mode()) {
+               /* Get switch settings */
+               option_switches = send_isa_command(CMD_ISA_SWITCH_SETTINGS);
+       }
+
+       unset_command_mode();
+       return(option_switches);
+}
+
+static void pcwd_show_card_info(void)
+{
+       char *firmware;
+       int option_switches;
+
+       /* Get some extra info from the hardware (in command/debug/diag mode) */
+       if (pcwd_private.revision == PCWD_REVISION_A)
+               printk(KERN_INFO PFX "ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", pcwd_private.io_addr);
+       else if (pcwd_private.revision == PCWD_REVISION_C) {
+               firmware = get_firmware();
+               printk(KERN_INFO PFX "ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n",
+                       pcwd_private.io_addr, firmware);
+               kfree(firmware);
+               option_switches = pcwd_get_option_switches();
+               printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n",
+                       option_switches,
+                       ((option_switches & 0x10) ? "ON" : "OFF"),
+                       ((option_switches & 0x08) ? "ON" : "OFF"));
+
+               /* Reprogram internal heartbeat to 2 seconds */
+               if (set_command_mode()) {
+                       send_isa_command(CMD_ISA_DELAY_TIME_2SECS);
+                       unset_command_mode();
+               }
+       }
+
+       if (pcwd_private.supports_temp)
+               printk(KERN_INFO PFX "Temperature Option Detected\n");
+
+       if (pcwd_private.boot_status & WDIOF_CARDRESET)
+               printk(KERN_INFO PFX "Previous reboot was caused by the card\n");
+
+       if (pcwd_private.boot_status & WDIOF_OVERHEAT) {
+               printk(KERN_EMERG PFX "Card senses a CPU Overheat. Panicking!\n");
+               printk(KERN_EMERG PFX "CPU Overheat\n");
+       }
 
-       command_mode = 0;
+       if (pcwd_private.boot_status == 0)
+               printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n");
 }
 
 static void pcwd_timer_ping(unsigned long data)
@@ -222,25 +317,25 @@ static void pcwd_timer_ping(unsigned long data)
 
        /* If we got a heartbeat pulse within the WDT_INTERVAL
         * we agree to ping the WDT */
-       if(time_before(jiffies, next_heartbeat)) {
+       if(time_before(jiffies, pcwd_private.next_heartbeat)) {
                /* Ping the watchdog */
-               spin_lock(&io_lock);
-               if (revision == PCWD_REVISION_A) {
+               spin_lock(&pcwd_private.io_lock);
+               if (pcwd_private.revision == PCWD_REVISION_A) {
                        /*  Rev A cards are reset by setting the WD_WDRST bit in register 1 */
-                       wdrst_stat = inb_p(current_readport);
+                       wdrst_stat = inb_p(pcwd_private.io_addr);
                        wdrst_stat &= 0x0F;
                        wdrst_stat |= WD_WDRST;
 
-                       outb_p(wdrst_stat, current_readport + 1);
+                       outb_p(wdrst_stat, pcwd_private.io_addr + 1);
                } else {
                        /* Re-trigger watchdog by writing to port 0 */
-                       outb_p(0x00, current_readport);
+                       outb_p(0x00, pcwd_private.io_addr);
                }
 
                /* Re-set the timer interval */
-               mod_timer(&timer, jiffies + WDT_INTERVAL);
+               mod_timer(&pcwd_private.timer, jiffies + WDT_INTERVAL);
 
-               spin_unlock(&io_lock);
+               spin_unlock(&pcwd_private.io_lock);
        } else {
                printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
        }
@@ -250,19 +345,19 @@ static int pcwd_start(void)
 {
        int stat_reg;
 
-       next_heartbeat = jiffies + (heartbeat * HZ);
+       pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ);
 
        /* Start the timer */
-       mod_timer(&timer, jiffies + WDT_INTERVAL);
+       mod_timer(&pcwd_private.timer, jiffies + WDT_INTERVAL);
 
        /* Enable the port */
-       if (revision == PCWD_REVISION_C) {
-               spin_lock(&io_lock);
-               outb_p(0x00, current_readport + 3);
+       if (pcwd_private.revision == PCWD_REVISION_C) {
+               spin_lock(&pcwd_private.io_lock);
+               outb_p(0x00, pcwd_private.io_addr + 3);
                udelay(ISA_COMMAND_TIMEOUT);
-               stat_reg = inb_p(current_readport + 2);
-               spin_unlock(&io_lock);
-               if (stat_reg & 0x10) {
+               stat_reg = inb_p(pcwd_private.io_addr + 2);
+               spin_unlock(&pcwd_private.io_lock);
+               if (stat_reg & WD_WDIS) {
                        printk(KERN_INFO PFX "Could not start watchdog\n");
                        return -EIO;
                }
@@ -275,18 +370,18 @@ static int pcwd_stop(void)
        int stat_reg;
 
        /* Stop the timer */
-       del_timer(&timer);
+       del_timer(&pcwd_private.timer);
 
        /*  Disable the board  */
-       if (revision == PCWD_REVISION_C) {
-               spin_lock(&io_lock);
-               outb_p(0xA5, current_readport + 3);
+       if (pcwd_private.revision == PCWD_REVISION_C) {
+               spin_lock(&pcwd_private.io_lock);
+               outb_p(0xA5, pcwd_private.io_addr + 3);
                udelay(ISA_COMMAND_TIMEOUT);
-               outb_p(0xA5, current_readport + 3);
+               outb_p(0xA5, pcwd_private.io_addr + 3);
                udelay(ISA_COMMAND_TIMEOUT);
-               stat_reg = inb_p(current_readport + 2);
-               spin_unlock(&io_lock);
-               if ((stat_reg & 0x10) == 0) {
+               stat_reg = inb_p(pcwd_private.io_addr + 2);
+               spin_unlock(&pcwd_private.io_lock);
+               if ((stat_reg & WD_WDIS) == 0) {
                        printk(KERN_INFO PFX "Could not stop watchdog\n");
                        return -EIO;
                }
@@ -297,7 +392,7 @@ static int pcwd_stop(void)
 static int pcwd_keepalive(void)
 {
        /* user land ping */
-       next_heartbeat = jiffies + (heartbeat * HZ);
+       pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ);
        return 0;
 }
 
@@ -315,23 +410,23 @@ static int pcwd_get_status(int *status)
        int card_status;
 
        *status=0;
-       spin_lock(&io_lock);
-       if (revision == PCWD_REVISION_A)
+       spin_lock(&pcwd_private.io_lock);
+       if (pcwd_private.revision == PCWD_REVISION_A)
                /* Rev A cards return status information from
                 * the base register, which is used for the
                 * temperature in other cards. */
-               card_status = inb(current_readport);
+               card_status = inb(pcwd_private.io_addr);
        else {
                /* Rev C cards return card status in the base
                 * address + 1 register. And use different bits
                 * to indicate a card initiated reset, and an
                 * over-temperature condition. And the reboot
                 * status can be reset. */
-               card_status = inb(current_readport + 1);
+               card_status = inb(pcwd_private.io_addr + 1);
        }
-       spin_unlock(&io_lock);
+       spin_unlock(&pcwd_private.io_lock);
 
-       if (revision == PCWD_REVISION_A) {
+       if (pcwd_private.revision == PCWD_REVISION_A) {
                if (card_status & WD_WDRST)
                        *status |= WDIOF_CARDRESET;
 
@@ -360,10 +455,10 @@ static int pcwd_get_status(int *status)
 
 static int pcwd_clear_status(void)
 {
-       if (revision == PCWD_REVISION_C) {
-               spin_lock(&io_lock);
-               outb_p(0x00, current_readport + 1); /* clear reset status */
-               spin_unlock(&io_lock);
+       if (pcwd_private.revision == PCWD_REVISION_C) {
+               spin_lock(&pcwd_private.io_lock);
+               outb_p(0x00, pcwd_private.io_addr + 1); /* clear reset status */
+               spin_unlock(&pcwd_private.io_lock);
        }
        return 0;
 }
@@ -371,20 +466,20 @@ static int pcwd_clear_status(void)
 static int pcwd_get_temperature(int *temperature)
 {
        /* check that port 0 gives temperature info and no command results */
-       if (command_mode)
+       if (pcwd_private.command_mode)
                return -1;
 
        *temperature = 0;
-       if (!supports_temp)
+       if (!pcwd_private.supports_temp)
                return -ENODEV;
 
        /*
         * Convert celsius to fahrenheit, since this was
         * the decided 'standard' for this return value.
         */
-       spin_lock(&io_lock);
-       *temperature = ((inb(current_readport)) * 9 / 5) + 32;
-       spin_unlock(&io_lock);
+       spin_lock(&pcwd_private.io_lock);
+       *temperature = ((inb(pcwd_private.io_addr)) * 9 / 5) + 32;
+       spin_unlock(&pcwd_private.io_lock);
 
        return 0;
 }
@@ -425,7 +520,7 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
                return put_user(status, argp);
 
        case WDIOC_GETBOOTSTATUS:
-               return put_user(initial_status, argp);
+               return put_user(pcwd_private.boot_status, argp);
 
        case WDIOC_GETTEMP:
                if (pcwd_get_temperature(&temperature))
@@ -434,7 +529,7 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
                return put_user(temperature, argp);
 
        case WDIOC_SETOPTIONS:
-               if (revision == PCWD_REVISION_C)
+               if (pcwd_private.revision == PCWD_REVISION_C)
                {
                        if(copy_from_user(&rv, argp, sizeof(int)))
                                return -EFAULT;
@@ -550,7 +645,7 @@ static ssize_t pcwd_temp_read(struct file *file, char __user *buf, size_t count,
 
 static int pcwd_temp_open(struct inode *inode, struct file *file)
 {
-       if (!supports_temp)
+       if (!pcwd_private.supports_temp)
                return -ENODEV;
 
        return nonseekable_open(inode, file);
@@ -616,68 +711,24 @@ static struct notifier_block pcwd_notifier = {
  *     Init & exit routines
  */
 
-static inline void get_support(void)
-{
-       if (inb(current_readport) != 0xF0)
-               supports_temp = 1;
-}
-
 static inline int get_revision(void)
 {
        int r = PCWD_REVISION_C;
 
-       spin_lock(&io_lock);
+       spin_lock(&pcwd_private.io_lock);
        /* REV A cards use only 2 io ports; test
         * presumes a floating bus reads as 0xff. */
-       if ((inb(current_readport + 2) == 0xFF) ||
-           (inb(current_readport + 3) == 0xFF))
+       if ((inb(pcwd_private.io_addr + 2) == 0xFF) ||
+           (inb(pcwd_private.io_addr + 3) == 0xFF))
                r=PCWD_REVISION_A;
-       spin_unlock(&io_lock);
+       spin_unlock(&pcwd_private.io_lock);
 
        return r;
 }
 
-static inline char *get_firmware(void)
-{
-       int one, ten, hund, minor;
-       char *ret;
-
-       ret = kmalloc(6, GFP_KERNEL);
-       if(ret == NULL)
-               return NULL;
-
-       if (set_command_mode()) {
-               one = send_isa_command(CMD_ISA_VERSION_INTEGER);
-               ten = send_isa_command(CMD_ISA_VERSION_TENTH);
-               hund = send_isa_command(CMD_ISA_VERSION_HUNDRETH);
-               minor = send_isa_command(CMD_ISA_VERSION_MINOR);
-               sprintf(ret, "%c.%c%c%c", one, ten, hund, minor);
-       }
-       else
-               sprintf(ret, "ERROR");
-
-       unset_command_mode();
-       return(ret);
-}
-
-static inline int get_option_switches(void)
-{
-       int rv=0;
-
-       if (set_command_mode()) {
-               /* Get switch settings */
-               rv = send_isa_command(CMD_ISA_SWITCH_SETTINGS);
-       }
-
-       unset_command_mode();
-       return(rv);
-}
-
 static int __devinit pcwatchdog_init(int base_addr)
 {
        int ret;
-       char *firmware;
-       int option_switches;
 
        cards_found++;
        if (cards_found == 1)
@@ -692,104 +743,66 @@ static int __devinit pcwatchdog_init(int base_addr)
                printk(KERN_ERR PFX "No I/O-Address for card detected\n");
                return -ENODEV;
        }
-       current_readport = base_addr;
+       pcwd_private.io_addr = base_addr;
 
        /* Check card's revision */
-       revision = get_revision();
+       pcwd_private.revision = get_revision();
 
-       if (!request_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4, "PCWD")) {
+       if (!request_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4, "PCWD")) {
                printk(KERN_ERR PFX "I/O address 0x%04x already in use\n",
-                       current_readport);
-               current_readport = 0x0000;
+                       pcwd_private.io_addr);
+               pcwd_private.io_addr = 0x0000;
                return -EIO;
        }
 
        /* Initial variables */
-       supports_temp = 0;
+       pcwd_private.supports_temp = 0;
        temp_panic = 0;
-       initial_status = 0x0000;
+       pcwd_private.boot_status = 0x0000;
 
        /* get the boot_status */
-       pcwd_get_status(&initial_status);
+       pcwd_get_status(&pcwd_private.boot_status);
 
        /* clear the "card caused reboot" flag */
        pcwd_clear_status();
 
-       init_timer(&timer);
-       timer.function = pcwd_timer_ping;
-       timer.data = 0;
+       init_timer(&pcwd_private.timer);
+       pcwd_private.timer.function = pcwd_timer_ping;
+       pcwd_private.timer.data = 0;
 
        /*  Disable the board  */
        pcwd_stop();
 
        /*  Check whether or not the card supports the temperature device */
-       get_support();
-
-       /* Get some extra info from the hardware (in command/debug/diag mode) */
-       if (revision == PCWD_REVISION_A)
-               printk(KERN_INFO PFX "ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", current_readport);
-       else if (revision == PCWD_REVISION_C) {
-               firmware = get_firmware();
-               printk(KERN_INFO PFX "ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n",
-                       current_readport, firmware);
-               kfree(firmware);
-               option_switches = get_option_switches();
-               printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n",
-                       option_switches,
-                       ((option_switches & 0x10) ? "ON" : "OFF"),
-                       ((option_switches & 0x08) ? "ON" : "OFF"));
-
-               /* Reprogram internal heartbeat to 2 seconds */
-               if (set_command_mode()) {
-                       send_isa_command(CMD_ISA_DELAY_TIME_2SECS);
-                       unset_command_mode();
-               }
-       } else {
-               /* Should NEVER happen, unless get_revision() fails. */
-               printk(KERN_INFO PFX "Unable to get revision\n");
-               release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4);
-               current_readport = 0x0000;
-               return -1;
-       }
+       pcwd_check_temperature_support();
 
-       if (supports_temp)
-               printk(KERN_INFO PFX "Temperature Option Detected\n");
-
-       if (initial_status & WDIOF_CARDRESET)
-               printk(KERN_INFO PFX "Previous reboot was caused by the card\n");
-
-       if (initial_status & WDIOF_OVERHEAT) {
-               printk(KERN_EMERG PFX "Card senses a CPU Overheat. Panicking!\n");
-               printk(KERN_EMERG PFX "CPU Overheat\n");
-       }
-
-       if (initial_status == 0)
-               printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n");
+       /* Show info about the card itself */
+       pcwd_show_card_info();
 
        /* Check that the heartbeat value is within it's range ; if not reset to the default */
-        if (pcwd_set_heartbeat(heartbeat)) {
-                pcwd_set_heartbeat(WATCHDOG_HEARTBEAT);
-                printk(KERN_INFO PFX "heartbeat value must be 2<=heartbeat<=7200, using %d\n",
-                        WATCHDOG_HEARTBEAT);
+       if (pcwd_set_heartbeat(heartbeat)) {
+               pcwd_set_heartbeat(WATCHDOG_HEARTBEAT);
+               printk(KERN_INFO PFX "heartbeat value must be 2<=heartbeat<=7200, using %d\n",
+                       WATCHDOG_HEARTBEAT);
        }
 
        ret = register_reboot_notifier(&pcwd_notifier);
        if (ret) {
                printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
                        ret);
-               release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4);
-               current_readport = 0x0000;
+               release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4);
+               pcwd_private.io_addr = 0x0000;
                return ret;
        }
 
-       if (supports_temp) {
+       if (pcwd_private.supports_temp) {
                ret = misc_register(&temp_miscdev);
                if (ret) {
                        printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
                                TEMP_MINOR, ret);
                        unregister_reboot_notifier(&pcwd_notifier);
-                       release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4);
-                       current_readport = 0x0000;
+                       release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4);
+                       pcwd_private.io_addr = 0x0000;
                        return ret;
                }
        }
@@ -798,11 +811,11 @@ static int __devinit pcwatchdog_init(int base_addr)
        if (ret) {
                printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
                        WATCHDOG_MINOR, ret);
-               if (supports_temp)
+               if (pcwd_private.supports_temp)
                        misc_deregister(&temp_miscdev);
                unregister_reboot_notifier(&pcwd_notifier);
-               release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4);
-               current_readport = 0x0000;
+               release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4);
+               pcwd_private.io_addr = 0x0000;
                return ret;
        }
 
@@ -820,11 +833,12 @@ static void __devexit pcwatchdog_exit(void)
 
        /* Deregister */
        misc_deregister(&pcwd_miscdev);
-       if (supports_temp)
+       if (pcwd_private.supports_temp)
                misc_deregister(&temp_miscdev);
        unregister_reboot_notifier(&pcwd_notifier);
-       release_region(current_readport, (revision == PCWD_REVISION_A) ? 2 : 4);
-       current_readport = 0x0000;
+       release_region(pcwd_private.io_addr, (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4);
+       pcwd_private.io_addr = 0x0000;
+       cards_found--;
 }
 
 /*
@@ -887,7 +901,7 @@ static int __init pcwd_init_module(void)
 {
        int i, found = 0;
 
-       spin_lock_init(&io_lock);
+       spin_lock_init(&pcwd_private.io_lock);
 
        for (i = 0; pcwd_ioports[i] != 0; i++) {
                if (pcwd_checkcard(pcwd_ioports[i])) {
@@ -906,7 +920,7 @@ static int __init pcwd_init_module(void)
 
 static void __exit pcwd_cleanup_module(void)
 {
-       if (current_readport)
+       if (pcwd_private.io_addr)
                pcwatchdog_exit();
        return;
 }
index b474ea52d6e8554446f524f0067de44e6881ed7d..522a9370db948052c4bde4954fadef09b5759d49 100644 (file)
@@ -93,23 +93,25 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file,
 {
        int ret = -ENOIOCTLCMD;
        int time;
+       void __user *argp = (void __user *)arg;
+       int __user *p = argp;
 
        switch (cmd) {
        case WDIOC_GETSUPPORT:
-               ret = copy_to_user((struct watchdog_info __user *)arg, &ident,
+               ret = copy_to_user(argp, &ident,
                                   sizeof(ident)) ? -EFAULT : 0;
                break;
 
        case WDIOC_GETSTATUS:
-               ret = put_user(0, (int __user *)arg);
+               ret = put_user(0, p);
                break;
 
        case WDIOC_GETBOOTSTATUS:
-               ret = put_user(boot_status, (int __user *)arg);
+               ret = put_user(boot_status, p);
                break;
 
        case WDIOC_SETTIMEOUT:
-               ret = get_user(time, (int __user *)arg);
+               ret = get_user(time, p);
                if (ret)
                        break;
 
@@ -123,7 +125,7 @@ static int sa1100dog_ioctl(struct inode *inode, struct file *file,
                /*fall through*/
 
        case WDIOC_GETTIMEOUT:
-               ret = put_user(pre_margin / OSCR_FREQ, (int __user *)arg);
+               ret = put_user(pre_margin / OSCR_FREQ, p);
                break;
 
        case WDIOC_KEEPALIVE:
index 7a511479ae29b615e0d8fe1fcfdd223212a7e2a8..9582de1c9cadc543517b1aff92d8a7910960a7eb 100644 (file)
@@ -35,8 +35,8 @@
  * level driver of CPUFreq support, and its spinlock. This lock
  * also protects the cpufreq_cpu_data array.
  */
-static struct cpufreq_driver           *cpufreq_driver;
-static struct cpufreq_policy   *cpufreq_cpu_data[NR_CPUS];
+static struct cpufreq_driver *cpufreq_driver;
+static struct cpufreq_policy *cpufreq_cpu_data[NR_CPUS];
 static DEFINE_SPINLOCK(cpufreq_driver_lock);
 
 /* internal prototypes */
@@ -50,15 +50,15 @@ static void handle_update(void *data);
  * changes to devices when the CPU clock speed changes.
  * The mutex locks both lists.
  */
-static struct notifier_block    *cpufreq_policy_notifier_list;
-static struct notifier_block    *cpufreq_transition_notifier_list;
-static DECLARE_RWSEM           (cpufreq_notifier_rwsem);
+static struct notifier_block *cpufreq_policy_notifier_list;
+static struct notifier_block *cpufreq_transition_notifier_list;
+static DECLARE_RWSEM (cpufreq_notifier_rwsem);
 
 
 static LIST_HEAD(cpufreq_governor_list);
-static DEFINE_MUTEX            (cpufreq_governor_mutex);
+static DEFINE_MUTEX (cpufreq_governor_mutex);
 
-struct cpufreq_policy * cpufreq_cpu_get(unsigned int cpu)
+struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
 {
        struct cpufreq_policy *data;
        unsigned long flags;
@@ -85,20 +85,19 @@ struct cpufreq_policy * cpufreq_cpu_get(unsigned int cpu)
        if (!kobject_get(&data->kobj))
                goto err_out_put_module;
 
-
        spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
-
        return data;
 
- err_out_put_module:
+err_out_put_module:
        module_put(cpufreq_driver->owner);
- err_out_unlock:
+err_out_unlock:
        spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
- err_out:
+err_out:
        return NULL;
 }
 EXPORT_SYMBOL_GPL(cpufreq_cpu_get);
 
+
 void cpufreq_cpu_put(struct cpufreq_policy *data)
 {
        kobject_put(&data->kobj);
@@ -229,44 +228,53 @@ static inline void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci) {
 
 
 /**
- * cpufreq_notify_transition - call notifier chain and adjust_jiffies on frequency transition
+ * cpufreq_notify_transition - call notifier chain and adjust_jiffies
+ * on frequency transition.
  *
- * This function calls the transition notifiers and the "adjust_jiffies" function. It is called
- * twice on all CPU frequency changes that have external effects. 
+ * This function calls the transition notifiers and the "adjust_jiffies"
+ * function. It is called twice on all CPU frequency changes that have
+ * external effects. 
  */
 void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
 {
+       struct cpufreq_policy *policy;
+
        BUG_ON(irqs_disabled());
 
        freqs->flags = cpufreq_driver->flags;
-       dprintk("notification %u of frequency transition to %u kHz\n", state, freqs->new);
+       dprintk("notification %u of frequency transition to %u kHz\n",
+               state, freqs->new);
 
        down_read(&cpufreq_notifier_rwsem);
+
+       policy = cpufreq_cpu_data[freqs->cpu];
        switch (state) {
+
        case CPUFREQ_PRECHANGE:
-               /* detect if the driver reported a value as "old frequency" which
-                * is not equal to what the cpufreq core thinks is "old frequency".
+               /* detect if the driver reported a value as "old frequency" 
+                * which is not equal to what the cpufreq core thinks is
+                * "old frequency".
                 */
                if (!(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) {
-                       if ((likely(cpufreq_cpu_data[freqs->cpu])) &&
-                           (likely(cpufreq_cpu_data[freqs->cpu]->cpu == freqs->cpu)) &&
-                           (likely(cpufreq_cpu_data[freqs->cpu]->cur)) &&
-                           (unlikely(freqs->old != cpufreq_cpu_data[freqs->cpu]->cur)))
-                       {
-                               dprintk(KERN_WARNING "Warning: CPU frequency is %u, "
-                                      "cpufreq assumed %u kHz.\n", freqs->old, cpufreq_cpu_data[freqs->cpu]->cur);
-                               freqs->old = cpufreq_cpu_data[freqs->cpu]->cur;
+                       if ((policy) && (policy->cpu == freqs->cpu) &&
+                           (policy->cur) && (policy->cur != freqs->old)) {
+                               dprintk(KERN_WARNING "Warning: CPU frequency is"
+                                       " %u, cpufreq assumed %u kHz.\n",
+                                       freqs->old, policy->cur);
+                               freqs->old = policy->cur;
                        }
                }
-               notifier_call_chain(&cpufreq_transition_notifier_list, CPUFREQ_PRECHANGE, freqs);
+               notifier_call_chain(&cpufreq_transition_notifier_list,
+                                       CPUFREQ_PRECHANGE, freqs);
                adjust_jiffies(CPUFREQ_PRECHANGE, freqs);
                break;
+
        case CPUFREQ_POSTCHANGE:
                adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
-               notifier_call_chain(&cpufreq_transition_notifier_list, CPUFREQ_POSTCHANGE, freqs);
-               if ((likely(cpufreq_cpu_data[freqs->cpu])) && 
-                   (likely(cpufreq_cpu_data[freqs->cpu]->cpu == freqs->cpu)))
-                       cpufreq_cpu_data[freqs->cpu]->cur = freqs->new;
+               notifier_call_chain(&cpufreq_transition_notifier_list,
+                                       CPUFREQ_POSTCHANGE, freqs);
+               if (likely(policy) && likely(policy->cpu == freqs->cpu))
+                       policy->cur = freqs->new;
                break;
        }
        up_read(&cpufreq_notifier_rwsem);
@@ -308,7 +316,7 @@ static int cpufreq_parse_governor (char *str_governor, unsigned int *policy,
                                return 0;
                        }
                }
-       out:
+out:
                mutex_unlock(&cpufreq_governor_mutex);
        }
        return -EINVAL;
@@ -415,7 +423,6 @@ static ssize_t store_scaling_governor (struct cpufreq_policy * policy,
                return -EINVAL;
 
        ret = cpufreq_set_policy(&new_policy);
-
        return ret ? ret : count;
 }
 
@@ -446,7 +453,7 @@ static ssize_t show_scaling_available_governors (struct cpufreq_policy * policy,
                        goto out;
                i += scnprintf(&buf[i], CPUFREQ_NAME_LEN, "%s ", t->name);
        }
- out:
+out:
        i += sprintf(&buf[i], "\n");
        return i;
 }
@@ -789,7 +796,6 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
        kfree(data);
 
        cpufreq_debug_enable_ratelimit();
-
        return 0;
 }
 
@@ -870,8 +876,7 @@ unsigned int cpufreq_get(unsigned int cpu)
 
        ret = cpufreq_driver->get(cpu);
 
-       if (ret && policy->cur && !(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) 
-       {
+       if (ret && policy->cur && !(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) {
                /* verify no discrepancy between actual and saved value exists */
                if (unlikely(ret != policy->cur)) {
                        cpufreq_out_of_sync(cpu, policy->cur, ret);
@@ -881,7 +886,7 @@ unsigned int cpufreq_get(unsigned int cpu)
 
        mutex_unlock(&policy->lock);
 
- out:
+out:
        cpufreq_cpu_put(policy);
 
        return (ret);
@@ -962,7 +967,7 @@ static int cpufreq_suspend(struct sys_device * sysdev, pm_message_t pmsg)
                cpu_policy->cur = cur_freq;
        }
 
- out:
+out:
        cpufreq_cpu_put(cpu_policy);
        return 0;
 }
@@ -1169,7 +1174,6 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
        mutex_unlock(&policy->lock);
 
        cpufreq_cpu_put(policy);
-
        return ret;
 }
 EXPORT_SYMBOL_GPL(cpufreq_driver_target);
@@ -1208,7 +1212,6 @@ int cpufreq_governor(unsigned int cpu, unsigned int event)
        mutex_unlock(&policy->lock);
 
        cpufreq_cpu_put(policy);
-
        return ret;
 }
 EXPORT_SYMBOL_GPL(cpufreq_governor);
@@ -1232,7 +1235,6 @@ int cpufreq_register_governor(struct cpufreq_governor *governor)
        list_add(&governor->governor_list, &cpufreq_governor_list);
 
        mutex_unlock(&cpufreq_governor_mutex);
-
        return 0;
 }
 EXPORT_SYMBOL_GPL(cpufreq_register_governor);
@@ -1277,7 +1279,6 @@ int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
        mutex_unlock(&cpu_policy->lock);
 
        cpufreq_cpu_put(cpu_policy);
-
        return 0;
 }
 EXPORT_SYMBOL(cpufreq_get_policy);
@@ -1291,9 +1292,7 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
        dprintk("setting new policy for CPU %u: %u - %u kHz\n", policy->cpu,
                policy->min, policy->max);
 
-       memcpy(&policy->cpuinfo, 
-              &data->cpuinfo, 
-              sizeof(struct cpufreq_cpuinfo));
+       memcpy(&policy->cpuinfo, &data->cpuinfo, sizeof(struct cpufreq_cpuinfo));
 
        /* verify the cpu speed can be set within this limit */
        ret = cpufreq_driver->verify(policy);
@@ -1324,8 +1323,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
 
        up_read(&cpufreq_notifier_rwsem);
 
-       data->min    = policy->min;
-       data->max    = policy->max;
+       data->min = policy->min;
+       data->max = policy->max;
 
        dprintk("new min and max freqs are %u - %u kHz\n", data->min, data->max);
 
@@ -1362,7 +1361,7 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_poli
                __cpufreq_governor(data, CPUFREQ_GOV_LIMITS);
        }
 
- error_out:
+error_out:
        cpufreq_debug_enable_ratelimit();
        return ret;
 }
@@ -1421,9 +1420,7 @@ int cpufreq_update_policy(unsigned int cpu)
        mutex_lock(&data->lock);
 
        dprintk("updating policy for CPU %u\n", cpu);
-       memcpy(&policy, 
-              data,
-              sizeof(struct cpufreq_policy));
+       memcpy(&policy, data, sizeof(struct cpufreq_policy));
        policy.min = data->user_policy.min;
        policy.max = data->user_policy.max;
        policy.policy = data->user_policy.policy;
@@ -1433,8 +1430,13 @@ int cpufreq_update_policy(unsigned int cpu)
          -> ask driver for current freq and notify governors about a change */
        if (cpufreq_driver->get) {
                policy.cur = cpufreq_driver->get(cpu);
-               if (data->cur != policy.cur)
-                       cpufreq_out_of_sync(cpu, data->cur, policy.cur);
+               if (!data->cur) {
+                       dprintk("Driver did not initialize current freq");
+                       data->cur = policy.cur;
+               } else {
+                       if (data->cur != policy.cur)
+                               cpufreq_out_of_sync(cpu, data->cur, policy.cur);
+               }
        }
 
        ret = __cpufreq_set_policy(data, &policy);
index e87d52c599400c5b3a9ddfd8d498c8278420dba0..d7a9401600bb968ec3f81435734b2f0f618a4284 100644 (file)
@@ -1186,7 +1186,8 @@ static int __init sm_it87_init(void)
 
 static void __exit sm_it87_exit(void)
 {
-       i2c_isa_del_driver(&it87_isa_driver);
+       if (isa_address)
+               i2c_isa_del_driver(&it87_isa_driver);
        i2c_del_driver(&it87_driver);
 }
 
index 3eb08f004c0f8d7332791c812c8cc2b09462a39b..271e9cb9532c41000fc0d3ed3e8bc8e147c7631c 100644 (file)
@@ -437,12 +437,12 @@ static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO,          \
                show_temp, NULL, offset - 1);                           \
 static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR,       \
                show_temp_max, set_temp_max, offset - 1);               \
-static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR,       \
+static SENSOR_DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO | S_IWUSR,  \
                show_temp_min, set_temp_min, offset - 1)
 
 static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp0, NULL);
 static DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, show_temp0_max, set_temp0_max);
-static DEVICE_ATTR(temp1_min, S_IRUGO | S_IWUSR, show_temp0_min, set_temp0_min);
+static DEVICE_ATTR(temp1_max_hyst, S_IRUGO | S_IWUSR, show_temp0_min, set_temp0_min);
 
 define_temperature_sysfs(2);
 define_temperature_sysfs(3);
@@ -451,7 +451,7 @@ define_temperature_sysfs(5);
 define_temperature_sysfs(6);
 
 #define CFG_INFO_TEMP(id)      { &sensor_dev_attr_temp##id##_input.dev_attr, \
-                               &sensor_dev_attr_temp##id##_min.dev_attr, \
+                               &sensor_dev_attr_temp##id##_max_hyst.dev_attr, \
                                &sensor_dev_attr_temp##id##_max.dev_attr }
 #define CFG_INFO_VOLT(id)      { &sensor_dev_attr_in##id##_input.dev_attr, \
                                &sensor_dev_attr_in##id##_min.dev_attr, \
@@ -464,7 +464,7 @@ struct str_device_attr_table {
 };
 
 static struct str_device_attr_table cfg_info_temp[] = {
-       { &dev_attr_temp1_input, &dev_attr_temp1_min, &dev_attr_temp1_max },
+       { &dev_attr_temp1_input, &dev_attr_temp1_max_hyst, &dev_attr_temp1_max },
        CFG_INFO_TEMP(2),
        CFG_INFO_TEMP(3),
        CFG_INFO_TEMP(4),
index 557114872f3c99478692bbb64ebdb9d427b999a8..64c1f8af5bb29005a675760a2b9ca74611591fa6 100644 (file)
@@ -95,11 +95,16 @@ MODULE_PARM_DESC(init, "Set to zero to bypass chip initialization");
                                                     (0x39)))
 
 #define W83781D_REG_CONFIG             0x40
+
+/* Interrupt status (W83781D, AS99127F) */
 #define W83781D_REG_ALARM1             0x41
 #define W83781D_REG_ALARM2             0x42
-#define W83781D_REG_ALARM3             0x450   /* not on W83781D */
 
-#define W83781D_REG_IRQ                        0x4C
+/* Real-time status (W83782D, W83783S, W83627HF) */
+#define W83782D_REG_ALARM1             0x459
+#define W83782D_REG_ALARM2             0x45A
+#define W83782D_REG_ALARM3             0x45B
+
 #define W83781D_REG_BEEP_CONFIG                0x4D
 #define W83781D_REG_BEEP_INTS1         0x56
 #define W83781D_REG_BEEP_INTS2         0x57
@@ -1513,15 +1518,6 @@ w83781d_init_client(struct i2c_client *client)
                                        W83781D_REG_TEMP3_CONFIG, tmp & 0xfe);
                        }
                }
-
-               if (type != w83781d) {
-                       /* enable comparator mode for temp2 and temp3 so
-                          alarm indication will work correctly */
-                       i = w83781d_read_value(client, W83781D_REG_IRQ);
-                       if (!(i & 0x40))
-                               w83781d_write_value(client, W83781D_REG_IRQ,
-                                                   i | 0x40);
-               }
        }
 
        /* Start monitoring */
@@ -1612,14 +1608,25 @@ static struct w83781d_data *w83781d_update_device(struct device *dev)
                        data->fan_div[1] |= (i >> 4) & 0x04;
                        data->fan_div[2] |= (i >> 5) & 0x04;
                }
-               data->alarms =
-                   w83781d_read_value(client,
-                                      W83781D_REG_ALARM1) +
-                   (w83781d_read_value(client, W83781D_REG_ALARM2) << 8);
                if ((data->type == w83782d) || (data->type == w83627hf)) {
-                       data->alarms |=
-                           w83781d_read_value(client,
-                                              W83781D_REG_ALARM3) << 16;
+                       data->alarms = w83781d_read_value(client,
+                                               W83782D_REG_ALARM1)
+                                    | (w83781d_read_value(client,
+                                               W83782D_REG_ALARM2) << 8)
+                                    | (w83781d_read_value(client,
+                                               W83782D_REG_ALARM3) << 16);
+               } else if (data->type == w83783s) {
+                       data->alarms = w83781d_read_value(client,
+                                               W83782D_REG_ALARM1)
+                                    | (w83781d_read_value(client,
+                                               W83782D_REG_ALARM2) << 8);
+               } else {
+                       /* No real-time status registers, fall back to
+                          interrupt status registers */
+                       data->alarms = w83781d_read_value(client,
+                                               W83781D_REG_ALARM1)
+                                    | (w83781d_read_value(client,
+                                               W83781D_REG_ALARM2) << 8);
                }
                i = w83781d_read_value(client, W83781D_REG_BEEP_INTS2);
                data->beep_enable = i >> 7;
index 9f2ffef4d81204a3a0f3f11876188d0ba06b4e94..4344ae6b1fcbe7ccbde18777cd5ffed725b42c3a 100644 (file)
@@ -72,16 +72,6 @@ static ssize_t show_adapter_name(struct device *dev,
 }
 static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL);
 
-static int i2c_isa_device_probe(struct device *dev)
-{
-       return -ENODEV;
-}
-
-static int i2c_isa_device_remove(struct device *dev)
-{
-       return 0;
-}
-
 
 /* We implement an interface which resembles i2c_{add,del}_driver,
    but for i2c-isa drivers. We don't have to remember and handle lists
@@ -93,8 +83,6 @@ int i2c_isa_add_driver(struct i2c_driver *driver)
 
        /* Add the driver to the list of i2c drivers in the driver core */
        driver->driver.bus = &i2c_bus_type;
-       driver->driver.probe = i2c_isa_device_probe;
-       driver->driver.remove = i2c_isa_device_remove;
        res = driver_register(&driver->driver);
        if (res)
                return res;
index 9834dce4e20fa93715c62f63f8d457eed6510ce5..0606bd2f6020fe7c3a3fc2485cf05e7893880fc1 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/kernel.h>
 #include <linux/timer.h>
 #include <linux/mm.h>
+#include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/major.h>
 #include <linux/errno.h>
@@ -314,6 +315,8 @@ static void ide_pio_datablock(ide_drive_t *drive, struct request *rq,
        if (rq->bio)    /* fs request */
                rq->errors = 0;
 
+       touch_softlockup_watchdog();
+
        switch (drive->hwif->data_phase) {
        case TASKFILE_MULTI_IN:
        case TASKFILE_MULTI_OUT:
index d393b504bf26b23ffafc069e92a07bf485ffd3f4..c82f47a66e48f8ee4d1f48bb80c9eec220bc37c8 100644 (file)
@@ -665,7 +665,15 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
        struct ib_wc mad_wc;
        struct ib_send_wr *send_wr = &mad_send_wr->send_wr;
 
-       if (!smi_handle_dr_smp_send(smp, device->node_type, port_num)) {
+       /*
+        * Directed route handling starts if the initial LID routed part of
+        * a request or the ending LID routed part of a response is empty.
+        * If we are at the start of the LID routed part, don't update the
+        * hop_ptr or hop_cnt.  See section 14.2.2, Vol 1 IB spec.
+        */
+       if ((ib_get_smp_direction(smp) ? smp->dr_dlid : smp->dr_slid) ==
+            IB_LID_PERMISSIVE &&
+           !smi_handle_dr_smp_send(smp, device->node_type, port_num)) {
                ret = -EINVAL;
                printk(KERN_ERR PFX "Invalid directed route\n");
                goto out;
index f9b9b93dc5016b9fcaa28ff1b7b9e33da28060c9..2825615ce81c3cd440247a500eedc7111e36871a 100644 (file)
@@ -1029,25 +1029,6 @@ int mthca_QUERY_DEV_LIM(struct mthca_dev *dev,
        MTHCA_GET(size, outbox, QUERY_DEV_LIM_UAR_ENTRY_SZ_OFFSET);
        dev_lim->uar_scratch_entry_sz = size;
 
-       mthca_dbg(dev, "Max QPs: %d, reserved QPs: %d, entry size: %d\n",
-                 dev_lim->max_qps, dev_lim->reserved_qps, dev_lim->qpc_entry_sz);
-       mthca_dbg(dev, "Max SRQs: %d, reserved SRQs: %d, entry size: %d\n",
-                 dev_lim->max_srqs, dev_lim->reserved_srqs, dev_lim->srq_entry_sz);
-       mthca_dbg(dev, "Max CQs: %d, reserved CQs: %d, entry size: %d\n",
-                 dev_lim->max_cqs, dev_lim->reserved_cqs, dev_lim->cqc_entry_sz);
-       mthca_dbg(dev, "Max EQs: %d, reserved EQs: %d, entry size: %d\n",
-                 dev_lim->max_eqs, dev_lim->reserved_eqs, dev_lim->eqc_entry_sz);
-       mthca_dbg(dev, "reserved MPTs: %d, reserved MTTs: %d\n",
-                 dev_lim->reserved_mrws, dev_lim->reserved_mtts);
-       mthca_dbg(dev, "Max PDs: %d, reserved PDs: %d, reserved UARs: %d\n",
-                 dev_lim->max_pds, dev_lim->reserved_pds, dev_lim->reserved_uars);
-       mthca_dbg(dev, "Max QP/MCG: %d, reserved MGMs: %d\n",
-                 dev_lim->max_pds, dev_lim->reserved_mgms);
-       mthca_dbg(dev, "Max CQEs: %d, max WQEs: %d, max SRQ WQEs: %d\n",
-                 dev_lim->max_cq_sz, dev_lim->max_qp_sz, dev_lim->max_srq_sz);
-
-       mthca_dbg(dev, "Flags: %08x\n", dev_lim->flags);
-
        if (mthca_is_memfree(dev)) {
                MTHCA_GET(field, outbox, QUERY_DEV_LIM_MAX_SRQ_SZ_OFFSET);
                dev_lim->max_srq_sz = 1 << field;
@@ -1093,6 +1074,25 @@ int mthca_QUERY_DEV_LIM(struct mthca_dev *dev,
                dev_lim->mpt_entry_sz = MTHCA_MPT_ENTRY_SIZE;
        }
 
+       mthca_dbg(dev, "Max QPs: %d, reserved QPs: %d, entry size: %d\n",
+                 dev_lim->max_qps, dev_lim->reserved_qps, dev_lim->qpc_entry_sz);
+       mthca_dbg(dev, "Max SRQs: %d, reserved SRQs: %d, entry size: %d\n",
+                 dev_lim->max_srqs, dev_lim->reserved_srqs, dev_lim->srq_entry_sz);
+       mthca_dbg(dev, "Max CQs: %d, reserved CQs: %d, entry size: %d\n",
+                 dev_lim->max_cqs, dev_lim->reserved_cqs, dev_lim->cqc_entry_sz);
+       mthca_dbg(dev, "Max EQs: %d, reserved EQs: %d, entry size: %d\n",
+                 dev_lim->max_eqs, dev_lim->reserved_eqs, dev_lim->eqc_entry_sz);
+       mthca_dbg(dev, "reserved MPTs: %d, reserved MTTs: %d\n",
+                 dev_lim->reserved_mrws, dev_lim->reserved_mtts);
+       mthca_dbg(dev, "Max PDs: %d, reserved PDs: %d, reserved UARs: %d\n",
+                 dev_lim->max_pds, dev_lim->reserved_pds, dev_lim->reserved_uars);
+       mthca_dbg(dev, "Max QP/MCG: %d, reserved MGMs: %d\n",
+                 dev_lim->max_pds, dev_lim->reserved_mgms);
+       mthca_dbg(dev, "Max CQEs: %d, max WQEs: %d, max SRQ WQEs: %d\n",
+                 dev_lim->max_cq_sz, dev_lim->max_qp_sz, dev_lim->max_srq_sz);
+
+       mthca_dbg(dev, "Flags: %08x\n", dev_lim->flags);
+
 out:
        mthca_free_mailbox(dev, mailbox);
        return err;
index 2a165fd06e57085a569f5787a0788f5401e5b237..e481037288d61cbb642890754f999a965f9db5be 100644 (file)
@@ -53,8 +53,8 @@
 
 #define DRV_NAME       "ib_mthca"
 #define PFX            DRV_NAME ": "
-#define DRV_VERSION    "0.06"
-#define DRV_RELDATE    "June 23, 2005"
+#define DRV_VERSION    "0.07"
+#define DRV_RELDATE    "February 13, 2006"
 
 enum {
        MTHCA_FLAG_DDR_HIDDEN = 1 << 1,
index e0a5412b7e68042f820a0c6c32261eba3f39d23c..2f85a9a831b1a6b5787b58326270cd7f45c3e570 100644 (file)
@@ -78,6 +78,7 @@ enum {
        IPOIB_FLAG_SUBINTERFACE   = 4,
        IPOIB_MCAST_RUN           = 5,
        IPOIB_STOP_REAPER         = 6,
+       IPOIB_MCAST_STARTED       = 7,
 
        IPOIB_MAX_BACKOFF_SECONDS = 16,
 
index ccaa0c387076e8b0a36dc90dbb830528b09b93da..a2408d7ec5986cb3e69b3988f9a6c5a35fbf118f 100644 (file)
@@ -533,8 +533,10 @@ void ipoib_mcast_join_task(void *dev_ptr)
        }
 
        if (!priv->broadcast) {
-               priv->broadcast = ipoib_mcast_alloc(dev, 1);
-               if (!priv->broadcast) {
+               struct ipoib_mcast *broadcast;
+
+               broadcast = ipoib_mcast_alloc(dev, 1);
+               if (!broadcast) {
                        ipoib_warn(priv, "failed to allocate broadcast group\n");
                        mutex_lock(&mcast_mutex);
                        if (test_bit(IPOIB_MCAST_RUN, &priv->flags))
@@ -544,10 +546,11 @@ void ipoib_mcast_join_task(void *dev_ptr)
                        return;
                }
 
-               memcpy(priv->broadcast->mcmember.mgid.raw, priv->dev->broadcast + 4,
+               spin_lock_irq(&priv->lock);
+               memcpy(broadcast->mcmember.mgid.raw, priv->dev->broadcast + 4,
                       sizeof (union ib_gid));
+               priv->broadcast = broadcast;
 
-               spin_lock_irq(&priv->lock);
                __ipoib_mcast_add(dev, priv->broadcast);
                spin_unlock_irq(&priv->lock);
        }
@@ -601,6 +604,10 @@ int ipoib_mcast_start_thread(struct net_device *dev)
                queue_work(ipoib_workqueue, &priv->mcast_task);
        mutex_unlock(&mcast_mutex);
 
+       spin_lock_irq(&priv->lock);
+       set_bit(IPOIB_MCAST_STARTED, &priv->flags);
+       spin_unlock_irq(&priv->lock);
+
        return 0;
 }
 
@@ -611,6 +618,10 @@ int ipoib_mcast_stop_thread(struct net_device *dev, int flush)
 
        ipoib_dbg_mcast(priv, "stopping multicast thread\n");
 
+       spin_lock_irq(&priv->lock);
+       clear_bit(IPOIB_MCAST_STARTED, &priv->flags);
+       spin_unlock_irq(&priv->lock);
+
        mutex_lock(&mcast_mutex);
        clear_bit(IPOIB_MCAST_RUN, &priv->flags);
        cancel_delayed_work(&priv->mcast_task);
@@ -693,6 +704,14 @@ void ipoib_mcast_send(struct net_device *dev, union ib_gid *mgid,
         */
        spin_lock(&priv->lock);
 
+       if (!test_bit(IPOIB_MCAST_STARTED, &priv->flags)        ||
+           !priv->broadcast                                    ||
+           !test_bit(IPOIB_MCAST_FLAG_ATTACHED, &priv->broadcast->flags)) {
+               ++priv->stats.tx_dropped;
+               dev_kfree_skb_any(skb);
+               goto unlock;
+       }
+
        mcast = __ipoib_mcast_find(dev, mgid);
        if (!mcast) {
                /* Let's create a new send only group now */
@@ -754,6 +773,7 @@ out:
                ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN);
        }
 
+unlock:
        spin_unlock(&priv->lock);
 }
 
index 6e0afbb223832e3b1b038aee8d949adcc9eb441b..2708167ba17585c062a74d7d7e5ac7946da99ad2 100644 (file)
@@ -11,7 +11,6 @@ obj-$(CONFIG_KEYBOARD_XTKBD)          += xtkbd.o
 obj-$(CONFIG_KEYBOARD_AMIGA)           += amikbd.o
 obj-$(CONFIG_KEYBOARD_LOCOMO)          += locomokbd.o
 obj-$(CONFIG_KEYBOARD_NEWTON)          += newtonkbd.o
-obj-$(CONFIG_KEYBOARD_98KBD)           += 98kbd.o
 obj-$(CONFIG_KEYBOARD_CORGI)           += corgikbd.o
 obj-$(CONFIG_KEYBOARD_SPITZ)           += spitzkbd.o
 obj-$(CONFIG_KEYBOARD_HIL)             += hil_kbd.o
index 184c4129470db801c2146d485ca98a95ac50b0fd..415c49178985d6fe0f4547e3457f090d4a18820a 100644 (file)
@@ -7,7 +7,6 @@
 obj-$(CONFIG_INPUT_SPARCSPKR)          += sparcspkr.o
 obj-$(CONFIG_INPUT_PCSPKR)             += pcspkr.o
 obj-$(CONFIG_INPUT_M68K_BEEP)          += m68kspkr.o
-obj-$(CONFIG_INPUT_98SPKR)             += 98spkr.o
 obj-$(CONFIG_INPUT_UINPUT)             += uinput.o
 obj-$(CONFIG_INPUT_WISTRON_BTNS)       += wistron_btns.o
 obj-$(CONFIG_HP_SDC_RTC)               += hp_sdc_rtc.o
index d448bb5e48697ca59a17c75bc8cf228b39b4746a..3a6ae85cd69c718407fe7e991181fc711c85fa23 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/input.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
+#include <linux/interrupt.h>
 #include <asm/hardware.h>
 
 MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
index c88520d3d13cadc2c6b03819ab2ff9ade3861dd5..40333d61093c805383ed3f7ae245dfdd12a51f95 100644 (file)
@@ -232,6 +232,7 @@ static struct ps2pp_info *get_model_info(unsigned char model)
                { 88,   PS2PP_KIND_WHEEL,       PS2PP_WHEEL },
                { 96,   0,                      0 },
                { 97,   PS2PP_KIND_TP3,         PS2PP_WHEEL | PS2PP_HWHEEL },
+               { 99,   PS2PP_KIND_WHEEL,       PS2PP_WHEEL },
                { 100,  PS2PP_KIND_MX,                                  /* MX510 */
                                PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN |
                                PS2PP_EXTRA_BTN | PS2PP_NAV_BTN },
index b4898d8a68e21e14769c312e770048e16f28e2a6..6d9ec9ab1b9069d2b050a2a5d350e7ea09c00cb8 100644 (file)
@@ -68,15 +68,19 @@ struct trackpoint_attr_data {
        size_t field_offset;
        unsigned char command;
        unsigned char mask;
+       unsigned char inverted;
 };
 
 static ssize_t trackpoint_show_int_attr(struct psmouse *psmouse, void *data, char *buf)
 {
        struct trackpoint_data *tp = psmouse->private;
        struct trackpoint_attr_data *attr = data;
-       unsigned char *field = (unsigned char *)((char *)tp + attr->field_offset);
+       unsigned char value = *(unsigned char *)((char *)tp + attr->field_offset);
+
+       if (attr->inverted)
+               value = !value;
 
-       return sprintf(buf, "%u\n", *field);
+       return sprintf(buf, "%u\n", value);
 }
 
 static ssize_t trackpoint_set_int_attr(struct psmouse *psmouse, void *data,
@@ -120,6 +124,9 @@ static ssize_t trackpoint_set_bit_attr(struct psmouse *psmouse, void *data,
        if (*rest || value > 1)
                return -EINVAL;
 
+       if (attr->inverted)
+               value = !value;
+
        if (*field != value) {
                *field = value;
                trackpoint_toggle_bit(&psmouse->ps2dev, attr->command, attr->mask);
@@ -129,11 +136,12 @@ static ssize_t trackpoint_set_bit_attr(struct psmouse *psmouse, void *data,
 }
 
 
-#define TRACKPOINT_BIT_ATTR(_name, _command, _mask)                            \
+#define TRACKPOINT_BIT_ATTR(_name, _command, _mask, _inv)                              \
        static struct trackpoint_attr_data trackpoint_attr_##_name = {          \
                .field_offset   = offsetof(struct trackpoint_data, _name),      \
                .command        = _command,                                     \
                .mask           = _mask,                                        \
+               .inverted       = _inv,                                         \
        };                                                                      \
        PSMOUSE_DEFINE_ATTR(_name, S_IWUSR | S_IRUGO,                           \
                            &trackpoint_attr_##_name,                           \
@@ -150,9 +158,9 @@ TRACKPOINT_INT_ATTR(upthresh, TP_UP_THRESH);
 TRACKPOINT_INT_ATTR(ztime, TP_Z_TIME);
 TRACKPOINT_INT_ATTR(jenks, TP_JENKS_CURV);
 
-TRACKPOINT_BIT_ATTR(press_to_select, TP_TOGGLE_PTSON, TP_MASK_PTSON);
-TRACKPOINT_BIT_ATTR(skipback, TP_TOGGLE_SKIPBACK, TP_MASK_SKIPBACK);
-TRACKPOINT_BIT_ATTR(ext_dev, TP_TOGGLE_EXT_DEV, TP_MASK_EXT_DEV);
+TRACKPOINT_BIT_ATTR(press_to_select, TP_TOGGLE_PTSON, TP_MASK_PTSON, 0);
+TRACKPOINT_BIT_ATTR(skipback, TP_TOGGLE_SKIPBACK, TP_MASK_SKIPBACK, 0);
+TRACKPOINT_BIT_ATTR(ext_dev, TP_TOGGLE_EXT_DEV, TP_MASK_EXT_DEV, 1);
 
 static struct attribute *trackpoint_attrs[] = {
        &psmouse_attr_sensitivity.dattr.attr,
index 9857d8b6ad66520fe71d0e7b0ed8476cd0417479..050298b1a09d214b6ecf2bd7ffa09255d86364e5 100644 (file)
@@ -78,7 +78,7 @@
 
 #define TP_TOGGLE_MB           0x23    /* Disable/Enable Middle Button */
 #define TP_MASK_MB                     0x01
-#define TP_TOGGLE_EXT_DEV      0x23    /* Toggle external device */
+#define TP_TOGGLE_EXT_DEV      0x23    /* Disable external device */
 #define TP_MASK_EXT_DEV                        0x02
 #define TP_TOGGLE_DRIFT                0x23    /* Drift Correction */
 #define TP_MASK_DRIFT                  0x80
 #define TP_DEF_MB              0x00
 #define TP_DEF_PTSON           0x00
 #define TP_DEF_SKIPBACK                0x00
-#define TP_DEF_EXT_DEV         0x01
+#define TP_DEF_EXT_DEV         0x00    /* 0 means enabled */
 
 #define MAKE_PS2_CMD(params, results, cmd) ((params<<12) | (results<<8) | (cmd))
 
index 678a8599f9ffb7bb6a12518fd4a3176ad3a31578..4155197867a33be98b0f106cff9eb243c2e98440 100644 (file)
@@ -13,7 +13,6 @@ obj-$(CONFIG_SERIO_RPCKBD)    += rpckbd.o
 obj-$(CONFIG_SERIO_SA1111)     += sa1111ps2.o
 obj-$(CONFIG_SERIO_AMBAKMI)    += ambakmi.o
 obj-$(CONFIG_SERIO_Q40KBD)     += q40kbd.o
-obj-$(CONFIG_SERIO_98KBD)      += 98kbd-io.o
 obj-$(CONFIG_SERIO_GSCPS2)     += gscps2.o
 obj-$(CONFIG_HP_SDC)           += hp_sdc.o
 obj-$(CONFIG_HIL_MLC)          += hp_sdc_mlc.o hil_mlc.o
index b45a45ca7cc961c6152cb702cde8ae768b8b156e..8c12a974b411a75093c2f65319b4c88761bc5dd7 100644 (file)
 
 #define        TS_POLL_PERIOD  msecs_to_jiffies(10)
 
+/* this driver doesn't aim at the peak continuous sample rate */
+#define        SAMPLE_BITS     (8 /*cmd*/ + 16 /*sample*/ + 2 /* before, after */)
+
 struct ts_event {
        /* For portability, we can't read 12 bit values using SPI (which
         * would make the controller deliver them as native byteorder u16
-        * with msbs zeroed).  Instead, we read them as two 8-byte values,
+        * with msbs zeroed).  Instead, we read them as two 8-bit values,
         * which need byteswapping then range adjustment.
         */
        __be16 x;
@@ -60,7 +63,7 @@ struct ts_event {
 };
 
 struct ads7846 {
-       struct input_dev        input;
+       struct input_dev        *input;
        char                    phys[32];
 
        struct spi_device       *spi;
@@ -68,6 +71,7 @@ struct ads7846 {
        u16                     vref_delay_usecs;
        u16                     x_plate_ohms;
 
+       u8                      read_x, read_y, read_z1, read_z2;
        struct ts_event         tc;
 
        struct spi_transfer     xfer[8];
@@ -117,10 +121,10 @@ struct ads7846 {
 #define        READ_12BIT_DFR(x) (ADS_START | ADS_A2A1A0_d_ ## x \
        | ADS_12_BIT | ADS_DFR)
 
-static const u8        read_y  = READ_12BIT_DFR(y)  | ADS_PD10_ADC_ON;
-static const u8        read_z1 = READ_12BIT_DFR(z1) | ADS_PD10_ADC_ON;
-static const u8        read_z2 = READ_12BIT_DFR(z2) | ADS_PD10_ADC_ON;
-static const u8        read_x  = READ_12BIT_DFR(x)  | ADS_PD10_PDOWN;  /* LAST */
+#define        READ_Y  (READ_12BIT_DFR(y)  | ADS_PD10_ADC_ON)
+#define        READ_Z1 (READ_12BIT_DFR(z1) | ADS_PD10_ADC_ON)
+#define        READ_Z2 (READ_12BIT_DFR(z2) | ADS_PD10_ADC_ON)
+#define        READ_X  (READ_12BIT_DFR(x)  | ADS_PD10_PDOWN)   /* LAST */
 
 /* single-ended samples need to first power up reference voltage;
  * we leave both ADC and VREF powered
@@ -128,8 +132,8 @@ static const u8     read_x  = READ_12BIT_DFR(x)  | ADS_PD10_PDOWN;  /* LAST */
 #define        READ_12BIT_SER(x) (ADS_START | ADS_A2A1A0_ ## x \
        | ADS_12_BIT | ADS_SER)
 
-static const u8        ref_on = READ_12BIT_DFR(x) | ADS_PD10_ALL_ON;
-static const u8        ref_off = READ_12BIT_DFR(y) | ADS_PD10_PDOWN;
+#define        REF_ON  (READ_12BIT_DFR(x) | ADS_PD10_ALL_ON)
+#define        REF_OFF (READ_12BIT_DFR(y) | ADS_PD10_PDOWN)
 
 /*--------------------------------------------------------------------------*/
 
@@ -138,7 +142,9 @@ static const u8     ref_off = READ_12BIT_DFR(y) | ADS_PD10_PDOWN;
  */
 
 struct ser_req {
+       u8                      ref_on;
        u8                      command;
+       u8                      ref_off;
        u16                     scratch;
        __be16                  sample;
        struct spi_message      msg;
@@ -152,7 +158,7 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
        struct ser_req          *req = kzalloc(sizeof *req, SLAB_KERNEL);
        int                     status;
        int                     sample;
-       int                     i;
+       int                     i;
 
        if (!req)
                return -ENOMEM;
@@ -160,7 +166,8 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
        INIT_LIST_HEAD(&req->msg.transfers);
 
        /* activate reference, so it has time to settle; */
-       req->xfer[0].tx_buf = &ref_on;
+       req->ref_on = REF_ON;
+       req->xfer[0].tx_buf = &req->ref_on;
        req->xfer[0].len = 1;
        req->xfer[1].rx_buf = &req->scratch;
        req->xfer[1].len = 2;
@@ -182,7 +189,8 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
        /* REVISIT:  take a few more samples, and compare ... */
 
        /* turn off reference */
-       req->xfer[4].tx_buf = &ref_off;
+       req->ref_off = REF_OFF;
+       req->xfer[4].tx_buf = &req->ref_off;
        req->xfer[4].len = 1;
        req->xfer[5].rx_buf = &req->scratch;
        req->xfer[5].len = 2;
@@ -236,11 +244,12 @@ SHOW(vbatt)
 
 static void ads7846_rx(void *ads)
 {
-       struct ads7846  *ts = ads;
-       unsigned        Rt;
-       unsigned        sync = 0;
-       u16             x, y, z1, z2;
-       unsigned long   flags;
+       struct ads7846          *ts = ads;
+       struct input_dev        *input_dev = ts->input;
+       unsigned                Rt;
+       unsigned                sync = 0;
+       u16                     x, y, z1, z2;
+       unsigned long           flags;
 
        /* adjust:  12 bit samples (left aligned), built from
         * two 8 bit values writen msb-first.
@@ -276,21 +285,21 @@ static void ads7846_rx(void *ads)
         * won't notice that, even if nPENIRQ never fires ...
         */
        if (!ts->pendown && Rt != 0) {
-               input_report_key(&ts->input, BTN_TOUCH, 1);
+               input_report_key(input_dev, BTN_TOUCH, 1);
                sync = 1;
        } else if (ts->pendown && Rt == 0) {
-               input_report_key(&ts->input, BTN_TOUCH, 0);
+               input_report_key(input_dev, BTN_TOUCH, 0);
                sync = 1;
        }
 
        if (Rt) {
-               input_report_abs(&ts->input, ABS_X, x);
-               input_report_abs(&ts->input, ABS_Y, y);
-               input_report_abs(&ts->input, ABS_PRESSURE, Rt);
+               input_report_abs(input_dev, ABS_X, x);
+               input_report_abs(input_dev, ABS_Y, y);
+               input_report_abs(input_dev, ABS_PRESSURE, Rt);
                sync = 1;
        }
        if (sync)
-               input_sync(&ts->input);
+               input_sync(input_dev);
 
 #ifdef VERBOSE
        if (Rt || ts->pendown)
@@ -396,9 +405,10 @@ static int ads7846_resume(struct spi_device *spi)
 static int __devinit ads7846_probe(struct spi_device *spi)
 {
        struct ads7846                  *ts;
+       struct input_dev                *input_dev;
        struct ads7846_platform_data    *pdata = spi->dev.platform_data;
        struct spi_transfer             *x;
-       int                             i;
+       int                             err;
 
        if (!spi->irq) {
                dev_dbg(&spi->dev, "no IRQ?\n");
@@ -411,9 +421,9 @@ static int __devinit ads7846_probe(struct spi_device *spi)
        }
 
        /* don't exceed max specified sample rate */
-       if (spi->max_speed_hz > (125000 * 16)) {
+       if (spi->max_speed_hz > (125000 * SAMPLE_BITS)) {
                dev_dbg(&spi->dev, "f(sample) %d KHz?\n",
-                               (spi->max_speed_hz/16)/1000);
+                               (spi->max_speed_hz/SAMPLE_BITS)/1000);
                return -EINVAL;
        }
 
@@ -423,13 +433,18 @@ static int __devinit ads7846_probe(struct spi_device *spi)
         * to discard the four garbage LSBs.
         */
 
-       if (!(ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL)))
-               return -ENOMEM;
+       ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL);
+       input_dev = input_allocate_device();
+       if (!ts || !input_dev) {
+               err = -ENOMEM;
+               goto err_free_mem;
+       }
 
        dev_set_drvdata(&spi->dev, ts);
+       spi->dev.power.power_state = PMSG_ON;
 
        ts->spi = spi;
-       spi->dev.power.power_state = PMSG_ON;
+       ts->input = input_dev;
 
        init_timer(&ts->timer);
        ts->timer.data = (unsigned long) ts;
@@ -439,70 +454,80 @@ static int __devinit ads7846_probe(struct spi_device *spi)
        ts->vref_delay_usecs = pdata->vref_delay_usecs ? : 100;
        ts->x_plate_ohms = pdata->x_plate_ohms ? : 400;
 
-       init_input_dev(&ts->input);
+       snprintf(ts->phys, sizeof(ts->phys), "%s/input0", spi->dev.bus_id);
 
-       ts->input.dev = &spi->dev;
-       ts->input.name = "ADS784x Touchscreen";
-       snprintf(ts->phys, sizeof ts->phys, "%s/input0", spi->dev.bus_id);
-       ts->input.phys = ts->phys;
+       input_dev->name = "ADS784x Touchscreen";
+       input_dev->phys = ts->phys;
+       input_dev->cdev.dev = &spi->dev;
 
-       ts->input.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       ts->input.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
-       input_set_abs_params(&ts->input, ABS_X,
+       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       input_set_abs_params(input_dev, ABS_X,
                        pdata->x_min ? : 0,
                        pdata->x_max ? : MAX_12BIT,
                        0, 0);
-       input_set_abs_params(&ts->input, ABS_Y,
+       input_set_abs_params(input_dev, ABS_Y,
                        pdata->y_min ? : 0,
                        pdata->y_max ? : MAX_12BIT,
                        0, 0);
-       input_set_abs_params(&ts->input, ABS_PRESSURE,
+       input_set_abs_params(input_dev, ABS_PRESSURE,
                        pdata->pressure_min, pdata->pressure_max, 0, 0);
 
-       input_register_device(&ts->input);
-
        /* set up the transfers to read touchscreen state; this assumes we
         * use formula #2 for pressure, not #3.
         */
+       INIT_LIST_HEAD(&ts->msg.transfers);
        x = ts->xfer;
 
        /* y- still on; turn on only y+ (and ADC) */
-       x->tx_buf = &read_y;
+       ts->read_y = READ_Y;
+       x->tx_buf = &ts->read_y;
        x->len = 1;
+       spi_message_add_tail(x, &ts->msg);
+
        x++;
        x->rx_buf = &ts->tc.y;
        x->len = 2;
-       x++;
+       spi_message_add_tail(x, &ts->msg);
 
        /* turn y+ off, x- on; we'll use formula #2 */
        if (ts->model == 7846) {
-               x->tx_buf = &read_z1;
+               x++;
+               ts->read_z1 = READ_Z1;
+               x->tx_buf = &ts->read_z1;
                x->len = 1;
+               spi_message_add_tail(x, &ts->msg);
+
                x++;
                x->rx_buf = &ts->tc.z1;
                x->len = 2;
-               x++;
+               spi_message_add_tail(x, &ts->msg);
 
-               x->tx_buf = &read_z2;
+               x++;
+               ts->read_z2 = READ_Z2;
+               x->tx_buf = &ts->read_z2;
                x->len = 1;
+               spi_message_add_tail(x, &ts->msg);
+
                x++;
                x->rx_buf = &ts->tc.z2;
                x->len = 2;
-               x++;
+               spi_message_add_tail(x, &ts->msg);
        }
 
        /* turn y- off, x+ on, then leave in lowpower */
-       x->tx_buf = &read_x;
+       x++;
+       ts->read_x = READ_X;
+       x->tx_buf = &ts->read_x;
        x->len = 1;
+       spi_message_add_tail(x, &ts->msg);
+
        x++;
        x->rx_buf = &ts->tc.x;
        x->len = 2;
-       x++;
-
-       CS_CHANGE(x[-1]);
+       CS_CHANGE(*x);
+       spi_message_add_tail(x, &ts->msg);
 
-       for (i = 0; i < x - ts->xfer; i++)
-               spi_message_add_tail(&ts->xfer[i], &ts->msg);
        ts->msg.complete = ads7846_rx;
        ts->msg.context = ts;
 
@@ -510,9 +535,8 @@ static int __devinit ads7846_probe(struct spi_device *spi)
                        SA_SAMPLE_RANDOM | SA_TRIGGER_FALLING,
                        spi->dev.bus_id, ts)) {
                dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq);
-               input_unregister_device(&ts->input);
-               kfree(ts);
-               return -EBUSY;
+               err = -EBUSY;
+               goto err_free_mem;
        }
 
        dev_info(&spi->dev, "touchscreen, irq %d\n", spi->irq);
@@ -534,7 +558,18 @@ static int __devinit ads7846_probe(struct spi_device *spi)
                device_create_file(&spi->dev, &dev_attr_vbatt);
        device_create_file(&spi->dev, &dev_attr_vaux);
 
+       err = input_register_device(input_dev);
+       if (err)
+               goto err_free_irq;
+
        return 0;
+
+ err_free_irq:
+       free_irq(spi->irq, ts);
+ err_free_mem:
+       input_free_device(input_dev);
+       kfree(ts);
+       return err;
 }
 
 static int __devexit ads7846_remove(struct spi_device *spi)
@@ -554,7 +589,7 @@ static int __devexit ads7846_remove(struct spi_device *spi)
                device_remove_file(&spi->dev, &dev_attr_vbatt);
        device_remove_file(&spi->dev, &dev_attr_vaux);
 
-       input_unregister_device(&ts->input);
+       input_unregister_device(ts->input);
        kfree(ts);
 
        dev_dbg(&spi->dev, "unregistered touchscreen\n");
index f190a99604f0c3821c9e97e865819e4d89dfc144..393633681f49fa852ac549b2aeb48fc4d9ebf07d 100644 (file)
@@ -2359,8 +2359,8 @@ isdn_tty_at_cout(char *msg, modem_info * info)
 
        /* use queue instead of direct, if online and */
        /* data is in queue or buffer is full */
-       if ((info->online && tty_buffer_request_room(tty, l) < l) ||
-           (!skb_queue_empty(&dev->drv[info->isdn_driver]->rpqueue[info->isdn_channel]))) {
+       if (info->online && ((tty_buffer_request_room(tty, l) < l) ||
+           !skb_queue_empty(&dev->drv[info->isdn_driver]->rpqueue[info->isdn_channel]))) {
                skb = alloc_skb(l, GFP_ATOMIC);
                if (!skb) {
                        spin_unlock_irqrestore(&info->readlock, flags);
index 9a2c7605d49c930a45c10aaad9b3cc772dd2805e..642a61b6d0a4ebd3a89732c002a071dc633156ce 100644 (file)
@@ -452,8 +452,7 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply)
        } else if (func == MPI_FUNCTION_EVENT_ACK) {
                dprintk((MYIOC_s_INFO_FMT "mpt_base_reply, EventAck reply received\n",
                                ioc->name));
-       } else if (func == MPI_FUNCTION_CONFIG ||
-                  func == MPI_FUNCTION_TOOLBOX) {
+       } else if (func == MPI_FUNCTION_CONFIG) {
                CONFIGPARMS *pCfg;
                unsigned long flags;
 
@@ -5326,115 +5325,6 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
        return rc;
 }
 
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/**
- *     mpt_toolbox - Generic function to issue toolbox message
- *     @ioc - Pointer to an adapter structure
- *     @cfg - Pointer to a toolbox structure. Struct contains
- *             action, page address, direction, physical address
- *             and pointer to a configuration page header
- *             Page header is updated.
- *
- *     Returns 0 for success
- *     -EPERM if not allowed due to ISR context
- *     -EAGAIN if no msg frames currently available
- *     -EFAULT for non-successful reply or no reply (timeout)
- */
-int
-mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
-{
-       ToolboxIstwiReadWriteRequest_t  *pReq;
-       MPT_FRAME_HDR   *mf;
-       struct pci_dev  *pdev;
-       unsigned long    flags;
-       int              rc;
-       u32              flagsLength;
-       int              in_isr;
-
-       /*      Prevent calling wait_event() (below), if caller happens
-        *      to be in ISR context, because that is fatal!
-        */
-       in_isr = in_interrupt();
-       if (in_isr) {
-               dcprintk((MYIOC_s_WARN_FMT "toobox request not allowed in ISR context!\n",
-                               ioc->name));
-               return -EPERM;
-       }
-
-       /* Get and Populate a free Frame
-        */
-       if ((mf = mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) {
-               dcprintk((MYIOC_s_WARN_FMT "mpt_toolbox: no msg frames!\n",
-                               ioc->name));
-               return -EAGAIN;
-       }
-       pReq = (ToolboxIstwiReadWriteRequest_t  *)mf;
-       pReq->Tool = pCfg->action;
-       pReq->Reserved = 0;
-       pReq->ChainOffset = 0;
-       pReq->Function = MPI_FUNCTION_TOOLBOX;
-       pReq->Reserved1 = 0;
-       pReq->Reserved2 = 0;
-       pReq->MsgFlags = 0;
-       pReq->Flags = pCfg->dir;
-       pReq->BusNum = 0;
-       pReq->Reserved3 = 0;
-       pReq->NumAddressBytes = 0x01;
-       pReq->Reserved4 = 0;
-       pReq->DataLength = cpu_to_le16(0x04);
-       pdev = ioc->pcidev;
-       if (pdev->devfn & 1)
-               pReq->DeviceAddr = 0xB2;
-       else
-               pReq->DeviceAddr = 0xB0;
-       pReq->Addr1 = 0;
-       pReq->Addr2 = 0;
-       pReq->Addr3 = 0;
-       pReq->Reserved5 = 0;
-
-       /* Add a SGE to the config request.
-        */
-
-       flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ | 4;
-
-       mpt_add_sge((char *)&pReq->SGL, flagsLength, pCfg->physAddr);
-
-       dcprintk((MYIOC_s_INFO_FMT "Sending Toolbox request, Tool=%x\n",
-               ioc->name, pReq->Tool));
-
-       /* Append pCfg pointer to end of mf
-        */
-       *((void **) (((u8 *) mf) + (ioc->req_sz - sizeof(void *)))) =  (void *) pCfg;
-
-       /* Initalize the timer
-        */
-       init_timer(&pCfg->timer);
-       pCfg->timer.data = (unsigned long) ioc;
-       pCfg->timer.function = mpt_timer_expired;
-       pCfg->wait_done = 0;
-
-       /* Set the timer; ensure 10 second minimum */
-       if (pCfg->timeout < 10)
-               pCfg->timer.expires = jiffies + HZ*10;
-       else
-               pCfg->timer.expires = jiffies + HZ*pCfg->timeout;
-
-       /* Add to end of Q, set timer and then issue this command */
-       spin_lock_irqsave(&ioc->FreeQlock, flags);
-       list_add_tail(&pCfg->linkage, &ioc->configQ);
-       spin_unlock_irqrestore(&ioc->FreeQlock, flags);
-
-       add_timer(&pCfg->timer);
-       mpt_put_msg_frame(mpt_base_index, ioc, mf);
-       wait_event(mpt_waitq, pCfg->wait_done);
-
-       /* mf has been freed - do not access */
-
-       rc = pCfg->status;
-
-       return rc;
-}
-
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  *     mpt_timer_expired - Call back for timer process.
@@ -6142,7 +6032,7 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply
        if (ioc->events && (ioc->eventTypes & ( 1 << event))) {
                int idx;
 
-               idx = ioc->eventContext % ioc->eventLogSize;
+               idx = ioc->eventContext % MPTCTL_EVENT_LOG_SIZE;
 
                ioc->events[idx].event = event;
                ioc->events[idx].eventContext = ioc->eventContext;
@@ -6540,7 +6430,6 @@ EXPORT_SYMBOL(mpt_lan_index);
 EXPORT_SYMBOL(mpt_stm_index);
 EXPORT_SYMBOL(mpt_HardResetHandler);
 EXPORT_SYMBOL(mpt_config);
-EXPORT_SYMBOL(mpt_toolbox);
 EXPORT_SYMBOL(mpt_findImVolumes);
 EXPORT_SYMBOL(mpt_read_ioc_pg_3);
 EXPORT_SYMBOL(mpt_alloc_fw_memory);
index ea2649ecad1fcccb9f19e33cc8bf1cce9276bd96..723d543009530262d3f2bdbe68ea3486108856f5 100644 (file)
@@ -616,6 +616,7 @@ typedef struct _MPT_ADAPTER
         * increments by 32 bytes
         */
        int                      errata_flag_1064;
+       int                      aen_event_read_flag; /* flag to indicate event log was read*/
        u8                       FirstWhoInit;
        u8                       upload_fw;     /* If set, do a fw upload */
        u8                       reload_fw;     /* Force a FW Reload on next reset */
@@ -1026,7 +1027,6 @@ extern u32         mpt_GetIocState(MPT_ADAPTER *ioc, int cooked);
 extern void     mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buf, int *size, int len, int showlan);
 extern int      mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag);
 extern int      mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *cfg);
-extern int      mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *cfg);
 extern void     mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size);
 extern void     mpt_free_fw_memory(MPT_ADAPTER *ioc);
 extern int      mpt_findImVolumes(MPT_ADAPTER *ioc);
index bdf709987982b37509646e553f2482dd2d3d60c7..9b64e07400da464606d1153fce1f6c20f1eb7d4d 100644 (file)
@@ -136,6 +136,12 @@ static void mptctl_free_tm_flags(MPT_ADAPTER *ioc);
  */
 static int  mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase);
 
+/*
+ * Event Handler function
+ */
+static int mptctl_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);
+struct fasync_struct *async_queue=NULL;
+
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  * Scatter gather list (SGL) sizes and limits...
@@ -385,18 +391,18 @@ static int mptctl_bus_reset(MPT_IOCTL *ioctl)
        }
 
        /* Now wait for the command to complete */
-       ii = wait_event_interruptible_timeout(mptctl_wait,
+       ii = wait_event_timeout(mptctl_wait,
             ioctl->wait_done == 1,
             HZ*5 /* 5 second timeout */);
 
        if(ii <=0 && (ioctl->wait_done != 1 ))  {
+               mpt_free_msg_frame(hd->ioc, mf);
                ioctl->wait_done = 0;
                retval = -1; /* return failure */
        }
 
 mptctl_bus_reset_done:
 
-       mpt_free_msg_frame(hd->ioc, mf);
        mptctl_free_tm_flags(ioctl->ioc);
        return retval;
 }
@@ -471,6 +477,69 @@ mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
        return 1;
 }
 
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/* ASYNC Event Notification Support */
+static int
+mptctl_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
+{
+       u8 event;
+
+       event = le32_to_cpu(pEvReply->Event) & 0xFF;
+
+       dctlprintk(("%s() called\n", __FUNCTION__));
+       if(async_queue == NULL)
+               return 1;
+
+       /* Raise SIGIO for persistent events.
+        * TODO - this define is not in MPI spec yet,
+        * but they plan to set it to 0x21
+        */
+        if (event == 0x21 ) {
+               ioc->aen_event_read_flag=1;
+               dctlprintk(("Raised SIGIO to application\n"));
+               devtprintk(("Raised SIGIO to application\n"));
+               kill_fasync(&async_queue, SIGIO, POLL_IN);
+               return 1;
+        }
+
+       /* This flag is set after SIGIO was raised, and
+        * remains set until the application has read
+        * the event log via ioctl=MPTEVENTREPORT
+        */
+       if(ioc->aen_event_read_flag)
+               return 1;
+
+       /* Signal only for the events that are
+        * requested for by the application
+        */
+       if (ioc->events && (ioc->eventTypes & ( 1 << event))) {
+               ioc->aen_event_read_flag=1;
+               dctlprintk(("Raised SIGIO to application\n"));
+               devtprintk(("Raised SIGIO to application\n"));
+               kill_fasync(&async_queue, SIGIO, POLL_IN);
+       }
+       return 1;
+}
+
+static int
+mptctl_fasync(int fd, struct file *filep, int mode)
+{
+       MPT_ADAPTER     *ioc;
+
+       list_for_each_entry(ioc, &ioc_list, list)
+               ioc->aen_event_read_flag=0;
+
+       dctlprintk(("%s() called\n", __FUNCTION__));
+       return fasync_helper(fd, filep, mode, &async_queue);
+}
+
+static int
+mptctl_release(struct inode *inode, struct file *filep)
+{
+       dctlprintk(("%s() called\n", __FUNCTION__));
+       return fasync_helper(-1, filep, 0, &async_queue);
+}
+
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  *  MPT ioctl handler
@@ -674,22 +743,23 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
        u16                      iocstat;
        pFWDownloadReply_t       ReplyMsg = NULL;
 
-       dctlprintk((KERN_INFO "mptctl_do_fwdl called. mptctl_id = %xh.\n", mptctl_id));
+       dctlprintk(("mptctl_do_fwdl called. mptctl_id = %xh.\n", mptctl_id));
 
-       dctlprintk((KERN_INFO "DbG: kfwdl.bufp  = %p\n", ufwbuf));
-       dctlprintk((KERN_INFO "DbG: kfwdl.fwlen = %d\n", (int)fwlen));
-       dctlprintk((KERN_INFO "DbG: kfwdl.ioc   = %04xh\n", ioc));
+       dctlprintk(("DbG: kfwdl.bufp  = %p\n", ufwbuf));
+       dctlprintk(("DbG: kfwdl.fwlen = %d\n", (int)fwlen));
+       dctlprintk(("DbG: kfwdl.ioc   = %04xh\n", ioc));
 
-       if ((ioc = mpt_verify_adapter(ioc, &iocp)) < 0) {
-               dctlprintk(("%s@%d::_ioctl_fwdl - ioc%d not found!\n",
-                               __FILE__, __LINE__, ioc));
+       if (mpt_verify_adapter(ioc, &iocp) < 0) {
+               dctlprintk(("ioctl_fwdl - ioc%d not found!\n",
+                                ioc));
                return -ENODEV; /* (-6) No such device or address */
-       }
+       } else {
 
-       /*  Valid device. Get a message frame and construct the FW download message.
-        */
-       if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL)
-               return -EAGAIN;
+               /*  Valid device. Get a message frame and construct the FW download message.
+               */
+               if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL)
+                       return -EAGAIN;
+       }
        dlmsg = (FWDownload_t*) mf;
        ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL;
        sgOut = (char *) (ptsge + 1);
@@ -702,7 +772,11 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
        dlmsg->ChainOffset = 0;
        dlmsg->Function = MPI_FUNCTION_FW_DOWNLOAD;
        dlmsg->Reserved1[0] = dlmsg->Reserved1[1] = dlmsg->Reserved1[2] = 0;
-       dlmsg->MsgFlags = 0;
+       if (iocp->facts.MsgVersion >= MPI_VERSION_01_05)
+               dlmsg->MsgFlags = MPI_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT;
+       else
+               dlmsg->MsgFlags = 0;
+
 
        /* Set up the Transaction SGE.
         */
@@ -754,7 +828,7 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
                goto fwdl_out;
        }
 
-       dctlprintk((KERN_INFO "DbG: sgl buffer  = %p, sgfrags = %d\n", sgl, numfrags));
+       dctlprintk(("DbG: sgl buffer  = %p, sgfrags = %d\n", sgl, numfrags));
 
        /*
         * Parse SG list, copying sgl itself,
@@ -803,11 +877,11 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
        /*
         * Finally, perform firmware download.
         */
-       iocp->ioctl->wait_done = 0;
+       ReplyMsg = NULL;
        mpt_put_msg_frame(mptctl_id, iocp, mf);
 
        /* Now wait for the command to complete */
-       ret = wait_event_interruptible_timeout(mptctl_wait,
+       ret = wait_event_timeout(mptctl_wait,
             iocp->ioctl->wait_done == 1,
             HZ*60);
 
@@ -1145,7 +1219,9 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
        /* Fill in the data and return the structure to the calling
         * program
         */
-       if (ioc->bus_type == FC)
+       if (ioc->bus_type == SAS)
+               karg->adapterType = MPT_IOCTL_INTERFACE_SAS;
+       else if (ioc->bus_type == FC)
                karg->adapterType = MPT_IOCTL_INTERFACE_FC;
        else
                karg->adapterType = MPT_IOCTL_INTERFACE_SCSI;
@@ -1170,12 +1246,11 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
                karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn );
                karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn );
        } else if (cim_rev == 2) {
-               /* Get the PCI bus, device, function and segment ID numbers 
+               /* Get the PCI bus, device, function and segment ID numbers
                   for the IOC */
                karg->pciInfo.u.bits.busNumber = pdev->bus->number;
                karg->pciInfo.u.bits.deviceNumber = PCI_SLOT( pdev->devfn );
                karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn );
-               karg->pciInfo.u.bits.functionNumber = PCI_FUNC( pdev->devfn );
                karg->pciInfo.segmentID = pci_domain_nr(pdev->bus);
        }
 
@@ -1500,7 +1575,7 @@ mptctl_eventquery (unsigned long arg)
                return -ENODEV;
        }
 
-       karg.eventEntries = ioc->eventLogSize;
+       karg.eventEntries = MPTCTL_EVENT_LOG_SIZE;
        karg.eventTypes = ioc->eventTypes;
 
        /* Copy the data from kernel memory to user memory
@@ -1550,7 +1625,6 @@ mptctl_eventenable (unsigned long arg)
                memset(ioc->events, 0, sz);
                ioc->alloc_total += sz;
 
-               ioc->eventLogSize = MPTCTL_EVENT_LOG_SIZE;
                ioc->eventContext = 0;
         }
 
@@ -1590,7 +1664,7 @@ mptctl_eventreport (unsigned long arg)
        maxEvents = numBytes/sizeof(MPT_IOCTL_EVENTS);
 
 
-       max = ioc->eventLogSize < maxEvents ? ioc->eventLogSize : maxEvents;
+       max = MPTCTL_EVENT_LOG_SIZE < maxEvents ? MPTCTL_EVENT_LOG_SIZE : maxEvents;
 
        /* If fewer than 1 event is requested, there must have
         * been some type of error.
@@ -1598,6 +1672,9 @@ mptctl_eventreport (unsigned long arg)
        if ((max < 1) || !ioc->events)
                return -ENODATA;
 
+       /* reset this flag so SIGIO can restart */
+       ioc->aen_event_read_flag=0;
+
        /* Copy the data from kernel memory to user memory
         */
        numBytes = max * sizeof(MPT_IOCTL_EVENTS);
@@ -1817,6 +1894,8 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
        case MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR:
        case MPI_FUNCTION_FW_DOWNLOAD:
        case MPI_FUNCTION_FC_PRIMITIVE_SEND:
+       case MPI_FUNCTION_TOOLBOX:
+       case MPI_FUNCTION_SAS_IO_UNIT_CONTROL:
                break;
 
        case MPI_FUNCTION_SCSI_IO_REQUEST:
@@ -1837,7 +1916,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
                                goto done_free_mem;
                        }
 
-                       pScsiReq->MsgFlags = mpt_msg_flags();
+                       pScsiReq->MsgFlags &= ~MPI_SCSIIO_MSGFLGS_SENSE_WIDTH;
+                       pScsiReq->MsgFlags |= mpt_msg_flags();
+
 
                        /* verify that app has not requested
                         *      more sense data than driver
@@ -1888,6 +1969,25 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
                }
                break;
 
+       case MPI_FUNCTION_SMP_PASSTHROUGH:
+               /* Check mf->PassthruFlags to determine if
+                * transfer is ImmediateMode or not.
+                * Immediate mode returns data in the ReplyFrame.
+                * Else, we are sending request and response data
+                * in two SGLs at the end of the mf.
+                */
+               break;
+
+       case MPI_FUNCTION_SATA_PASSTHROUGH:
+               if (!ioc->sh) {
+                       printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - "
+                               "SCSI driver is not loaded. \n",
+                                       __FILE__, __LINE__);
+                       rc = -EFAULT;
+                       goto done_free_mem;
+               }
+               break;
+
        case MPI_FUNCTION_RAID_ACTION:
                /* Just add a SGE
                 */
@@ -1900,7 +2000,9 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
                        int scsidir = MPI_SCSIIO_CONTROL_READ;
                        int dataSize;
 
-                       pScsiReq->MsgFlags = mpt_msg_flags();
+                       pScsiReq->MsgFlags &= ~MPI_SCSIIO_MSGFLGS_SENSE_WIDTH;
+                       pScsiReq->MsgFlags |= mpt_msg_flags();
+
 
                        /* verify that app has not requested
                         *      more sense data than driver
@@ -2130,7 +2232,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
 
        /* Now wait for the command to complete */
        timeout = (karg.timeout > 0) ? karg.timeout : MPT_IOCTL_DEFAULT_TIMEOUT;
-       timeout = wait_event_interruptible_timeout(mptctl_wait,
+       timeout = wait_event_timeout(mptctl_wait,
             ioc->ioctl->wait_done == 1,
             HZ*timeout);
 
@@ -2246,13 +2348,16 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
        hp_host_info_t  __user *uarg = (void __user *) arg;
        MPT_ADAPTER             *ioc;
        struct pci_dev          *pdev;
-       char                    *pbuf;
+       char                    *pbuf=NULL;
        dma_addr_t              buf_dma;
        hp_host_info_t          karg;
        CONFIGPARMS             cfg;
        ConfigPageHeader_t      hdr;
        int                     iocnum;
        int                     rc, cim_rev;
+       ToolboxIstwiReadWriteRequest_t  *IstwiRWRequest;
+       MPT_FRAME_HDR           *mf = NULL;
+       MPIHeader_t             *mpi_hdr;
 
        dctlprintk((": mptctl_hp_hostinfo called.\n"));
        /* Reset long to int. Should affect IA64 and SPARC only
@@ -2370,7 +2475,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
 
        karg.base_io_addr = pci_resource_start(pdev, 0);
 
-       if (ioc->bus_type == FC)
+       if ((ioc->bus_type == SAS) || (ioc->bus_type == FC))
                karg.bus_phys_width = HP_BUS_WIDTH_UNK;
        else
                karg.bus_phys_width = HP_BUS_WIDTH_16;
@@ -2388,20 +2493,67 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
                }
        }
 
-       cfg.pageAddr = 0;
-       cfg.action = MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL;
-       cfg.dir = MPI_TB_ISTWI_FLAGS_READ;
-       cfg.timeout = 10;
+       /* 
+        * Gather ISTWI(Industry Standard Two Wire Interface) Data
+        */
+       if ((mf = mpt_get_msg_frame(mptctl_id, ioc)) == NULL) {
+               dfailprintk((MYIOC_s_WARN_FMT "%s, no msg frames!!\n",
+                   ioc->name,__FUNCTION__));
+               goto out;
+       }
+
+       IstwiRWRequest = (ToolboxIstwiReadWriteRequest_t *)mf;
+       mpi_hdr = (MPIHeader_t *) mf;
+       memset(IstwiRWRequest,0,sizeof(ToolboxIstwiReadWriteRequest_t));
+       IstwiRWRequest->Function = MPI_FUNCTION_TOOLBOX;
+       IstwiRWRequest->Tool = MPI_TOOLBOX_ISTWI_READ_WRITE_TOOL;
+       IstwiRWRequest->MsgContext = mpi_hdr->MsgContext;
+       IstwiRWRequest->Flags = MPI_TB_ISTWI_FLAGS_READ;
+       IstwiRWRequest->NumAddressBytes = 0x01;
+       IstwiRWRequest->DataLength = cpu_to_le16(0x04);
+       if (pdev->devfn & 1)
+               IstwiRWRequest->DeviceAddr = 0xB2;
+       else
+               IstwiRWRequest->DeviceAddr = 0xB0;
+
        pbuf = pci_alloc_consistent(ioc->pcidev, 4, &buf_dma);
-       if (pbuf) {
-               cfg.physAddr = buf_dma;
-               if ((mpt_toolbox(ioc, &cfg)) == 0) {
-                       karg.rsvd = *(u32 *)pbuf;
-               }
-               pci_free_consistent(ioc->pcidev, 4, pbuf, buf_dma);
-               pbuf = NULL;
+       if (!pbuf)
+               goto out;
+       mpt_add_sge((char *)&IstwiRWRequest->SGL,
+           (MPT_SGE_FLAGS_SSIMPLE_READ|4), buf_dma);
+
+       ioc->ioctl->wait_done = 0;
+       mpt_put_msg_frame(mptctl_id, ioc, mf);
+
+       rc = wait_event_timeout(mptctl_wait,
+            ioc->ioctl->wait_done == 1,
+            HZ*MPT_IOCTL_DEFAULT_TIMEOUT /* 10 sec */);
+
+       if(rc <=0 && (ioc->ioctl->wait_done != 1 )) {
+               /* 
+                * Now we need to reset the board
+                */
+               mpt_free_msg_frame(ioc, mf);
+               mptctl_timeout_expired(ioc->ioctl);
+               goto out;
        }
 
+       /* 
+        *ISTWI Data Definition
+        * pbuf[0] = FW_VERSION = 0x4
+        * pbuf[1] = Bay Count = 6 or 4 or 2, depending on
+        *  the config, you should be seeing one out of these three values
+        * pbuf[2] = Drive Installed Map = bit pattern depend on which
+        *   bays have drives in them
+        * pbuf[3] = Checksum (0x100 = (byte0 + byte2 + byte3)
+        */
+       if (ioc->ioctl->status & MPT_IOCTL_STATUS_RF_VALID)
+               karg.rsvd = *(u32 *)pbuf;
+
+ out:
+       if (pbuf)
+               pci_free_consistent(ioc->pcidev, 4, pbuf, buf_dma);
+
        /* Copy the data from kernel memory to user memory
         */
        if (copy_to_user((char __user *)arg, &karg, sizeof(hp_host_info_t))) {
@@ -2459,7 +2611,7 @@ mptctl_hp_targetinfo(unsigned long arg)
 
        /*  There is nothing to do for FCP parts.
         */
-       if (ioc->bus_type == FC)
+       if ((ioc->bus_type == SAS) || (ioc->bus_type == FC))
                return 0;
 
        if ((ioc->spi_data.sdp0length == 0) || (ioc->sh == NULL))
@@ -2569,6 +2721,8 @@ mptctl_hp_targetinfo(unsigned long arg)
 static struct file_operations mptctl_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
+       .release =      mptctl_release,
+       .fasync =       mptctl_fasync,
        .unlocked_ioctl = mptctl_ioctl,
 #ifdef CONFIG_COMPAT
        .compat_ioctl = compat_mpctl_ioctl,
@@ -2813,6 +2967,11 @@ static int __init mptctl_init(void)
                /* FIXME! */
        }
 
+       if (mpt_event_register(mptctl_id, mptctl_event_process) == 0) {
+               devtprintk((KERN_INFO MYNAM
+                 ": Registered for IOC event notifications\n"));
+       }
+
        return 0;
 
 out_fail:
index 518996e03481088f81ae3ce3ad165c205fb0c4a9..a2f8a97992e68106b04514e1b4c404ebc0f24ef7 100644 (file)
@@ -169,8 +169,10 @@ struct mpt_ioctl_pci_info2 {
  *  Read only.
  *  Data starts at offset 0xC
  */
-#define MPT_IOCTL_INTERFACE_FC         (0x01)
 #define MPT_IOCTL_INTERFACE_SCSI       (0x00)
+#define MPT_IOCTL_INTERFACE_FC         (0x01)
+#define MPT_IOCTL_INTERFACE_FC_IP      (0x02)
+#define MPT_IOCTL_INTERFACE_SAS                (0x03)
 #define MPT_IOCTL_VERSION_LENGTH       (32)
 
 struct mpt_ioctl_iocinfo {
index 05789e50546491df632331c58b6b5ff3e867f4fa..4fee6befc93d0e900fa66fae4e837ef8ac054b51 100644 (file)
@@ -2489,7 +2489,7 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
                                int idx;
                                MPT_ADAPTER *ioc = hd->ioc;
 
-                               idx = ioc->eventContext % ioc->eventLogSize;
+                               idx = ioc->eventContext % MPTCTL_EVENT_LOG_SIZE;
                                ioc->events[idx].event = MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE;
                                ioc->events[idx].eventContext = ioc->eventContext;
 
index aca47f3a7b984efa39f238ddcf1c70fe53d33a21..fd2750b269c87c3fe711a1abfaf89ff9d30dd723 100644 (file)
@@ -51,7 +51,7 @@
 struct ltfirmware
 {
         unsigned int length;
-        const unsigned char * data;
+        const unsigned char *data;
 };
 
 #define DAYNA 1
index 3de5f1d0fbace3f564c049ea896aa74e2b7bbdc6..a1ede41d90716920827fbb63c011457173ead90f 100644 (file)
@@ -149,7 +149,7 @@ config IPW2100
          In order to use this driver, you will need a firmware image for it.
           You can obtain the firmware from
          <http://ipw2100.sf.net/>.  Once you have the firmware image, you 
-         will need to place it in /etc/firmware.
+         will need to place it in /lib/firmware.
 
           You will also very likely need the Wireless Tools in order to
           configure your card:
index 3c128b692bce23135343064458b501749f7d0724..ec6f2a48895b5a904211b21b069aff333dceede2 100644 (file)
@@ -590,6 +590,7 @@ static struct pcmcia_device_id orinoco_cs_ids[] = {
        PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PC CARD HARMONY 80211B", 0xc6536a5e, 0x090c3cd9),
        PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PCI CARD HARMONY 80211B", 0xc6536a5e, 0x9f494e26),
        PCMCIA_DEVICE_PROD_ID12("SAMSUNG", "11Mbps WLAN Card", 0x43d74cb4, 0x579bd91b),
+       PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2532W-B EliteConnect Wireless Adapter", 0xc4f8b18b, 0x196bd757),
        PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2632W", 0xc4f8b18b, 0x474a1f2a),
        PCMCIA_DEVICE_PROD_ID12("Symbol Technologies", "LA4111 Spectrum24 Wireless LAN PC Card", 0x3f02b4d6, 0x3663cb0e),
        PCMCIA_DEVICE_PROD_ID123("The Linksys Group, Inc.", "Instant Wireless Network PC Card", "ISL37300P", 0xa5f472c2, 0x590eb502, 0xc9049a39),
index f46e8438e0d2439e8203be6c68471e5b8da6dc63..93f8a8fa889014deba28a42601494176aec9f278 100644 (file)
@@ -40,6 +40,8 @@
 #include <linux/string.h>
 #include <linux/pci.h>
 #include <linux/reboot.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 
 #include <asm/byteorder.h>
 #include <asm/cache.h>         /* for L1_CACHE_BYTES */
@@ -1019,62 +1021,33 @@ static struct hppa_dma_ops ccio_ops = {
 };
 
 #ifdef CONFIG_PROC_FS
-static int proc_append(char *src, int len, char **dst, off_t *offset, int *max)
-{
-       if (len < *offset) {
-               *offset -= len;
-               return 0;
-       }
-       if (*offset > 0) {
-               src += *offset;
-               len -= *offset;
-               *offset = 0;
-       }
-       if (len > *max) {
-               len = *max;
-       }
-       memcpy(*dst, src, len);
-       *dst += len;
-       *max -= len;
-       return (*max == 0);
-}
-
-static int ccio_proc_info(char *buf, char **start, off_t offset, int count,
-                         int *eof, void *data)
+static int ccio_proc_info(struct seq_file *m, void *p)
 {
-       int max = count;
-       char tmp[80]; /* width of an ANSI-standard terminal */
+       int len = 0;
        struct ioc *ioc = ioc_list;
 
        while (ioc != NULL) {
                unsigned int total_pages = ioc->res_size << 3;
                unsigned long avg = 0, min, max;
-               int j, len;
+               int j;
 
-               len = sprintf(tmp, "%s\n", ioc->name);
-               if (proc_append(tmp, len, &buf, &offset, &count))
-                       break;
+               len += seq_printf(m, "%s\n", ioc->name);
                
-               len = sprintf(tmp, "Cujo 2.0 bug    : %s\n",
-                             (ioc->cujo20_bug ? "yes" : "no"));
-               if (proc_append(tmp, len, &buf, &offset, &count))
-                       break;
+               len += seq_printf(m, "Cujo 2.0 bug    : %s\n",
+                                 (ioc->cujo20_bug ? "yes" : "no"));
                
-               len = sprintf(tmp, "IO PDIR size    : %d bytes (%d entries)\n",
-                             total_pages * 8, total_pages);
-               if (proc_append(tmp, len, &buf, &offset, &count))
-                       break;
+               len += seq_printf(m, "IO PDIR size    : %d bytes (%d entries)\n",
+                              total_pages * 8, total_pages);
+
 #ifdef CCIO_MAP_STATS
-               len = sprintf(tmp, "IO PDIR entries : %ld free  %ld used (%d%%)\n",
-                             total_pages - ioc->used_pages, ioc->used_pages,
-                             (int)(ioc->used_pages * 100 / total_pages));
-               if (proc_append(tmp, len, &buf, &offset, &count))
-                       break;
+               len += seq_printf(m, "IO PDIR entries : %ld free  %ld used (%d%%)\n",
+                                 total_pages - ioc->used_pages, ioc->used_pages,
+                                 (int)(ioc->used_pages * 100 / total_pages));
 #endif
-               len = sprintf(tmp, "Resource bitmap : %d bytes (%d pages)\n", 
-                       ioc->res_size, total_pages);
-               if (proc_append(tmp, len, &buf, &offset, &count))
-                       break;
+
+               len += seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n", 
+                                 ioc->res_size, total_pages);
+
 #ifdef CCIO_SEARCH_TIME
                min = max = ioc->avg_search[0];
                for(j = 0; j < CCIO_SEARCH_SAMPLE; ++j) {
@@ -1085,70 +1058,83 @@ static int ccio_proc_info(char *buf, char **start, off_t offset, int count,
                                min = ioc->avg_search[j];
                }
                avg /= CCIO_SEARCH_SAMPLE;
-               len = sprintf(tmp, "  Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",
-                             min, avg, max);
-               if (proc_append(tmp, len, &buf, &offset, &count))
-                       break;
+               len += seq_printf(m, "  Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",
+                                 min, avg, max);
 #endif
 #ifdef CCIO_MAP_STATS
-               len = sprintf(tmp, "pci_map_single(): %8ld calls  %8ld pages (avg %d/1000)\n",
-                             ioc->msingle_calls, ioc->msingle_pages,
-                             (int)((ioc->msingle_pages * 1000)/ioc->msingle_calls));
-               if (proc_append(tmp, len, &buf, &offset, &count))
-                       break;
-               
+               len += seq_printf(m, "pci_map_single(): %8ld calls  %8ld pages (avg %d/1000)\n",
+                                 ioc->msingle_calls, ioc->msingle_pages,
+                                 (int)((ioc->msingle_pages * 1000)/ioc->msingle_calls));
 
                /* KLUGE - unmap_sg calls unmap_single for each mapped page */
                min = ioc->usingle_calls - ioc->usg_calls;
                max = ioc->usingle_pages - ioc->usg_pages;
-               len = sprintf(tmp, "pci_unmap_single: %8ld calls  %8ld pages (avg %d/1000)\n",
-                             min, max, (int)((max * 1000)/min));
-               if (proc_append(tmp, len, &buf, &offset, &count))
-                       break;
+               len += seq_printf(m, "pci_unmap_single: %8ld calls  %8ld pages (avg %d/1000)\n",
+                                 min, max, (int)((max * 1000)/min));
  
-               len = sprintf(tmp, "pci_map_sg()    : %8ld calls  %8ld pages (avg %d/1000)\n",
-                             ioc->msg_calls, ioc->msg_pages,
-                             (int)((ioc->msg_pages * 1000)/ioc->msg_calls));
-               if (proc_append(tmp, len, &buf, &offset, &count))
-                       break;
-               len = sprintf(tmp, "pci_unmap_sg()  : %8ld calls  %8ld pages (avg %d/1000)\n\n\n",
-                             ioc->usg_calls, ioc->usg_pages,
-                             (int)((ioc->usg_pages * 1000)/ioc->usg_calls));
-               if (proc_append(tmp, len, &buf, &offset, &count))
-                       break;
+               len += seq_printf(m, "pci_map_sg()    : %8ld calls  %8ld pages (avg %d/1000)\n",
+                                 ioc->msg_calls, ioc->msg_pages,
+                                 (int)((ioc->msg_pages * 1000)/ioc->msg_calls));
+
+               len += seq_printf(m, "pci_unmap_sg()  : %8ld calls  %8ld pages (avg %d/1000)\n\n\n",
+                                 ioc->usg_calls, ioc->usg_pages,
+                                 (int)((ioc->usg_pages * 1000)/ioc->usg_calls));
 #endif /* CCIO_MAP_STATS */
+
                ioc = ioc->next;
        }
 
-       if (count == 0) {
-               *eof = 1;
-       }
-       return (max - count);
+       return 0;
+}
+
+static int ccio_proc_info_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, &ccio_proc_info, NULL);
 }
 
-static int ccio_resource_map(char *buf, char **start, off_t offset, int len,
-                            int *eof, void *data)
+static struct file_operations ccio_proc_info_fops = {
+       .owner = THIS_MODULE,
+       .open = ccio_proc_info_open,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+};
+
+static int ccio_proc_bitmap_info(struct seq_file *m, void *p)
 {
+       int len = 0;
        struct ioc *ioc = ioc_list;
 
-       buf[0] = '\0';
        while (ioc != NULL) {
                u32 *res_ptr = (u32 *)ioc->res_map;
                int j;
 
                for (j = 0; j < (ioc->res_size / sizeof(u32)); j++) {
                        if ((j & 7) == 0)
-                               strcat(buf,"\n   ");
-                       sprintf(buf, "%s %08x", buf, *res_ptr);
+                               len += seq_puts(m, "\n   ");
+                       len += seq_printf(m, "%08x", *res_ptr);
                        res_ptr++;
                }
-               strcat(buf, "\n\n");
+               len += seq_puts(m, "\n\n");
                ioc = ioc->next;
                break; /* XXX - remove me */
        }
 
-       return strlen(buf);
+       return 0;
 }
+
+static int ccio_proc_bitmap_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, &ccio_proc_bitmap_info, NULL);
+}
+
+static struct file_operations ccio_proc_bitmap_fops = {
+       .owner = THIS_MODULE,
+       .open = ccio_proc_bitmap_open,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+};
 #endif
 
 /**
@@ -1556,6 +1542,7 @@ static int ccio_probe(struct parisc_device *dev)
 {
        int i;
        struct ioc *ioc, **ioc_p = &ioc_list;
+       struct proc_dir_entry *info_entry, *bitmap_entry;
        
        ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL);
        if (ioc == NULL) {
@@ -1583,13 +1570,14 @@ static int ccio_probe(struct parisc_device *dev)
        BUG_ON(dev->dev.platform_data == NULL);
        HBA_DATA(dev->dev.platform_data)->iommu = ioc;
        
-
        if (ioc_count == 0) {
-               /* FIXME: Create separate entries for each ioc */
-               create_proc_read_entry(MODULE_NAME, S_IRWXU, proc_runway_root,
-                                      ccio_proc_info, NULL);
-               create_proc_read_entry(MODULE_NAME"-bitmap", S_IRWXU,
-                                      proc_runway_root, ccio_resource_map, NULL);
+               info_entry = create_proc_entry(MODULE_NAME, 0, proc_runway_root);
+               if (info_entry)
+                       info_entry->proc_fops = &ccio_proc_info_fops;
+
+               bitmap_entry = create_proc_entry(MODULE_NAME"-bitmap", 0, proc_runway_root);
+               if (bitmap_entry)
+                       bitmap_entry->proc_fops = &ccio_proc_bitmap_fops;
        }
 
        ioc_count++;
index 52f265e97729d14a32e50dd2e71f462245bf0e57..5d47c5965c5187b37b778123b21d9eef0fb7fc55 100644 (file)
@@ -37,6 +37,8 @@
 #include <asm/hardware.h>      /* for register_parisc_driver() stuff */
 
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
+
 #include <asm/runway.h>                /* for proc_runway_root */
 #include <asm/pdc.h>           /* for PDC_MODEL_* */
 #include <asm/pdcpat.h>                /* for is_pdc_pat() */
@@ -1892,46 +1894,43 @@ sba_common_init(struct sba_device *sba_dev)
 }
 
 #ifdef CONFIG_PROC_FS
-static int sba_proc_info(char *buf, char **start, off_t offset, int len)
+static int sba_proc_info(struct seq_file *m, void *p)
 {
        struct sba_device *sba_dev = sba_list;
        struct ioc *ioc = &sba_dev->ioc[0];     /* FIXME: Multi-IOC support! */
        int total_pages = (int) (ioc->res_size << 3); /* 8 bits per byte */
-       unsigned long i;
 #ifdef SBA_COLLECT_STATS
        unsigned long avg = 0, min, max;
 #endif
+       int i, len = 0;
 
-       sprintf(buf, "%s rev %d.%d\n",
+       len += seq_printf(m, "%s rev %d.%d\n",
                sba_dev->name,
                (sba_dev->hw_rev & 0x7) + 1,
                (sba_dev->hw_rev & 0x18) >> 3
                );
-       sprintf(buf, "%sIO PDIR size    : %d bytes (%d entries)\n",
-               buf,
+       len += seq_printf(m, "IO PDIR size    : %d bytes (%d entries)\n",
                (int) ((ioc->res_size << 3) * sizeof(u64)), /* 8 bits/byte */
                total_pages);
 
-       sprintf(buf, "%sResource bitmap : %d bytes (%d pages)\n", 
-               buf, ioc->res_size, ioc->res_size << 3);   /* 8 bits per byte */
+       len += seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n", 
+               ioc->res_size, ioc->res_size << 3);   /* 8 bits per byte */
 
-       sprintf(buf, "%sLMMIO_BASE/MASK/ROUTE %08x %08x %08x\n",
-               buf,
+       len += seq_printf(m, "LMMIO_BASE/MASK/ROUTE %08x %08x %08x\n",
                READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_BASE),
                READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_MASK),
                READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_ROUTE)
                );
 
        for (i=0; i<4; i++)
-               sprintf(buf, "%sDIR%ld_BASE/MASK/ROUTE %08x %08x %08x\n",
-                       buf, i,
+               len += seq_printf(m, "DIR%d_BASE/MASK/ROUTE %08x %08x %08x\n", i,
                        READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_BASE  + i*0x18),
                        READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_MASK  + i*0x18),
                        READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_ROUTE + i*0x18)
                );
 
 #ifdef SBA_COLLECT_STATS
-       sprintf(buf, "%sIO PDIR entries : %ld free  %ld used (%d%%)\n", buf,
+       len += seq_printf(m, "IO PDIR entries : %ld free  %ld used (%d%%)\n",
                total_pages - ioc->used_pages, ioc->used_pages,
                (int) (ioc->used_pages * 100 / total_pages));
 
@@ -1942,53 +1941,76 @@ static int sba_proc_info(char *buf, char **start, off_t offset, int len)
                if (ioc->avg_search[i] < min) min = ioc->avg_search[i];
        }
        avg /= SBA_SEARCH_SAMPLE;
-       sprintf(buf, "%s  Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",
-               buf, min, avg, max);
+       len += seq_printf(m, "  Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",
+               min, avg, max);
 
-       sprintf(buf, "%spci_map_single(): %12ld calls  %12ld pages (avg %d/1000)\n",
-               buf, ioc->msingle_calls, ioc->msingle_pages,
+       len += seq_printf(m, "pci_map_single(): %12ld calls  %12ld pages (avg %d/1000)\n",
+               ioc->msingle_calls, ioc->msingle_pages,
                (int) ((ioc->msingle_pages * 1000)/ioc->msingle_calls));
 
        /* KLUGE - unmap_sg calls unmap_single for each mapped page */
        min = ioc->usingle_calls;
        max = ioc->usingle_pages - ioc->usg_pages;
-       sprintf(buf, "%spci_unmap_single: %12ld calls  %12ld pages (avg %d/1000)\n",
-               buf, min, max,
-               (int) ((max * 1000)/min));
+       len += seq_printf(m, "pci_unmap_single: %12ld calls  %12ld pages (avg %d/1000)\n",
+               min, max, (int) ((max * 1000)/min));
 
-       sprintf(buf, "%spci_map_sg()    : %12ld calls  %12ld pages (avg %d/1000)\n",
-               buf, ioc->msg_calls, ioc->msg_pages,
+       len += seq_printf(m, "pci_map_sg()    : %12ld calls  %12ld pages (avg %d/1000)\n",
+               ioc->msg_calls, ioc->msg_pages, 
                (int) ((ioc->msg_pages * 1000)/ioc->msg_calls));
 
-       sprintf(buf, "%spci_unmap_sg()  : %12ld calls  %12ld pages (avg %d/1000)\n",
-               buf, ioc->usg_calls, ioc->usg_pages,
+       len += seq_printf(m, "pci_unmap_sg()  : %12ld calls  %12ld pages (avg %d/1000)\n",
+               ioc->usg_calls, ioc->usg_pages,
                (int) ((ioc->usg_pages * 1000)/ioc->usg_calls));
 #endif
 
-       return strlen(buf);
+       return 0;
 }
 
-#if 0
-/* XXX too much output - exceeds 4k limit and needs to be re-written */
 static int
-sba_resource_map(char *buf, char **start, off_t offset, int len)
+sba_proc_open(struct inode *i, struct file *f)
+{
+       return single_open(f, &sba_proc_info, NULL);
+}
+
+static struct file_operations sba_proc_fops = {
+       .owner = THIS_MODULE,
+       .open = sba_proc_open,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+};
+
+static int
+sba_proc_bitmap_info(struct seq_file *m, void *p)
 {
        struct sba_device *sba_dev = sba_list;
-       struct ioc *ioc = &sba_dev->ioc[0];     /* FIXME: Mutli-IOC suppoer! */
+       struct ioc *ioc = &sba_dev->ioc[0];     /* FIXME: Multi-IOC support! */
        unsigned int *res_ptr = (unsigned int *)ioc->res_map;
-       int i;
+       int i, len = 0;
 
-       buf[0] = '\0';
-       for(i = 0; i < (ioc->res_size / sizeof(unsigned int)); ++i, ++res_ptr) {
+       for (i = 0; i < (ioc->res_size/sizeof(unsigned int)); ++i, ++res_ptr) {
                if ((i & 7) == 0)
-                   strcat(buf,"\n   ");
-               sprintf(buf, "%s %08x", buf, *res_ptr);
+                       len += seq_printf(m, "\n   ");
+               len += seq_printf(m, " %08x", *res_ptr);
        }
-       strcat(buf, "\n");
+       len += seq_printf(m, "\n");
 
-       return strlen(buf);
+       return 0;
 }
-#endif /* 0 */
+
+static int
+sba_proc_bitmap_open(struct inode *i, struct file *f)
+{
+       return single_open(f, &sba_proc_bitmap_info, NULL);
+}
+
+static struct file_operations sba_proc_bitmap_fops = {
+       .owner = THIS_MODULE,
+       .open = sba_proc_bitmap_open,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+};
 #endif /* CONFIG_PROC_FS */
 
 static struct parisc_device_id sba_tbl[] = {
@@ -2021,6 +2043,7 @@ sba_driver_callback(struct parisc_device *dev)
        int i;
        char *version;
        void __iomem *sba_addr = ioremap(dev->hpa.start, SBA_FUNC_SIZE);
+       struct proc_dir_entry *info_entry, *bitmap_entry, *root;
 
        sba_dump_ranges(sba_addr);
 
@@ -2088,19 +2111,27 @@ sba_driver_callback(struct parisc_device *dev)
        hppa_dma_ops = &sba_ops;
 
 #ifdef CONFIG_PROC_FS
-       if (IS_ASTRO(&dev->id)) {
-               create_proc_info_entry("Astro", 0, proc_runway_root, sba_proc_info);
-       } else if (IS_IKE(&dev->id)) {
-               create_proc_info_entry("Ike", 0, proc_runway_root, sba_proc_info);
-       } else if (IS_PLUTO(&dev->id)) {
-               create_proc_info_entry("Pluto", 0, proc_mckinley_root, sba_proc_info);
-       } else {
-               create_proc_info_entry("Reo", 0, proc_runway_root, sba_proc_info);
+       switch (dev->id.hversion) {
+       case PLUTO_MCKINLEY_PORT:
+               root = proc_mckinley_root;
+               break;
+       case ASTRO_RUNWAY_PORT:
+       case IKE_MERCED_PORT:
+       default:
+               root = proc_runway_root;
+               break;
        }
-#if 0
-       create_proc_info_entry("bitmap", 0, proc_runway_root, sba_resource_map);
-#endif
+
+       info_entry = create_proc_entry("sba_iommu", 0, root);
+       bitmap_entry = create_proc_entry("sba_iommu-bitmap", 0, root);
+
+       if (info_entry)
+               info_entry->proc_fops = &sba_proc_fops;
+
+       if (bitmap_entry)
+               bitmap_entry->proc_fops = &sba_proc_bitmap_fops;
 #endif
+
        parisc_vmerge_boundary = IOVP_SIZE;
        parisc_vmerge_max_size = IOVP_SIZE * BITS_PER_LONG;
        parisc_has_iommu();
index ceb0e474fde4691457cd7b97770b03c3bda5449b..4138564402b8c2ee27b3bf04731bebe1c3caf35e 100644 (file)
@@ -85,11 +85,10 @@ static volatile enum sclp_mask_state_t {
 /* Maximum retry counts */
 #define SCLP_INIT_RETRY                3
 #define SCLP_MASK_RETRY                3
-#define SCLP_REQUEST_RETRY     3
 
 /* Timeout intervals in seconds.*/
-#define SCLP_BUSY_INTERVAL     2
-#define SCLP_RETRY_INTERVAL    5
+#define SCLP_BUSY_INTERVAL     10
+#define SCLP_RETRY_INTERVAL    15
 
 static void sclp_process_queue(void);
 static int sclp_init_mask(int calculate);
@@ -153,11 +152,9 @@ __sclp_start_request(struct sclp_req *req)
        if (sclp_running_state != sclp_running_state_idle)
                return 0;
        del_timer(&sclp_request_timer);
-       if (req->start_count <= SCLP_REQUEST_RETRY) {
-               rc = service_call(req->command, req->sccb);
-               req->start_count++;
-       } else
-               rc = -EIO;
+       rc = service_call(req->command, req->sccb);
+       req->start_count++;
+
        if (rc == 0) {
                /* Sucessfully started request */
                req->status = SCLP_REQ_RUNNING;
index 92be75d99a56eb84743cdea07e91e445e3e455b6..8cf9905d484be5fc120b2e05a65103f0acad95c9 100644 (file)
@@ -232,7 +232,7 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
                return 0;
 
        mask = 0x80 >> j;
-       spin_lock(&sch->lock);
+       spin_lock_irq(&sch->lock);
 
        stsch(sch->schid, &schib);
        if (!schib.pmcw.dnv)
@@ -281,10 +281,10 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
        if (sch->driver && sch->driver->verify)
                sch->driver->verify(&sch->dev);
 out_unlock:
-       spin_unlock(&sch->lock);
+       spin_unlock_irq(&sch->lock);
        return 0;
 out_unreg:
-       spin_unlock(&sch->lock);
+       spin_unlock_irq(&sch->lock);
        sch->lpm = 0;
        if (css_enqueue_subchannel_slow(sch->schid)) {
                css_clear_subchannel_slow_list();
@@ -652,7 +652,7 @@ __chp_add(struct subchannel_id schid, void *data)
        if (!sch)
                /* Check if the subchannel is now available. */
                return __chp_add_new_sch(schid);
-       spin_lock(&sch->lock);
+       spin_lock_irq(&sch->lock);
        for (i=0; i<8; i++)
                if (sch->schib.pmcw.chpid[i] == chp->id) {
                        if (stsch(sch->schid, &sch->schib) != 0) {
@@ -674,7 +674,7 @@ __chp_add(struct subchannel_id schid, void *data)
        if (sch->driver && sch->driver->verify)
                sch->driver->verify(&sch->dev);
 
-       spin_unlock(&sch->lock);
+       spin_unlock_irq(&sch->lock);
        put_device(&sch->dev);
        return 0;
 }
index 4d7d47cf2394a38ea9d4d760cfecd12bbc10f149..a5f2ba9a8fdb57079f04d8074ed112b93c3d8209 100644 (file)
@@ -710,10 +710,9 @@ static inline void
 _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level,
                            struct zfcp_adapter *adapter,
                            struct scsi_cmnd *scsi_cmnd,
-                           struct zfcp_fsf_req *new_fsf_req)
+                           struct zfcp_fsf_req *fsf_req,
+                           struct zfcp_fsf_req *old_fsf_req)
 {
-       struct zfcp_fsf_req *fsf_req =
-           (struct zfcp_fsf_req *)scsi_cmnd->host_scribble;
        struct zfcp_scsi_dbf_record *rec = &adapter->scsi_dbf_buf;
        struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec;
        unsigned long flags;
@@ -727,19 +726,20 @@ _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level,
                if (offset == 0) {
                        strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
                        strncpy(rec->tag2, tag2, ZFCP_DBF_TAG_SIZE);
-                       if (scsi_cmnd->device) {
-                               rec->scsi_id = scsi_cmnd->device->id;
-                               rec->scsi_lun = scsi_cmnd->device->lun;
+                       if (scsi_cmnd != NULL) {
+                               if (scsi_cmnd->device) {
+                                       rec->scsi_id = scsi_cmnd->device->id;
+                                       rec->scsi_lun = scsi_cmnd->device->lun;
+                               }
+                               rec->scsi_result = scsi_cmnd->result;
+                               rec->scsi_cmnd = (unsigned long)scsi_cmnd;
+                               rec->scsi_serial = scsi_cmnd->serial_number;
+                               memcpy(rec->scsi_opcode, &scsi_cmnd->cmnd,
+                                       min((int)scsi_cmnd->cmd_len,
+                                               ZFCP_DBF_SCSI_OPCODE));
+                               rec->scsi_retries = scsi_cmnd->retries;
+                               rec->scsi_allowed = scsi_cmnd->allowed;
                        }
-                       rec->scsi_result = scsi_cmnd->result;
-                       rec->scsi_cmnd = (unsigned long)scsi_cmnd;
-                       rec->scsi_serial = scsi_cmnd->serial_number;
-                       memcpy(rec->scsi_opcode,
-                              &scsi_cmnd->cmnd,
-                              min((int)scsi_cmnd->cmd_len,
-                                  ZFCP_DBF_SCSI_OPCODE));
-                       rec->scsi_retries = scsi_cmnd->retries;
-                       rec->scsi_allowed = scsi_cmnd->allowed;
                        if (fsf_req != NULL) {
                                fcp_rsp = (struct fcp_rsp_iu *)
                                    &(fsf_req->qtcb->bottom.io.fcp_rsp);
@@ -772,15 +772,8 @@ _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level,
                                rec->fsf_seqno = fsf_req->seq_no;
                                rec->fsf_issued = fsf_req->issued;
                        }
-                       if (new_fsf_req != NULL) {
-                               rec->type.new_fsf_req.fsf_reqid =
-                                   (unsigned long)
-                                   new_fsf_req;
-                               rec->type.new_fsf_req.fsf_seqno =
-                                   new_fsf_req->seq_no;
-                               rec->type.new_fsf_req.fsf_issued =
-                                   new_fsf_req->issued;
-                       }
+                       rec->type.old_fsf_reqid =
+                                   (unsigned long) old_fsf_req;
                } else {
                        strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE);
                        dump->total_size = buflen;
@@ -801,19 +794,21 @@ _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level,
 inline void
 zfcp_scsi_dbf_event_result(const char *tag, int level,
                           struct zfcp_adapter *adapter,
-                          struct scsi_cmnd *scsi_cmnd)
+                          struct scsi_cmnd *scsi_cmnd,
+                          struct zfcp_fsf_req *fsf_req)
 {
-       _zfcp_scsi_dbf_event_common("rslt",
-                                   tag, level, adapter, scsi_cmnd, NULL);
+       _zfcp_scsi_dbf_event_common("rslt", tag, level,
+                       adapter, scsi_cmnd, fsf_req, NULL);
 }
 
 inline void
 zfcp_scsi_dbf_event_abort(const char *tag, struct zfcp_adapter *adapter,
                          struct scsi_cmnd *scsi_cmnd,
-                         struct zfcp_fsf_req *new_fsf_req)
+                         struct zfcp_fsf_req *new_fsf_req,
+                         struct zfcp_fsf_req *old_fsf_req)
 {
-       _zfcp_scsi_dbf_event_common("abrt",
-                                   tag, 1, adapter, scsi_cmnd, new_fsf_req);
+       _zfcp_scsi_dbf_event_common("abrt", tag, 1,
+                       adapter, scsi_cmnd, new_fsf_req, old_fsf_req);
 }
 
 inline void
@@ -823,7 +818,7 @@ zfcp_scsi_dbf_event_devreset(const char *tag, u8 flag, struct zfcp_unit *unit,
        struct zfcp_adapter *adapter = unit->port->adapter;
 
        _zfcp_scsi_dbf_event_common(flag == FCP_TARGET_RESET ? "trst" : "lrst",
-                                   tag, 1, adapter, scsi_cmnd, NULL);
+                       tag, 1, adapter, scsi_cmnd, NULL, NULL);
 }
 
 static int
@@ -856,6 +851,10 @@ zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view,
                             rec->scsi_retries);
        len += zfcp_dbf_view(out_buf + len, "scsi_allowed", "0x%02x",
                             rec->scsi_allowed);
+       if (strncmp(rec->tag, "abrt", ZFCP_DBF_TAG_SIZE) == 0) {
+               len += zfcp_dbf_view(out_buf + len, "old_fsf_reqid", "0x%0Lx",
+                                    rec->type.old_fsf_reqid);
+       }
        len += zfcp_dbf_view(out_buf + len, "fsf_reqid", "0x%0Lx",
                             rec->fsf_reqid);
        len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x",
@@ -883,21 +882,6 @@ zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view,
                                       min((int)rec->type.fcp.sns_info_len,
                                           ZFCP_DBF_SCSI_FCP_SNS_INFO), 0,
                                       rec->type.fcp.sns_info_len);
-       } else if (strncmp(rec->tag, "abrt", ZFCP_DBF_TAG_SIZE) == 0) {
-               len += zfcp_dbf_view(out_buf + len, "fsf_reqid_abort", "0x%0Lx",
-                                    rec->type.new_fsf_req.fsf_reqid);
-               len += zfcp_dbf_view(out_buf + len, "fsf_seqno_abort", "0x%08x",
-                                    rec->type.new_fsf_req.fsf_seqno);
-               len += zfcp_dbf_stck(out_buf + len, "fsf_issued",
-                                    rec->type.new_fsf_req.fsf_issued);
-       } else if ((strncmp(rec->tag, "trst", ZFCP_DBF_TAG_SIZE) == 0) ||
-                  (strncmp(rec->tag, "lrst", ZFCP_DBF_TAG_SIZE) == 0)) {
-               len += zfcp_dbf_view(out_buf + len, "fsf_reqid_reset", "0x%0Lx",
-                                    rec->type.new_fsf_req.fsf_reqid);
-               len += zfcp_dbf_view(out_buf + len, "fsf_seqno_reset", "0x%08x",
-                                    rec->type.new_fsf_req.fsf_seqno);
-               len += zfcp_dbf_stck(out_buf + len, "fsf_issued",
-                                    rec->type.new_fsf_req.fsf_issued);
        }
 
        len += sprintf(out_buf + len, "\n");
index e260d19fa717f212e60d3e7bbb40d0de652a47e7..7f551d66f47f88c9005b27e90bce227bb409d5af 100644 (file)
@@ -152,11 +152,6 @@ typedef u32 scsi_lun_t;
 #define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP  100
 #define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES      7
 
-/* Retry 5 times every 2 second, then every minute */
-#define ZFCP_EXCHANGE_PORT_DATA_SHORT_RETRIES  5
-#define ZFCP_EXCHANGE_PORT_DATA_SHORT_SLEEP    200
-#define ZFCP_EXCHANGE_PORT_DATA_LONG_SLEEP     6000
-
 /* timeout value for "default timer" for fsf requests */
 #define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ);
 
@@ -429,11 +424,7 @@ struct zfcp_scsi_dbf_record {
        u32 fsf_seqno;
        u64 fsf_issued;
        union {
-               struct {
-                       u64 fsf_reqid;
-                       u32 fsf_seqno;
-                       u64 fsf_issued;
-               } new_fsf_req;
+               u64 old_fsf_reqid;
                struct {
                        u8 rsp_validity;
                        u8 rsp_scsi_status;
@@ -915,8 +906,6 @@ struct zfcp_adapter {
        wwn_t                   peer_wwnn;         /* P2P peer WWNN */
        wwn_t                   peer_wwpn;         /* P2P peer WWPN */
        u32                     peer_d_id;         /* P2P peer D_ID */
-       wwn_t                   physical_wwpn;     /* WWPN of physical port */
-       u32                     physical_s_id;     /* local FC port ID */
        struct ccw_device       *ccw_device;       /* S/390 ccw device */
        u8                      fc_service_class;
        u32                     hydra_version;     /* Hydra version */
index da947e662031f6114b02121591b0f912ac41ff73..e3c4bdd29a60805ee36c8d24b54966ab71c43b01 100644 (file)
@@ -2246,15 +2246,6 @@ zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *erp_action)
 {
        int retval;
 
-       if ((atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,
-                             &erp_action->adapter->status)) &&
-           (erp_action->adapter->adapter_features &
-            FSF_FEATURE_HBAAPI_MANAGEMENT)) {
-               zfcp_erp_adapter_strategy_open_fsf_xport(erp_action);
-               atomic_set(&erp_action->adapter->erp_counter, 0);
-               return ZFCP_ERP_FAILED;
-       }
-
        retval = zfcp_erp_adapter_strategy_open_fsf_xconfig(erp_action);
        if (retval == ZFCP_ERP_FAILED)
                return ZFCP_ERP_FAILED;
@@ -2266,13 +2257,6 @@ zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *erp_action)
        return zfcp_erp_adapter_strategy_open_fsf_statusread(erp_action);
 }
 
-/*
- * function:   
- *
- * purpose:    
- *
- * returns:
- */
 static int
 zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
 {
@@ -2350,48 +2334,40 @@ static int
 zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action)
 {
        int ret;
-       int retries;
-       int sleep;
-       struct zfcp_adapter *adapter = erp_action->adapter;
+       struct zfcp_adapter *adapter;
 
+       adapter = erp_action->adapter;
        atomic_clear_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status);
 
-       retries = 0;
-       do {
-               write_lock(&adapter->erp_lock);
-               zfcp_erp_action_to_running(erp_action);
-               write_unlock(&adapter->erp_lock);
-               zfcp_erp_timeout_init(erp_action);
-               ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL);
-               if (ret == -EOPNOTSUPP) {
-                       debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp");
-                       return ZFCP_ERP_SUCCEEDED;
-               } else if (ret) {
-                       debug_text_event(adapter->erp_dbf, 3, "a_xport_failed");
-                       return ZFCP_ERP_FAILED;
-               }
-               debug_text_event(adapter->erp_dbf, 6, "a_xport_ok");
+       write_lock(&adapter->erp_lock);
+       zfcp_erp_action_to_running(erp_action);
+       write_unlock(&adapter->erp_lock);
 
-               down(&adapter->erp_ready_sem);
-               if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) {
-                       ZFCP_LOG_INFO("error: exchange of port data "
-                                     "for adapter %s timed out\n",
-                                     zfcp_get_busid_by_adapter(adapter));
-                       break;
-               }
-               if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED,
-                                     &adapter->status))
-                       break;
+       zfcp_erp_timeout_init(erp_action);
+       ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL);
+       if (ret == -EOPNOTSUPP) {
+               debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp");
+               return ZFCP_ERP_SUCCEEDED;
+       } else if (ret) {
+               debug_text_event(adapter->erp_dbf, 3, "a_xport_failed");
+               return ZFCP_ERP_FAILED;
+       }
+       debug_text_event(adapter->erp_dbf, 6, "a_xport_ok");
 
-               if (retries < ZFCP_EXCHANGE_PORT_DATA_SHORT_RETRIES) {
-                       sleep = ZFCP_EXCHANGE_PORT_DATA_SHORT_SLEEP;
-                       retries++;
-               } else
-                       sleep = ZFCP_EXCHANGE_PORT_DATA_LONG_SLEEP;
-               schedule_timeout(sleep);
-       } while (1);
+       ret = ZFCP_ERP_SUCCEEDED;
+       down(&adapter->erp_ready_sem);
+       if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) {
+               ZFCP_LOG_INFO("error: exchange port data timed out (adapter "
+                             "%s)\n", zfcp_get_busid_by_adapter(adapter));
+               ret = ZFCP_ERP_FAILED;
+       }
+       if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status)) {
+               ZFCP_LOG_INFO("error: exchange port data failed (adapter "
+                             "%s\n", zfcp_get_busid_by_adapter(adapter));
+               ret = ZFCP_ERP_FAILED;
+       }
 
-       return ZFCP_ERP_SUCCEEDED;
+       return ret;
 }
 
 /*
@@ -3439,6 +3415,8 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter,
                                                "(adapter %s, wwpn=0x%016Lx)\n",
                                                zfcp_get_busid_by_port(port),
                                                port->wwpn);
+                       else
+                               scsi_flush_work(adapter->scsi_host);
                }
                zfcp_port_put(port);
                break;
index c1ba7cf1b49619367973ed84b02d915c9a54b2b9..700f5402a978fc66bf6f7d734ef9c5d40061591c 100644 (file)
@@ -194,9 +194,10 @@ extern void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *);
 extern void zfcp_san_dbf_event_incoming_els(struct zfcp_fsf_req *);
 
 extern void zfcp_scsi_dbf_event_result(const char *, int, struct zfcp_adapter *,
-                                      struct scsi_cmnd *);
+                                      struct scsi_cmnd *,
+                                      struct zfcp_fsf_req *);
 extern void zfcp_scsi_dbf_event_abort(const char *, struct zfcp_adapter *,
-                                     struct scsi_cmnd *,
+                                     struct scsi_cmnd *, struct zfcp_fsf_req *,
                                      struct zfcp_fsf_req *);
 extern void zfcp_scsi_dbf_event_devreset(const char *, u8, struct zfcp_unit *,
                                         struct scsi_cmnd *);
index 9f0cb3d820c06ce1753854e3946ebc4add466cfd..662ec571d73b5a891803ee745f593b74f544f0d3 100644 (file)
@@ -388,6 +388,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
        case FSF_PROT_LINK_DOWN:
                zfcp_fsf_link_down_info_eval(adapter,
                                             &prot_status_qual->link_down_info);
+               zfcp_erp_adapter_reopen(adapter, 0);
                fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
                break;
 
@@ -558,10 +559,8 @@ zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter,
 
        atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status);
 
-       if (link_down == NULL) {
-               zfcp_erp_adapter_reopen(adapter, 0);
-               return;
-       }
+       if (link_down == NULL)
+               goto out;
 
        switch (link_down->error_code) {
        case FSF_PSQ_LINK_NO_LIGHT:
@@ -643,16 +642,8 @@ zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter,
                                link_down->explanation_code,
                                link_down->vendor_specific_code);
 
-       switch (link_down->error_code) {
-       case FSF_PSQ_LINK_NO_LIGHT:
-       case FSF_PSQ_LINK_WRAP_PLUG:
-       case FSF_PSQ_LINK_NO_FCP:
-       case FSF_PSQ_LINK_FIRMWARE_UPDATE:
-               zfcp_erp_adapter_reopen(adapter, 0);
-               break;
-       default:
-               zfcp_erp_adapter_failed(adapter);
-       }
+ out:
+       zfcp_erp_adapter_failed(adapter);
 }
 
 /*
@@ -2304,6 +2295,35 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action,
        return retval;
 }
 
+/**
+ * zfcp_fsf_exchange_port_evaluate
+ * @fsf_req: fsf_req which belongs to xchg port data request
+ * @xchg_ok: specifies if xchg port data was incomplete or complete (0/1)
+ */
+static void
+zfcp_fsf_exchange_port_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok)
+{
+       struct zfcp_adapter *adapter;
+       struct fsf_qtcb *qtcb;
+       struct fsf_qtcb_bottom_port *bottom, *data;
+       struct Scsi_Host *shost;
+
+       adapter = fsf_req->adapter;
+       qtcb = fsf_req->qtcb;
+       bottom = &qtcb->bottom.port;
+       shost = adapter->scsi_host;
+
+       data = (struct fsf_qtcb_bottom_port*) fsf_req->data;
+       if (data)
+               memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port));
+
+       if (adapter->connection_features & FSF_FEATURE_NPIV_MODE)
+               fc_host_permanent_port_name(shost) = bottom->wwpn;
+       else
+               fc_host_permanent_port_name(shost) = fc_host_port_name(shost);
+       fc_host_maxframe_size(shost) = bottom->maximum_frame_size;
+       fc_host_supported_speeds(shost) = bottom->supported_speed;
+}
 
 /**
  * zfcp_fsf_exchange_port_data_handler - handler for exchange_port_data request
@@ -2312,38 +2332,26 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action,
 static void
 zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req)
 {
-       struct zfcp_adapter *adapter = fsf_req->adapter;
-       struct Scsi_Host *shost = adapter->scsi_host;
-       struct fsf_qtcb *qtcb = fsf_req->qtcb;
-       struct fsf_qtcb_bottom_port *bottom, *data;
+       struct zfcp_adapter *adapter;
+       struct fsf_qtcb *qtcb;
+
+       adapter = fsf_req->adapter;
+       qtcb = fsf_req->qtcb;
 
        if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR)
                return;
 
        switch (qtcb->header.fsf_status) {
         case FSF_GOOD:
+               zfcp_fsf_exchange_port_evaluate(fsf_req, 1);
                atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status);
-
-               bottom = &qtcb->bottom.port;
-               data = (struct fsf_qtcb_bottom_port*) fsf_req->data;
-               if (data)
-                       memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port));
-               if (adapter->connection_features & FSF_FEATURE_NPIV_MODE)
-                       fc_host_permanent_port_name(shost) = bottom->wwpn;
-               else
-                       fc_host_permanent_port_name(shost) =
-                               fc_host_port_name(shost);
-               fc_host_maxframe_size(shost) = bottom->maximum_frame_size;
-               fc_host_supported_speeds(shost) = bottom->supported_speed;
                break;
-
        case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE:
+               zfcp_fsf_exchange_port_evaluate(fsf_req, 0);
                atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status);
-
                zfcp_fsf_link_down_info_eval(adapter,
                        &qtcb->header.fsf_status_qual.link_down_info);
                 break;
-
         default:
                debug_text_event(adapter->erp_dbf, 0, "xchg-port-ng");
                debug_event(adapter->erp_dbf, 0,
@@ -4203,11 +4211,11 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
        ZFCP_LOG_DEBUG("scpnt->result =0x%x\n", scpnt->result);
 
        if (scpnt->result != 0)
-               zfcp_scsi_dbf_event_result("erro", 3, fsf_req->adapter, scpnt);
+               zfcp_scsi_dbf_event_result("erro", 3, fsf_req->adapter, scpnt, fsf_req);
        else if (scpnt->retries > 0)
-               zfcp_scsi_dbf_event_result("retr", 4, fsf_req->adapter, scpnt);
+               zfcp_scsi_dbf_event_result("retr", 4, fsf_req->adapter, scpnt, fsf_req);
        else
-               zfcp_scsi_dbf_event_result("norm", 6, fsf_req->adapter, scpnt);
+               zfcp_scsi_dbf_event_result("norm", 6, fsf_req->adapter, scpnt, fsf_req);
 
        /* cleanup pointer (need this especially for abort) */
        scpnt->host_scribble = NULL;
index e0803757c0fa054c8f23df5f43f477a501518b14..9f6b4d7a46f3342a2b853ee0d501b37e46b3b846 100644 (file)
@@ -242,7 +242,7 @@ zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result)
        if ((scpnt->device != NULL) && (scpnt->device->host != NULL))
                zfcp_scsi_dbf_event_result("fail", 4,
                        (struct zfcp_adapter*) scpnt->device->host->hostdata[0],
-                       scpnt);
+                       scpnt, NULL);
        /* return directly */
        scpnt->scsi_done(scpnt);
 }
@@ -446,7 +446,7 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
        old_fsf_req = (struct zfcp_fsf_req *) scpnt->host_scribble;
        if (!old_fsf_req) {
                write_unlock_irqrestore(&adapter->abort_lock, flags);
-               zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, new_fsf_req);
+               zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL, NULL);
                retval = SUCCESS;
                goto out;
        }
@@ -460,6 +460,8 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
                                                 adapter, unit, 0);
        if (!new_fsf_req) {
                ZFCP_LOG_INFO("error: initiation of Abort FCP Cmnd failed\n");
+               zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL,
+                                         old_fsf_req);
                retval = FAILED;
                goto out;
        }
@@ -470,13 +472,16 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
 
        /* status should be valid since signals were not permitted */
        if (new_fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) {
-               zfcp_scsi_dbf_event_abort("okay", adapter, scpnt, new_fsf_req);
+               zfcp_scsi_dbf_event_abort("okay", adapter, scpnt, new_fsf_req,
+                                         NULL);
                retval = SUCCESS;
        } else if (new_fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED) {
-               zfcp_scsi_dbf_event_abort("lte2", adapter, scpnt, new_fsf_req);
+               zfcp_scsi_dbf_event_abort("lte2", adapter, scpnt, new_fsf_req,
+                                         NULL);
                retval = SUCCESS;
        } else {
-               zfcp_scsi_dbf_event_abort("fail", adapter, scpnt, new_fsf_req);
+               zfcp_scsi_dbf_event_abort("fail", adapter, scpnt, new_fsf_req,
+                                         NULL);
                retval = FAILED;
        }
        zfcp_fsf_req_free(new_fsf_req);
index dfc07370f412acf1231303ac9ce5e3705a53d1d4..b29ac25e07f3a841b6cd7d45f11e78246faed459 100644 (file)
@@ -55,8 +55,6 @@ ZFCP_DEFINE_ADAPTER_ATTR(status, "0x%08x\n", atomic_read(&adapter->status));
 ZFCP_DEFINE_ADAPTER_ATTR(peer_wwnn, "0x%016llx\n", adapter->peer_wwnn);
 ZFCP_DEFINE_ADAPTER_ATTR(peer_wwpn, "0x%016llx\n", adapter->peer_wwpn);
 ZFCP_DEFINE_ADAPTER_ATTR(peer_d_id, "0x%06x\n", adapter->peer_d_id);
-ZFCP_DEFINE_ADAPTER_ATTR(physical_wwpn, "0x%016llx\n", adapter->physical_wwpn);
-ZFCP_DEFINE_ADAPTER_ATTR(physical_s_id, "0x%06x\n", adapter->physical_s_id);
 ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version);
 ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version);
 ZFCP_DEFINE_ADAPTER_ATTR(hardware_version, "0x%08x\n",
@@ -241,8 +239,6 @@ static struct attribute *zfcp_adapter_attrs[] = {
        &dev_attr_peer_wwnn.attr,
        &dev_attr_peer_wwpn.attr,
        &dev_attr_peer_d_id.attr,
-       &dev_attr_physical_wwpn.attr,
-       &dev_attr_physical_s_id.attr,
        &dev_attr_card_version.attr,
        &dev_attr_lic_version.attr,
        &dev_attr_status.attr,
index 31c4975422729d46a47802e975c58c0cc8d46f6a..d9152d02088c81bb4c498360d5ed7232f10718dd 100644 (file)
@@ -61,6 +61,7 @@
                  Add support for embedded firmware error strings.
    2.26.02.003 - Correctly handle single sgl's with use_sg=1.
    2.26.02.004 - Add support for 9550SX controllers.
+   2.26.02.005 - Fix use_sg == 0 mapping on systems with 4GB or higher.
 */
 
 #include <linux/module.h>
@@ -84,7 +85,7 @@
 #include "3w-9xxx.h"
 
 /* Globals */
-#define TW_DRIVER_VERSION "2.26.02.004"
+#define TW_DRIVER_VERSION "2.26.02.005"
 static TW_Device_Extension *twa_device_extension_list[TW_MAX_SLOT];
 static unsigned int twa_device_extension_count;
 static int twa_major = -1;
@@ -1408,7 +1409,7 @@ static dma_addr_t twa_map_scsi_single_data(TW_Device_Extension *tw_dev, int requ
        dma_addr_t mapping;
        struct scsi_cmnd *cmd = tw_dev->srb[request_id];
        struct pci_dev *pdev = tw_dev->tw_pci_dev;
-       int retval = 0;
+       dma_addr_t retval = 0;
 
        if (cmd->request_bufflen == 0) {
                retval = 0;
@@ -1798,7 +1799,7 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,
        int i, sg_count;
        struct scsi_cmnd *srb = NULL;
        struct scatterlist *sglist = NULL;
-       u32 buffaddr = 0x0;
+       dma_addr_t buffaddr = 0x0;
        int retval = 1;
 
        if (tw_dev->srb[request_id]) {
index 7139659dd952e4cf36eb971c8491a5dcd4b42136..a16f8ded8f1dd683f266683757dd21ed0cf7fd43 100644 (file)
@@ -173,10 +173,10 @@ int aac_get_config_status(struct aac_dev *dev)
        int status = 0;
        struct fib * fibptr;
 
-       if (!(fibptr = fib_alloc(dev)))
+       if (!(fibptr = aac_fib_alloc(dev)))
                return -ENOMEM;
 
-       fib_init(fibptr);
+       aac_fib_init(fibptr);
        {
                struct aac_get_config_status *dinfo;
                dinfo = (struct aac_get_config_status *) fib_data(fibptr);
@@ -186,7 +186,7 @@ int aac_get_config_status(struct aac_dev *dev)
                dinfo->count = cpu_to_le32(sizeof(((struct aac_get_config_status_resp *)NULL)->data));
        }
 
-       status = fib_send(ContainerCommand,
+       status = aac_fib_send(ContainerCommand,
                            fibptr,
                            sizeof (struct aac_get_config_status),
                            FsaNormal,
@@ -209,30 +209,30 @@ int aac_get_config_status(struct aac_dev *dev)
                        status = -EINVAL;
                }
        }
-       fib_complete(fibptr);
+       aac_fib_complete(fibptr);
        /* Send a CT_COMMIT_CONFIG to enable discovery of devices */
        if (status >= 0) {
                if (commit == 1) {
                        struct aac_commit_config * dinfo;
-                       fib_init(fibptr);
+                       aac_fib_init(fibptr);
                        dinfo = (struct aac_commit_config *) fib_data(fibptr);
        
                        dinfo->command = cpu_to_le32(VM_ContainerConfig);
                        dinfo->type = cpu_to_le32(CT_COMMIT_CONFIG);
        
-                       status = fib_send(ContainerCommand,
+                       status = aac_fib_send(ContainerCommand,
                                    fibptr,
                                    sizeof (struct aac_commit_config),
                                    FsaNormal,
                                    1, 1,
                                    NULL, NULL);
-                       fib_complete(fibptr);
+                       aac_fib_complete(fibptr);
                } else if (commit == 0) {
                        printk(KERN_WARNING
                          "aac_get_config_status: Foreign device configurations are being ignored\n");
                }
        }
-       fib_free(fibptr);
+       aac_fib_free(fibptr);
        return status;
 }
 
@@ -255,15 +255,15 @@ int aac_get_containers(struct aac_dev *dev)
 
        instance = dev->scsi_host_ptr->unique_id;
 
-       if (!(fibptr = fib_alloc(dev)))
+       if (!(fibptr = aac_fib_alloc(dev)))
                return -ENOMEM;
 
-       fib_init(fibptr);
+       aac_fib_init(fibptr);
        dinfo = (struct aac_get_container_count *) fib_data(fibptr);
        dinfo->command = cpu_to_le32(VM_ContainerConfig);
        dinfo->type = cpu_to_le32(CT_GET_CONTAINER_COUNT);
 
-       status = fib_send(ContainerCommand,
+       status = aac_fib_send(ContainerCommand,
                    fibptr,
                    sizeof (struct aac_get_container_count),
                    FsaNormal,
@@ -272,7 +272,7 @@ int aac_get_containers(struct aac_dev *dev)
        if (status >= 0) {
                dresp = (struct aac_get_container_count_resp *)fib_data(fibptr);
                maximum_num_containers = le32_to_cpu(dresp->ContainerSwitchEntries);
-               fib_complete(fibptr);
+               aac_fib_complete(fibptr);
        }
 
        if (maximum_num_containers < MAXIMUM_NUM_CONTAINERS)
@@ -280,7 +280,7 @@ int aac_get_containers(struct aac_dev *dev)
        fsa_dev_ptr = (struct fsa_dev_info *) kmalloc(
          sizeof(*fsa_dev_ptr) * maximum_num_containers, GFP_KERNEL);
        if (!fsa_dev_ptr) {
-               fib_free(fibptr);
+               aac_fib_free(fibptr);
                return -ENOMEM;
        }
        memset(fsa_dev_ptr, 0, sizeof(*fsa_dev_ptr) * maximum_num_containers);
@@ -294,14 +294,14 @@ int aac_get_containers(struct aac_dev *dev)
 
                fsa_dev_ptr[index].devname[0] = '\0';
 
-               fib_init(fibptr);
+               aac_fib_init(fibptr);
                dinfo = (struct aac_query_mount *) fib_data(fibptr);
 
                dinfo->command = cpu_to_le32(VM_NameServe);
                dinfo->count = cpu_to_le32(index);
                dinfo->type = cpu_to_le32(FT_FILESYS);
 
-               status = fib_send(ContainerCommand,
+               status = aac_fib_send(ContainerCommand,
                                    fibptr,
                                    sizeof (struct aac_query_mount),
                                    FsaNormal,
@@ -319,7 +319,7 @@ int aac_get_containers(struct aac_dev *dev)
                        dinfo->count = cpu_to_le32(index);
                        dinfo->type = cpu_to_le32(FT_FILESYS);
 
-                       if (fib_send(ContainerCommand,
+                       if (aac_fib_send(ContainerCommand,
                                    fibptr,
                                    sizeof(struct aac_query_mount),
                                    FsaNormal,
@@ -347,7 +347,7 @@ int aac_get_containers(struct aac_dev *dev)
                        if (le32_to_cpu(dresp->mnt[0].state) & FSCS_READONLY)
                                    fsa_dev_ptr[index].ro = 1;
                }
-               fib_complete(fibptr);
+               aac_fib_complete(fibptr);
                /*
                 *      If there are no more containers, then stop asking.
                 */
@@ -355,7 +355,7 @@ int aac_get_containers(struct aac_dev *dev)
                        break;
                }
        }
-       fib_free(fibptr);
+       aac_fib_free(fibptr);
        return status;
 }
 
@@ -413,8 +413,8 @@ static void get_container_name_callback(void *context, struct fib * fibptr)
 
        scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
 
-       fib_complete(fibptr);
-       fib_free(fibptr);
+       aac_fib_complete(fibptr);
+       aac_fib_free(fibptr);
        scsicmd->scsi_done(scsicmd);
 }
 
@@ -430,10 +430,10 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd, int cid)
 
        dev = (struct aac_dev *)scsicmd->device->host->hostdata;
 
-       if (!(cmd_fibcontext = fib_alloc(dev)))
+       if (!(cmd_fibcontext = aac_fib_alloc(dev)))
                return -ENOMEM;
 
-       fib_init(cmd_fibcontext);
+       aac_fib_init(cmd_fibcontext);
        dinfo = (struct aac_get_name *) fib_data(cmd_fibcontext);
 
        dinfo->command = cpu_to_le32(VM_ContainerConfig);
@@ -441,7 +441,7 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd, int cid)
        dinfo->cid = cpu_to_le32(cid);
        dinfo->count = cpu_to_le32(sizeof(((struct aac_get_name_resp *)NULL)->data));
 
-       status = fib_send(ContainerCommand, 
+       status = aac_fib_send(ContainerCommand,
                  cmd_fibcontext, 
                  sizeof (struct aac_get_name),
                  FsaNormal, 
@@ -455,14 +455,14 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd, int cid)
        if (status == -EINPROGRESS) 
                return 0;
                
-       printk(KERN_WARNING "aac_get_container_name: fib_send failed with status: %d.\n", status);
-       fib_complete(cmd_fibcontext);
-       fib_free(cmd_fibcontext);
+       printk(KERN_WARNING "aac_get_container_name: aac_fib_send failed with status: %d.\n", status);
+       aac_fib_complete(cmd_fibcontext);
+       aac_fib_free(cmd_fibcontext);
        return -1;
 }
 
 /**
- *     probe_container         -       query a logical volume
+ *     aac_probe_container             -       query a logical volume
  *     @dev: device to query
  *     @cid: container identifier
  *
@@ -470,7 +470,7 @@ static int aac_get_container_name(struct scsi_cmnd * scsicmd, int cid)
  *     is updated in the struct fsa_dev_info structure rather than returned.
  */
  
-int probe_container(struct aac_dev *dev, int cid)
+int aac_probe_container(struct aac_dev *dev, int cid)
 {
        struct fsa_dev_info *fsa_dev_ptr;
        int status;
@@ -482,10 +482,10 @@ int probe_container(struct aac_dev *dev, int cid)
        fsa_dev_ptr = dev->fsa_dev;
        instance = dev->scsi_host_ptr->unique_id;
 
-       if (!(fibptr = fib_alloc(dev)))
+       if (!(fibptr = aac_fib_alloc(dev)))
                return -ENOMEM;
 
-       fib_init(fibptr);
+       aac_fib_init(fibptr);
 
        dinfo = (struct aac_query_mount *)fib_data(fibptr);
 
@@ -493,14 +493,14 @@ int probe_container(struct aac_dev *dev, int cid)
        dinfo->count = cpu_to_le32(cid);
        dinfo->type = cpu_to_le32(FT_FILESYS);
 
-       status = fib_send(ContainerCommand,
+       status = aac_fib_send(ContainerCommand,
                            fibptr,
                            sizeof(struct aac_query_mount),
                            FsaNormal,
                            1, 1,
                            NULL, NULL);
        if (status < 0) {
-               printk(KERN_WARNING "aacraid: probe_container query failed.\n");
+               printk(KERN_WARNING "aacraid: aac_probe_container query failed.\n");
                goto error;
        }
 
@@ -512,7 +512,7 @@ int probe_container(struct aac_dev *dev, int cid)
                dinfo->count = cpu_to_le32(cid);
                dinfo->type = cpu_to_le32(FT_FILESYS);
 
-               if (fib_send(ContainerCommand,
+               if (aac_fib_send(ContainerCommand,
                            fibptr,
                            sizeof(struct aac_query_mount),
                            FsaNormal,
@@ -535,8 +535,8 @@ int probe_container(struct aac_dev *dev, int cid)
        }
 
 error:
-       fib_complete(fibptr);
-       fib_free(fibptr);
+       aac_fib_complete(fibptr);
+       aac_fib_free(fibptr);
 
        return status;
 }
@@ -700,14 +700,14 @@ int aac_get_adapter_info(struct aac_dev* dev)
        struct aac_bus_info *command;
        struct aac_bus_info_response *bus_info;
 
-       if (!(fibptr = fib_alloc(dev)))
+       if (!(fibptr = aac_fib_alloc(dev)))
                return -ENOMEM;
 
-       fib_init(fibptr);
+       aac_fib_init(fibptr);
        info = (struct aac_adapter_info *) fib_data(fibptr);
        memset(info,0,sizeof(*info));
 
-       rcode = fib_send(RequestAdapterInfo,
+       rcode = aac_fib_send(RequestAdapterInfo,
                         fibptr, 
                         sizeof(*info),
                         FsaNormal, 
@@ -716,8 +716,8 @@ int aac_get_adapter_info(struct aac_dev* dev)
                         NULL);
 
        if (rcode < 0) {
-               fib_complete(fibptr);
-               fib_free(fibptr);
+               aac_fib_complete(fibptr);
+               aac_fib_free(fibptr);
                return rcode;
        }
        memcpy(&dev->adapter_info, info, sizeof(*info));
@@ -725,13 +725,13 @@ int aac_get_adapter_info(struct aac_dev* dev)
        if (dev->adapter_info.options & AAC_OPT_SUPPLEMENT_ADAPTER_INFO) {
                struct aac_supplement_adapter_info * info;
 
-               fib_init(fibptr);
+               aac_fib_init(fibptr);
 
                info = (struct aac_supplement_adapter_info *) fib_data(fibptr);
 
                memset(info,0,sizeof(*info));
 
-               rcode = fib_send(RequestSupplementAdapterInfo,
+               rcode = aac_fib_send(RequestSupplementAdapterInfo,
                                 fibptr,
                                 sizeof(*info),
                                 FsaNormal,
@@ -748,7 +748,7 @@ int aac_get_adapter_info(struct aac_dev* dev)
         * GetBusInfo 
         */
 
-       fib_init(fibptr);
+       aac_fib_init(fibptr);
 
        bus_info = (struct aac_bus_info_response *) fib_data(fibptr);
 
@@ -761,7 +761,7 @@ int aac_get_adapter_info(struct aac_dev* dev)
        command->MethodId = cpu_to_le32(1);
        command->CtlCmd = cpu_to_le32(GetBusInfo);
 
-       rcode = fib_send(ContainerCommand,
+       rcode = aac_fib_send(ContainerCommand,
                         fibptr,
                         sizeof (*bus_info),
                         FsaNormal,
@@ -891,8 +891,8 @@ int aac_get_adapter_info(struct aac_dev* dev)
                }
        }
 
-       fib_complete(fibptr);
-       fib_free(fibptr);
+       aac_fib_complete(fibptr);
+       aac_fib_free(fibptr);
 
        return rcode;
 }
@@ -976,8 +976,8 @@ static void io_callback(void *context, struct fib * fibptr)
                    ? sizeof(scsicmd->sense_buffer)
                    : sizeof(dev->fsa_dev[cid].sense_data));
        }
-       fib_complete(fibptr);
-       fib_free(fibptr);
+       aac_fib_complete(fibptr);
+       aac_fib_free(fibptr);
 
        scsicmd->scsi_done(scsicmd);
 }
@@ -1062,11 +1062,11 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
        /*
         *      Alocate and initialize a Fib
         */
-       if (!(cmd_fibcontext = fib_alloc(dev))) {
+       if (!(cmd_fibcontext = aac_fib_alloc(dev))) {
                return -1;
        }
 
-       fib_init(cmd_fibcontext);
+       aac_fib_init(cmd_fibcontext);
 
        if (dev->raw_io_interface) {
                struct aac_raw_io *readcmd;
@@ -1086,7 +1086,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
                /*
                 *      Now send the Fib to the adapter
                 */
-               status = fib_send(ContainerRawIo,
+               status = aac_fib_send(ContainerRawIo,
                          cmd_fibcontext, 
                          fibsize, 
                          FsaNormal, 
@@ -1112,7 +1112,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
                /*
                 *      Now send the Fib to the adapter
                 */
-               status = fib_send(ContainerCommand64, 
+               status = aac_fib_send(ContainerCommand64,
                          cmd_fibcontext, 
                          fibsize, 
                          FsaNormal, 
@@ -1136,7 +1136,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
                /*
                 *      Now send the Fib to the adapter
                 */
-               status = fib_send(ContainerCommand, 
+               status = aac_fib_send(ContainerCommand,
                          cmd_fibcontext, 
                          fibsize, 
                          FsaNormal, 
@@ -1153,14 +1153,14 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
        if (status == -EINPROGRESS) 
                return 0;
                
-       printk(KERN_WARNING "aac_read: fib_send failed with status: %d.\n", status);
+       printk(KERN_WARNING "aac_read: aac_fib_send failed with status: %d.\n", status);
        /*
         *      For some reason, the Fib didn't queue, return QUEUE_FULL
         */
        scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_TASK_SET_FULL;
        scsicmd->scsi_done(scsicmd);
-       fib_complete(cmd_fibcontext);
-       fib_free(cmd_fibcontext);
+       aac_fib_complete(cmd_fibcontext);
+       aac_fib_free(cmd_fibcontext);
        return 0;
 }
 
@@ -1228,12 +1228,12 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
        /*
         *      Allocate and initialize a Fib then setup a BlockWrite command
         */
-       if (!(cmd_fibcontext = fib_alloc(dev))) {
+       if (!(cmd_fibcontext = aac_fib_alloc(dev))) {
                scsicmd->result = DID_ERROR << 16;
                scsicmd->scsi_done(scsicmd);
                return 0;
        }
-       fib_init(cmd_fibcontext);
+       aac_fib_init(cmd_fibcontext);
 
        if (dev->raw_io_interface) {
                struct aac_raw_io *writecmd;
@@ -1253,7 +1253,7 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
                /*
                 *      Now send the Fib to the adapter
                 */
-               status = fib_send(ContainerRawIo,
+               status = aac_fib_send(ContainerRawIo,
                          cmd_fibcontext, 
                          fibsize, 
                          FsaNormal, 
@@ -1279,7 +1279,7 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
                /*
                 *      Now send the Fib to the adapter
                 */
-               status = fib_send(ContainerCommand64, 
+               status = aac_fib_send(ContainerCommand64,
                          cmd_fibcontext, 
                          fibsize, 
                          FsaNormal, 
@@ -1305,7 +1305,7 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
                /*
                 *      Now send the Fib to the adapter
                 */
-               status = fib_send(ContainerCommand, 
+               status = aac_fib_send(ContainerCommand,
                          cmd_fibcontext, 
                          fibsize, 
                          FsaNormal, 
@@ -1322,15 +1322,15 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
                return 0;
        }
 
-       printk(KERN_WARNING "aac_write: fib_send failed with status: %d\n", status);
+       printk(KERN_WARNING "aac_write: aac_fib_send failed with status: %d\n", status);
        /*
         *      For some reason, the Fib didn't queue, return QUEUE_FULL
         */
        scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_TASK_SET_FULL;
        scsicmd->scsi_done(scsicmd);
 
-       fib_complete(cmd_fibcontext);
-       fib_free(cmd_fibcontext);
+       aac_fib_complete(cmd_fibcontext);
+       aac_fib_free(cmd_fibcontext);
        return 0;
 }
 
@@ -1369,8 +1369,8 @@ static void synchronize_callback(void *context, struct fib *fibptr)
                          sizeof(cmd->sense_buffer)));
        }
 
-       fib_complete(fibptr);
-       fib_free(fibptr);
+       aac_fib_complete(fibptr);
+       aac_fib_free(fibptr);
        cmd->scsi_done(cmd);
 }
 
@@ -1407,10 +1407,10 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd, int cid)
         *      Allocate and initialize a Fib
         */
        if (!(cmd_fibcontext = 
-           fib_alloc((struct aac_dev *)scsicmd->device->host->hostdata))) 
+           aac_fib_alloc((struct aac_dev *)scsicmd->device->host->hostdata)))
                return SCSI_MLQUEUE_HOST_BUSY;
 
-       fib_init(cmd_fibcontext);
+       aac_fib_init(cmd_fibcontext);
 
        synchronizecmd = fib_data(cmd_fibcontext);
        synchronizecmd->command = cpu_to_le32(VM_ContainerConfig);
@@ -1422,7 +1422,7 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd, int cid)
        /*
         *      Now send the Fib to the adapter
         */
-       status = fib_send(ContainerCommand,
+       status = aac_fib_send(ContainerCommand,
                  cmd_fibcontext,
                  sizeof(struct aac_synchronize),
                  FsaNormal,
@@ -1437,9 +1437,9 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd, int cid)
                return 0;
 
        printk(KERN_WARNING 
-               "aac_synchronize: fib_send failed with status: %d.\n", status);
-       fib_complete(cmd_fibcontext);
-       fib_free(cmd_fibcontext);
+               "aac_synchronize: aac_fib_send failed with status: %d.\n", status);
+       aac_fib_complete(cmd_fibcontext);
+       aac_fib_free(cmd_fibcontext);
        return SCSI_MLQUEUE_HOST_BUSY;
 }
 
@@ -1465,7 +1465,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
         *      itself.
         */
        if (scmd_id(scsicmd) != host->this_id) {
-               if ((scsicmd->device->channel == 0) ){
+               if ((scsicmd->device->channel == CONTAINER_CHANNEL)) {
                        if( (scsicmd->device->id >= dev->maximum_num_containers) || (scsicmd->device->lun != 0)){ 
                                scsicmd->result = DID_NO_CONNECT << 16;
                                scsicmd->scsi_done(scsicmd);
@@ -1488,7 +1488,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
                                case READ_CAPACITY:
                                case TEST_UNIT_READY:
                                        spin_unlock_irq(host->host_lock);
-                                       probe_container(dev, cid);
+                                       aac_probe_container(dev, cid);
                                        if ((fsa_dev_ptr[cid].valid & 1) == 0)
                                                fsa_dev_ptr[cid].valid = 0;
                                        spin_lock_irq(host->host_lock);
@@ -1935,33 +1935,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
        case SRB_STATUS_ERROR_RECOVERY:
        case SRB_STATUS_PENDING:
        case SRB_STATUS_SUCCESS:
-               if(scsicmd->cmnd[0] == INQUIRY ){
-                       u8 b;
-                       u8 b1;
-                       /* We can't expose disk devices because we can't tell whether they
-                        * are the raw container drives or stand alone drives.  If they have
-                        * the removable bit set then we should expose them though.
-                        */
-                       b = (*(u8*)scsicmd->buffer)&0x1f;
-                       b1 = ((u8*)scsicmd->buffer)[1];
-                       if( b==TYPE_TAPE || b==TYPE_WORM || b==TYPE_ROM || b==TYPE_MOD|| b==TYPE_MEDIUM_CHANGER 
-                                       || (b==TYPE_DISK && (b1&0x80)) ){
-                               scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
-                       /*
-                        * We will allow disk devices if in RAID/SCSI mode and
-                        * the channel is 2
-                        */
-                       } else if ((dev->raid_scsi_mode) &&
-                                       (scmd_channel(scsicmd) == 2)) {
-                               scsicmd->result = DID_OK << 16 | 
-                                               COMMAND_COMPLETE << 8;
-                       } else {
-                               scsicmd->result = DID_NO_CONNECT << 16 | 
-                                               COMMAND_COMPLETE << 8;
-                       }
-               } else {
-                       scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
-               }
+               scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
                break;
        case SRB_STATUS_DATA_OVERRUN:
                switch(scsicmd->cmnd[0]){
@@ -1981,28 +1955,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
                        scsicmd->result = DID_ERROR << 16 | COMMAND_COMPLETE << 8;
                        break;
                case INQUIRY: {
-                       u8 b;
-                       u8 b1;
-                       /* We can't expose disk devices because we can't tell whether they
-                       * are the raw container drives or stand alone drives
-                       */
-                       b = (*(u8*)scsicmd->buffer)&0x0f;
-                       b1 = ((u8*)scsicmd->buffer)[1];
-                       if( b==TYPE_TAPE || b==TYPE_WORM || b==TYPE_ROM || b==TYPE_MOD|| b==TYPE_MEDIUM_CHANGER
-                                       || (b==TYPE_DISK && (b1&0x80)) ){
-                               scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
-                       /*
-                        * We will allow disk devices if in RAID/SCSI mode and
-                        * the channel is 2
-                        */
-                       } else if ((dev->raid_scsi_mode) &&
-                                       (scmd_channel(scsicmd) == 2)) {
-                               scsicmd->result = DID_OK << 16 | 
-                                               COMMAND_COMPLETE << 8;
-                       } else {
-                               scsicmd->result = DID_NO_CONNECT << 16 | 
-                                               COMMAND_COMPLETE << 8;
-                       }
+                       scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
                        break;
                }
                default:
@@ -2089,8 +2042,8 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
         */
        scsicmd->result |= le32_to_cpu(srbreply->scsi_status);
 
-       fib_complete(fibptr);
-       fib_free(fibptr);
+       aac_fib_complete(fibptr);
+       aac_fib_free(fibptr);
        scsicmd->scsi_done(scsicmd);
 }
 
@@ -2142,10 +2095,10 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
        /*
         *      Allocate and initialize a Fib then setup a BlockWrite command
         */
-       if (!(cmd_fibcontext = fib_alloc(dev))) {
+       if (!(cmd_fibcontext = aac_fib_alloc(dev))) {
                return -1;
        }
-       fib_init(cmd_fibcontext);
+       aac_fib_init(cmd_fibcontext);
 
        srbcmd = (struct aac_srb*) fib_data(cmd_fibcontext);
        srbcmd->function = cpu_to_le32(SRBF_ExecuteScsi);
@@ -2179,7 +2132,7 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
                /*
                 *      Now send the Fib to the adapter
                 */
-               status = fib_send(ScsiPortCommand64, cmd_fibcontext, 
+               status = aac_fib_send(ScsiPortCommand64, cmd_fibcontext,
                                fibsize, FsaNormal, 0, 1,
                                  (fib_callback) aac_srb_callback, 
                                  (void *) scsicmd);
@@ -2201,7 +2154,7 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
                /*
                 *      Now send the Fib to the adapter
                 */
-               status = fib_send(ScsiPortCommand, cmd_fibcontext, fibsize, FsaNormal, 0, 1,
+               status = aac_fib_send(ScsiPortCommand, cmd_fibcontext, fibsize, FsaNormal, 0, 1,
                                  (fib_callback) aac_srb_callback, (void *) scsicmd);
        }
        /*
@@ -2211,9 +2164,9 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
                return 0;
        }
 
-       printk(KERN_WARNING "aac_srb: fib_send failed with status: %d\n", status);
-       fib_complete(cmd_fibcontext);
-       fib_free(cmd_fibcontext);
+       printk(KERN_WARNING "aac_srb: aac_fib_send failed with status: %d\n", status);
+       aac_fib_complete(cmd_fibcontext);
+       aac_fib_free(cmd_fibcontext);
 
        return -1;
 }
index 66dbb6d2c506afe1ce904b66db2aa76f3b93c72e..2d430b7e8cf406953ff2c7f7ff1dcba81d433624 100644 (file)
@@ -1774,16 +1774,16 @@ static inline u32 cap_to_cyls(sector_t capacity, u32 divisor)
 struct scsi_cmnd;
 
 const char *aac_driverinfo(struct Scsi_Host *);
-struct fib *fib_alloc(struct aac_dev *dev);
-int fib_setup(struct aac_dev *dev);
-void fib_map_free(struct aac_dev *dev);
-void fib_free(struct fib * context);
-void fib_init(struct fib * context);
+struct fib *aac_fib_alloc(struct aac_dev *dev);
+int aac_fib_setup(struct aac_dev *dev);
+void aac_fib_map_free(struct aac_dev *dev);
+void aac_fib_free(struct fib * context);
+void aac_fib_init(struct fib * context);
 void aac_printf(struct aac_dev *dev, u32 val);
-int fib_send(u16 command, struct fib * context, unsigned long size, int priority, int wait, int reply, fib_callback callback, void *ctxt);
+int aac_fib_send(u16 command, struct fib * context, unsigned long size, int priority, int wait, int reply, fib_callback callback, void *ctxt);
 int aac_consumer_get(struct aac_dev * dev, struct aac_queue * q, struct aac_entry **entry);
 void aac_consumer_free(struct aac_dev * dev, struct aac_queue * q, u32 qnum);
-int fib_complete(struct fib * context);
+int aac_fib_complete(struct fib * context);
 #define fib_data(fibctx) ((void *)(fibctx)->hw_fib->data)
 struct aac_dev *aac_init_adapter(struct aac_dev *dev);
 int aac_get_config_status(struct aac_dev *dev);
@@ -1799,11 +1799,11 @@ unsigned int aac_command_normal(struct aac_queue * q);
 unsigned int aac_intr_normal(struct aac_dev * dev, u32 Index);
 int aac_command_thread(struct aac_dev * dev);
 int aac_close_fib_context(struct aac_dev * dev, struct aac_fib_context *fibctx);
-int fib_adapter_complete(struct fib * fibptr, unsigned short size);
+int aac_fib_adapter_complete(struct fib * fibptr, unsigned short size);
 struct aac_driver_ident* aac_get_driver_ident(int devtype);
 int aac_get_adapter_info(struct aac_dev* dev);
 int aac_send_shutdown(struct aac_dev *dev);
-int probe_container(struct aac_dev *dev, int cid);
+int aac_probe_container(struct aac_dev *dev, int cid);
 extern int numacb;
 extern int acbsize;
 extern char aac_driver_version[];
index 4fe79cd7c957664bf8a686b18d46fe490b131d7a..47fefca72695d02f3959b7a4e5c846a9c611c9bf 100644 (file)
@@ -63,7 +63,7 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
        unsigned size;
        int retval;
 
-       fibptr = fib_alloc(dev);
+       fibptr = aac_fib_alloc(dev);
        if(fibptr == NULL) {
                return -ENOMEM;
        }
@@ -73,7 +73,7 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
         *      First copy in the header so that we can check the size field.
         */
        if (copy_from_user((void *)kfib, arg, sizeof(struct aac_fibhdr))) {
-               fib_free(fibptr);
+               aac_fib_free(fibptr);
                return -EFAULT;
        }
        /*
@@ -110,13 +110,13 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
                 */
                kfib->header.XferState = 0;
        } else {
-               retval = fib_send(le16_to_cpu(kfib->header.Command), fibptr,
+               retval = aac_fib_send(le16_to_cpu(kfib->header.Command), fibptr,
                                le16_to_cpu(kfib->header.Size) , FsaNormal,
                                1, 1, NULL, NULL);
                if (retval) {
                        goto cleanup;
                }
-               if (fib_complete(fibptr) != 0) {
+               if (aac_fib_complete(fibptr) != 0) {
                        retval = -EINVAL;
                        goto cleanup;
                }
@@ -138,7 +138,7 @@ cleanup:
                fibptr->hw_fib_pa = hw_fib_pa;
                fibptr->hw_fib = hw_fib;
        }
-       fib_free(fibptr);
+       aac_fib_free(fibptr);
        return retval;
 }
 
@@ -464,10 +464,10 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
        /*
         *      Allocate and initialize a Fib then setup a BlockWrite command
         */
-       if (!(srbfib = fib_alloc(dev))) {
+       if (!(srbfib = aac_fib_alloc(dev))) {
                return -ENOMEM;
        }
-       fib_init(srbfib);
+       aac_fib_init(srbfib);
 
        srbcmd = (struct aac_srb*) fib_data(srbfib);
 
@@ -601,7 +601,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
 
                srbcmd->count = cpu_to_le32(byte_count);
                psg->count = cpu_to_le32(sg_indx+1);
-               status = fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,NULL,NULL);
+               status = aac_fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,NULL,NULL);
        } else {
                struct user_sgmap* upsg = &user_srbcmd->sg;
                struct sgmap* psg = &srbcmd->sg;
@@ -649,7 +649,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
                }
                srbcmd->count = cpu_to_le32(byte_count);
                psg->count = cpu_to_le32(sg_indx+1);
-               status = fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, NULL, NULL);
+               status = aac_fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, NULL, NULL);
        }
 
        if (status != 0){
@@ -684,8 +684,8 @@ cleanup:
        for(i=0; i <= sg_indx; i++){
                kfree(sg_list[i]);
        }
-       fib_complete(srbfib);
-       fib_free(srbfib);
+       aac_fib_complete(srbfib);
+       aac_fib_free(srbfib);
 
        return rcode;
 }
index 82821d331c07322211d4a9f72f4f21862deb9b53..1628d094943df1c85f425f0392730b0318549076 100644 (file)
@@ -185,17 +185,17 @@ int aac_send_shutdown(struct aac_dev * dev)
        struct aac_close *cmd;
        int status;
 
-       fibctx = fib_alloc(dev);
+       fibctx = aac_fib_alloc(dev);
        if (!fibctx)
                return -ENOMEM;
-       fib_init(fibctx);
+       aac_fib_init(fibctx);
 
        cmd = (struct aac_close *) fib_data(fibctx);
 
        cmd->command = cpu_to_le32(VM_CloseAll);
        cmd->cid = cpu_to_le32(0xffffffff);
 
-       status = fib_send(ContainerCommand,
+       status = aac_fib_send(ContainerCommand,
                          fibctx,
                          sizeof(struct aac_close),
                          FsaNormal,
@@ -203,8 +203,8 @@ int aac_send_shutdown(struct aac_dev * dev)
                          NULL, NULL);
 
        if (status == 0)
-               fib_complete(fibctx);
-       fib_free(fibctx);
+               aac_fib_complete(fibctx);
+       aac_fib_free(fibctx);
        return status;
 }
 
@@ -427,7 +427,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
        /*
         *      Initialize the list of fibs
         */
-       if(fib_setup(dev)<0){
+       if (aac_fib_setup(dev) < 0) {
                kfree(dev->queues);
                return NULL;
        }
index 014cc8d54a9fc26861598a3f9182f763476dd5c5..609fd19b18449d69fdcfe403e2035a9f54e780e4 100644 (file)
@@ -67,27 +67,27 @@ static int fib_map_alloc(struct aac_dev *dev)
 }
 
 /**
- *     fib_map_free            -       free the fib objects
+ *     aac_fib_map_free                -       free the fib objects
  *     @dev: Adapter to free
  *
  *     Free the PCI mappings and the memory allocated for FIB blocks
  *     on this adapter.
  */
 
-void fib_map_free(struct aac_dev *dev)
+void aac_fib_map_free(struct aac_dev *dev)
 {
        pci_free_consistent(dev->pdev, dev->max_fib_size * (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB), dev->hw_fib_va, dev->hw_fib_pa);
 }
 
 /**
- *     fib_setup       -       setup the fibs
+ *     aac_fib_setup   -       setup the fibs
  *     @dev: Adapter to set up
  *
  *     Allocate the PCI space for the fibs, map it and then intialise the
  *     fib area, the unmapped fib data and also the free list
  */
 
-int fib_setup(struct aac_dev * dev)
+int aac_fib_setup(struct aac_dev * dev)
 {
        struct fib *fibptr;
        struct hw_fib *hw_fib_va;
@@ -134,14 +134,14 @@ int fib_setup(struct aac_dev * dev)
 }
 
 /**
- *     fib_alloc       -       allocate a fib
+ *     aac_fib_alloc   -       allocate a fib
  *     @dev: Adapter to allocate the fib for
  *
  *     Allocate a fib from the adapter fib pool. If the pool is empty we
  *     return NULL.
  */
  
-struct fib * fib_alloc(struct aac_dev *dev)
+struct fib *aac_fib_alloc(struct aac_dev *dev)
 {
        struct fib * fibptr;
        unsigned long flags;
@@ -170,14 +170,14 @@ struct fib * fib_alloc(struct aac_dev *dev)
 }
 
 /**
- *     fib_free        -       free a fib
+ *     aac_fib_free    -       free a fib
  *     @fibptr: fib to free up
  *
  *     Frees up a fib and places it on the appropriate queue
  *     (either free or timed out)
  */
  
-void fib_free(struct fib * fibptr)
+void aac_fib_free(struct fib *fibptr)
 {
        unsigned long flags;
 
@@ -188,7 +188,7 @@ void fib_free(struct fib * fibptr)
                fibptr->dev->timeout_fib = fibptr;
        } else {
                if (fibptr->hw_fib->header.XferState != 0) {
-                       printk(KERN_WARNING "fib_free, XferState != 0, fibptr = 0x%p, XferState = 0x%x\n", 
+                       printk(KERN_WARNING "aac_fib_free, XferState != 0, fibptr = 0x%p, XferState = 0x%x\n",
                                 (void*)fibptr, 
                                 le32_to_cpu(fibptr->hw_fib->header.XferState));
                }
@@ -199,13 +199,13 @@ void fib_free(struct fib * fibptr)
 }
 
 /**
- *     fib_init        -       initialise a fib
+ *     aac_fib_init    -       initialise a fib
  *     @fibptr: The fib to initialize
  *     
  *     Set up the generic fib fields ready for use
  */
  
-void fib_init(struct fib *fibptr)
+void aac_fib_init(struct fib *fibptr)
 {
        struct hw_fib *hw_fib = fibptr->hw_fib;
 
@@ -362,7 +362,7 @@ static int aac_queue_get(struct aac_dev * dev, u32 * index, u32 qid, struct hw_f
  */
 
 /**
- *     fib_send        -       send a fib to the adapter
+ *     aac_fib_send    -       send a fib to the adapter
  *     @command: Command to send
  *     @fibptr: The fib
  *     @size: Size of fib data area
@@ -378,7 +378,9 @@ static int aac_queue_get(struct aac_dev * dev, u32 * index, u32 qid, struct hw_f
  *     response FIB is received from the adapter.
  */
  
-int fib_send(u16 command, struct fib * fibptr, unsigned long size,  int priority, int wait, int reply, fib_callback callback, void * callback_data)
+int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
+               int priority, int wait, int reply, fib_callback callback,
+               void *callback_data)
 {
        struct aac_dev * dev = fibptr->dev;
        struct hw_fib * hw_fib = fibptr->hw_fib;
@@ -493,7 +495,7 @@ int fib_send(u16 command, struct fib * fibptr, unsigned long size,  int priority
                q->numpending++;
                *(q->headers.producer) = cpu_to_le32(index + 1);
                spin_unlock_irqrestore(q->lock, qflags);
-               dprintk((KERN_DEBUG "fib_send: inserting a queue entry at index %d.\n",index));
+               dprintk((KERN_DEBUG "aac_fib_send: inserting a queue entry at index %d.\n",index));
                if (!(nointr & aac_config.irq_mod))
                        aac_adapter_notify(dev, AdapNormCmdQueue);
        }
@@ -520,7 +522,7 @@ int fib_send(u16 command, struct fib * fibptr, unsigned long size,  int priority
                                        list_del(&fibptr->queue);
                                        spin_unlock_irqrestore(q->lock, qflags);
                                        if (wait == -1) {
-                                               printk(KERN_ERR "aacraid: fib_send: first asynchronous command timed out.\n"
+                                               printk(KERN_ERR "aacraid: aac_fib_send: first asynchronous command timed out.\n"
                                                  "Usually a result of a PCI interrupt routing problem;\n"
                                                  "update mother board BIOS or consider utilizing one of\n"
                                                  "the SAFE mode kernel options (acpi, apic etc)\n");
@@ -624,7 +626,7 @@ void aac_consumer_free(struct aac_dev * dev, struct aac_queue *q, u32 qid)
 }        
 
 /**
- *     fib_adapter_complete    -       complete adapter issued fib
+ *     aac_fib_adapter_complete        -       complete adapter issued fib
  *     @fibptr: fib to complete
  *     @size: size of fib
  *
@@ -632,7 +634,7 @@ void aac_consumer_free(struct aac_dev * dev, struct aac_queue *q, u32 qid)
  *     the adapter.
  */
 
-int fib_adapter_complete(struct fib * fibptr, unsigned short size)
+int aac_fib_adapter_complete(struct fib *fibptr, unsigned short size)
 {
        struct hw_fib * hw_fib = fibptr->hw_fib;
        struct aac_dev * dev = fibptr->dev;
@@ -683,20 +685,20 @@ int fib_adapter_complete(struct fib * fibptr, unsigned short size)
        }
        else 
        {
-               printk(KERN_WARNING "fib_adapter_complete: Unknown xferstate detected.\n");
+               printk(KERN_WARNING "aac_fib_adapter_complete: Unknown xferstate detected.\n");
                BUG();
        }   
        return 0;
 }
 
 /**
- *     fib_complete    -       fib completion handler
+ *     aac_fib_complete        -       fib completion handler
  *     @fib: FIB to complete
  *
  *     Will do all necessary work to complete a FIB.
  */
  
-int fib_complete(struct fib * fibptr)
+int aac_fib_complete(struct fib *fibptr)
 {
        struct hw_fib * hw_fib = fibptr->hw_fib;
 
@@ -995,14 +997,14 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
        if (!dev || !dev->scsi_host_ptr)
                return;
        /*
-        * force reload of disk info via probe_container
+        * force reload of disk info via aac_probe_container
         */
        if ((device_config_needed == CHANGE)
         && (dev->fsa_dev[container].valid == 1))
                dev->fsa_dev[container].valid = 2;
        if ((device_config_needed == CHANGE) ||
                        (device_config_needed == ADD))
-               probe_container(dev, container);
+               aac_probe_container(dev, container);
        device = scsi_device_lookup(dev->scsi_host_ptr, 
                CONTAINER_TO_CHANNEL(container), 
                CONTAINER_TO_ID(container), 
@@ -1104,7 +1106,7 @@ int aac_command_thread(struct aac_dev * dev)
                                /* Handle Driver Notify Events */
                                aac_handle_aif(dev, fib);
                                *(__le32 *)hw_fib->data = cpu_to_le32(ST_OK);
-                               fib_adapter_complete(fib, (u16)sizeof(u32));
+                               aac_fib_adapter_complete(fib, (u16)sizeof(u32));
                        } else {
                                struct list_head *entry;
                                /* The u32 here is important and intended. We are using
@@ -1241,7 +1243,7 @@ int aac_command_thread(struct aac_dev * dev)
                                 *      Set the status of this FIB
                                 */
                                *(__le32 *)hw_fib->data = cpu_to_le32(ST_OK);
-                               fib_adapter_complete(fib, sizeof(u32));
+                               aac_fib_adapter_complete(fib, sizeof(u32));
                                spin_unlock_irqrestore(&dev->fib_lock, flagv);
                                /* Free up the remaining resources */
                                hw_fib_p = hw_fib_pool;
index 439948ef82516535d66e2cec3df0e515530e119a..f6bcb9486f859897464bd649a4758403a8936488 100644 (file)
@@ -206,7 +206,7 @@ unsigned int aac_command_normal(struct aac_queue *q)
                         *      Set the status of this FIB
                         */
                        *(__le32 *)hw_fib->data = cpu_to_le32(ST_OK);
-                       fib_adapter_complete(fib, sizeof(u32));
+                       aac_fib_adapter_complete(fib, sizeof(u32));
                        spin_lock_irqsave(q->lock, flags);
                }               
        }
index 0bf5f9a943e8a548d779b022246d63348f5c3c77..2716178905625911a1364dd559b7f3907e1846a9 100644 (file)
@@ -385,17 +385,45 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev,
 
 static int aac_slave_configure(struct scsi_device *sdev)
 {
-       struct Scsi_Host *host = sdev->host;
+       if (sdev_channel(sdev) == CONTAINER_CHANNEL) {
+               sdev->skip_ms_page_8 = 1;
+               sdev->skip_ms_page_3f = 1;
+       }
+       if ((sdev->type == TYPE_DISK) &&
+                       (sdev_channel(sdev) != CONTAINER_CHANNEL)) {
+               struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata;
+               if (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2))
+                       sdev->no_uld_attach = 1;
+       }
+       if (sdev->tagged_supported && (sdev->type == TYPE_DISK) &&
+                       (sdev_channel(sdev) == CONTAINER_CHANNEL)) {
+               struct scsi_device * dev;
+               struct Scsi_Host *host = sdev->host;
+               unsigned num_lsu = 0;
+               unsigned num_one = 0;
+               unsigned depth;
 
-       if (sdev->tagged_supported)
-               scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, 128);
-       else
+               __shost_for_each_device(dev, host) {
+                       if (dev->tagged_supported && (dev->type == TYPE_DISK) &&
+                               (sdev_channel(dev) == CONTAINER_CHANNEL))
+                               ++num_lsu;
+                       else
+                               ++num_one;
+               }
+               if (num_lsu == 0)
+                       ++num_lsu;
+               depth = (host->can_queue - num_one) / num_lsu;
+               if (depth > 256)
+                       depth = 256;
+               else if (depth < 2)
+                       depth = 2;
+               scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, depth);
+               if (!(((struct aac_dev *)host->hostdata)->adapter_info.options &
+                               AAC_OPT_NEW_COMM))
+                       blk_queue_max_segment_size(sdev->request_queue, 65536);
+       } else
                scsi_adjust_queue_depth(sdev, 0, 1);
 
-       if (!(((struct aac_dev *)host->hostdata)->adapter_info.options
-         & AAC_OPT_NEW_COMM))
-               blk_queue_max_segment_size(sdev->request_queue, 65536);
-
        return 0;
 }
 
@@ -870,7 +898,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
  
        /*
         * max channel will be the physical channels plus 1 virtual channel
-        * all containers are on the virtual channel 0
+        * all containers are on the virtual channel 0 (CONTAINER_CHANNEL)
         * physical channels are address by their actual physical number+1
         */
        if (aac->nondasd_support == 1)
@@ -913,7 +941,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
        aac_adapter_disable_int(aac);
        free_irq(pdev->irq, aac);
  out_unmap:
-       fib_map_free(aac);
+       aac_fib_map_free(aac);
        pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys);
        kfree(aac->queues);
        iounmap(aac->regs.sa);
@@ -947,7 +975,7 @@ static void __devexit aac_remove_one(struct pci_dev *pdev)
 
        aac_send_shutdown(aac);
        aac_adapter_disable_int(aac);
-       fib_map_free(aac);
+       aac_fib_map_free(aac);
        pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr,
                        aac->comm_phys);
        kfree(aac->queues);
index bd3ffdf6c800088d5e6de6b915a6727eaa912757..62e3cda859afccb44dda94dc9c2a6d2ab0a18d31 100644 (file)
@@ -2816,7 +2816,7 @@ static int gdth_fill_cache_cmd(int hanum,Scsi_Cmnd *scp,ushort hdrive)
             }
 #endif
 
-        } else {
+        } else if (scp->request_bufflen) {
             scp->SCp.Status = GDTH_MAP_SINGLE;
             scp->SCp.Message = (read_write == 1 ? 
                 PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE);
index 27acf78cf8d8c580c0f24a56f15a20bc04f989c9..2bba5e55d7bc6110d44aa6720280e12d4b79cbe6 100644 (file)
@@ -4235,35 +4235,6 @@ static void ipr_scsi_done(struct ipr_cmnd *ipr_cmd)
                ipr_erp_start(ioa_cfg, ipr_cmd);
 }
 
-/**
- * ipr_save_ioafp_mode_select - Save adapters mode select data
- * @ioa_cfg:   ioa config struct
- * @scsi_cmd:  scsi command struct
- *
- * This function saves mode select data for the adapter to
- * use following an adapter reset.
- *
- * Return value:
- *     0 on success / SCSI_MLQUEUE_HOST_BUSY on failure
- **/
-static int ipr_save_ioafp_mode_select(struct ipr_ioa_cfg *ioa_cfg,
-                                      struct scsi_cmnd *scsi_cmd)
-{
-       if (!ioa_cfg->saved_mode_pages) {
-               ioa_cfg->saved_mode_pages  = kmalloc(sizeof(struct ipr_mode_pages),
-                                                    GFP_ATOMIC);
-               if (!ioa_cfg->saved_mode_pages) {
-                       dev_err(&ioa_cfg->pdev->dev,
-                               "IOA mode select buffer allocation failed\n");
-                       return SCSI_MLQUEUE_HOST_BUSY;
-               }
-       }
-
-       memcpy(ioa_cfg->saved_mode_pages, scsi_cmd->buffer, scsi_cmd->cmnd[4]);
-       ioa_cfg->saved_mode_page_len = scsi_cmd->cmnd[4];
-       return 0;
-}
-
 /**
  * ipr_queuecommand - Queue a mid-layer request
  * @scsi_cmd:  scsi command struct
@@ -4338,9 +4309,6 @@ static int ipr_queuecommand(struct scsi_cmnd *scsi_cmd,
            (!ipr_is_gscsi(res) || scsi_cmd->cmnd[0] == IPR_QUERY_RSRC_STATE))
                ioarcb->cmd_pkt.request_type = IPR_RQTYPE_IOACMD;
 
-       if (ipr_is_ioa_resource(res) && scsi_cmd->cmnd[0] == MODE_SELECT)
-               rc = ipr_save_ioafp_mode_select(ioa_cfg, scsi_cmd);
-
        if (likely(rc == 0))
                rc = ipr_build_ioadl(ioa_cfg, ipr_cmd);
 
@@ -4829,17 +4797,11 @@ static int ipr_ioafp_mode_select_page28(struct ipr_cmnd *ipr_cmd)
        int length;
 
        ENTER;
-       if (ioa_cfg->saved_mode_pages) {
-               memcpy(mode_pages, ioa_cfg->saved_mode_pages,
-                      ioa_cfg->saved_mode_page_len);
-               length = ioa_cfg->saved_mode_page_len;
-       } else {
-               ipr_scsi_bus_speed_limit(ioa_cfg);
-               ipr_check_term_power(ioa_cfg, mode_pages);
-               ipr_modify_ioafp_mode_page_28(ioa_cfg, mode_pages);
-               length = mode_pages->hdr.length + 1;
-               mode_pages->hdr.length = 0;
-       }
+       ipr_scsi_bus_speed_limit(ioa_cfg);
+       ipr_check_term_power(ioa_cfg, mode_pages);
+       ipr_modify_ioafp_mode_page_28(ioa_cfg, mode_pages);
+       length = mode_pages->hdr.length + 1;
+       mode_pages->hdr.length = 0;
 
        ipr_build_mode_select(ipr_cmd, cpu_to_be32(IPR_IOA_RES_HANDLE), 0x11,
                              ioa_cfg->vpd_cbs_dma + offsetof(struct ipr_misc_cbs, mode_pages),
@@ -5969,7 +5931,6 @@ static void ipr_free_mem(struct ipr_ioa_cfg *ioa_cfg)
        }
 
        ipr_free_dump(ioa_cfg);
-       kfree(ioa_cfg->saved_mode_pages);
        kfree(ioa_cfg->trace);
 }
 
index b639332131f1b8cb7dd251cfbdf58af919553a55..fd360bfe56dda32627d97babf3a1d92d2d000b54 100644 (file)
@@ -36,8 +36,8 @@
 /*
  * Literals
  */
-#define IPR_DRIVER_VERSION "2.1.1"
-#define IPR_DRIVER_DATE "(November 15, 2005)"
+#define IPR_DRIVER_VERSION "2.1.2"
+#define IPR_DRIVER_DATE "(February 8, 2006)"
 
 /*
  * IPR_MAX_CMD_PER_LUN: This defines the maximum number of outstanding
@@ -1000,7 +1000,6 @@ struct ipr_ioa_cfg {
        struct Scsi_Host *host;
        struct pci_dev *pdev;
        struct ipr_sglist *ucode_sglist;
-       struct ipr_mode_pages *saved_mode_pages;
        u8 saved_mode_page_len;
 
        struct work_struct work_q;
index 780bfcc67096cff51069cf94bc1e4ae6374ceafe..ff79e68b347c5c15828884991ff03a74902099fe 100644 (file)
@@ -146,7 +146,7 @@ iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err)
        spin_unlock_irqrestore(&session->lock, flags);
        set_bit(SUSPEND_BIT, &conn->suspend_tx);
        set_bit(SUSPEND_BIT, &conn->suspend_rx);
-       iscsi_conn_error(iscsi_handle(conn), err);
+       iscsi_conn_error(conn->cls_conn, err);
 }
 
 static inline int
@@ -244,12 +244,10 @@ iscsi_ctask_cleanup(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask)
        if (sc->sc_data_direction == DMA_TO_DEVICE) {
                struct iscsi_data_task *dtask, *n;
                /* WRITE: cleanup Data-Out's if any */
-               spin_lock(&conn->lock);
                list_for_each_entry_safe(dtask, n, &ctask->dataqueue, item) {
                        list_del(&dtask->item);
                        mempool_free(dtask, ctask->datapool);
                }
-               spin_unlock(&conn->lock);
        }
        ctask->xmstate = XMSTATE_IDLE;
        ctask->r2t = NULL;
@@ -689,7 +687,7 @@ iscsi_hdr_recv(struct iscsi_conn *conn)
                                break;
 
                        if (!conn->in.datalen) {
-                               rc = iscsi_recv_pdu(iscsi_handle(conn), hdr,
+                               rc = iscsi_recv_pdu(conn->cls_conn, hdr,
                                                    NULL, 0);
                                if (conn->login_mtask != mtask) {
                                        spin_lock(&session->lock);
@@ -737,7 +735,7 @@ iscsi_hdr_recv(struct iscsi_conn *conn)
                        if (!conn->in.datalen) {
                                struct iscsi_mgmt_task *mtask;
 
-                               rc = iscsi_recv_pdu(iscsi_handle(conn), hdr,
+                               rc = iscsi_recv_pdu(conn->cls_conn, hdr,
                                                    NULL, 0);
                                mtask = (struct iscsi_mgmt_task *)
                                        session->mgmt_cmds[conn->in.itt -
@@ -761,7 +759,7 @@ iscsi_hdr_recv(struct iscsi_conn *conn)
                                rc = iscsi_check_assign_cmdsn(session,
                                                 (struct iscsi_nopin*)hdr);
                                if (!rc && hdr->ttt != ISCSI_RESERVED_TAG)
-                                       rc = iscsi_recv_pdu(iscsi_handle(conn),
+                                       rc = iscsi_recv_pdu(conn->cls_conn,
                                                            hdr, NULL, 0);
                        } else
                                rc = ISCSI_ERR_PROTO;
@@ -1044,7 +1042,7 @@ iscsi_data_recv(struct iscsi_conn *conn)
                        goto exit;
                }
 
-               rc = iscsi_recv_pdu(iscsi_handle(conn), conn->in.hdr,
+               rc = iscsi_recv_pdu(conn->cls_conn, conn->in.hdr,
                                    conn->data, conn->in.datalen);
 
                if (!rc && conn->datadgst_en &&
@@ -2428,19 +2426,20 @@ iscsi_pool_free(struct iscsi_queue *q, void **items)
 }
 
 static struct iscsi_cls_conn *
-iscsi_conn_create(struct Scsi_Host *shost, uint32_t conn_idx)
+iscsi_conn_create(struct iscsi_cls_session *cls_session, uint32_t conn_idx)
 {
+       struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
        struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
        struct iscsi_conn *conn;
        struct iscsi_cls_conn *cls_conn;
 
-       cls_conn = iscsi_create_conn(hostdata_session(shost->hostdata),
-                                    conn_idx);
+       cls_conn = iscsi_create_conn(cls_session, conn_idx);
        if (!cls_conn)
                return NULL;
        conn = cls_conn->dd_data;
+       memset(conn, 0, sizeof(*conn));
 
-       memset(conn, 0, sizeof(struct iscsi_conn));
+       conn->cls_conn = cls_conn;
        conn->c_stage = ISCSI_CONN_INITIAL_STAGE;
        conn->in_progress = IN_PROGRESS_WAIT_HEADER;
        conn->id = conn_idx;
@@ -2452,8 +2451,6 @@ iscsi_conn_create(struct Scsi_Host *shost, uint32_t conn_idx)
        conn->data_size = DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH;
        conn->max_recv_dlength = DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH;
 
-       spin_lock_init(&conn->lock);
-
        /* initialize general xmit PDU commands queue */
        conn->xmitqueue = kfifo_alloc(session->cmds_max * sizeof(void*),
                                        GFP_KERNEL, NULL);
@@ -2625,11 +2622,13 @@ iscsi_conn_destroy(struct iscsi_cls_conn *cls_conn)
 }
 
 static int
-iscsi_conn_bind(iscsi_sessionh_t sessionh, iscsi_connh_t connh,
-               uint32_t transport_fd, int is_leading)
+iscsi_conn_bind(struct iscsi_cls_session *cls_session,
+               struct iscsi_cls_conn *cls_conn, uint32_t transport_fd,
+               int is_leading)
 {
-       struct iscsi_session *session = iscsi_ptr(sessionh);
-       struct iscsi_conn *tmp = ERR_PTR(-EEXIST), *conn = iscsi_ptr(connh);
+       struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
+       struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
+       struct iscsi_conn *tmp = ERR_PTR(-EEXIST), *conn = cls_conn->dd_data;
        struct sock *sk;
        struct socket *sock;
        int err;
@@ -2703,9 +2702,9 @@ iscsi_conn_bind(iscsi_sessionh_t sessionh, iscsi_connh_t connh,
 }
 
 static int
-iscsi_conn_start(iscsi_connh_t connh)
+iscsi_conn_start(struct iscsi_cls_conn *cls_conn)
 {
-       struct iscsi_conn *conn = iscsi_ptr(connh);
+       struct iscsi_conn *conn = cls_conn->dd_data;
        struct iscsi_session *session = conn->session;
        struct sock *sk;
 
@@ -2754,9 +2753,9 @@ iscsi_conn_start(iscsi_connh_t connh)
 }
 
 static void
-iscsi_conn_stop(iscsi_connh_t connh, int flag)
+iscsi_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
 {
-       struct iscsi_conn *conn = iscsi_ptr(connh);
+       struct iscsi_conn *conn = cls_conn->dd_data;
        struct iscsi_session *session = conn->session;
        struct sock *sk;
        unsigned long flags;
@@ -3253,9 +3252,9 @@ static struct scsi_host_template iscsi_sht = {
 
 static struct iscsi_transport iscsi_tcp_transport;
 
-static struct Scsi_Host *
+static struct iscsi_cls_session *
 iscsi_session_create(struct scsi_transport_template *scsit,
-                    uint32_t initial_cmdsn)
+                    uint32_t initial_cmdsn, uint32_t *sid)
 {
        struct Scsi_Host *shost;
        struct iscsi_session *session;
@@ -3268,13 +3267,14 @@ iscsi_session_create(struct scsi_transport_template *scsit,
        session = iscsi_hostdata(shost->hostdata);
        memset(session, 0, sizeof(struct iscsi_session));
        session->host = shost;
-       session->state = ISCSI_STATE_LOGGED_IN;
+       session->state = ISCSI_STATE_FREE;
        session->mgmtpool_max = ISCSI_MGMT_CMDS_MAX;
        session->cmds_max = ISCSI_XMIT_CMDS_MAX;
        session->cmdsn = initial_cmdsn;
        session->exp_cmdsn = initial_cmdsn + 1;
        session->max_cmdsn = initial_cmdsn + 1;
        session->max_r2t = 1;
+       *sid = shost->host_no;
 
        /* initialize SCSI PDU commands pool */
        if (iscsi_pool_init(&session->cmdpool, session->cmds_max,
@@ -3311,22 +3311,24 @@ iscsi_session_create(struct scsi_transport_template *scsit,
        if (iscsi_r2tpool_alloc(session))
                goto r2tpool_alloc_fail;
 
-       return shost;
+       return hostdata_session(shost->hostdata);
 
 r2tpool_alloc_fail:
        for (cmd_i = 0; cmd_i < session->mgmtpool_max; cmd_i++)
                kfree(session->mgmt_cmds[cmd_i]->data);
-       iscsi_pool_free(&session->mgmtpool, (void**)session->mgmt_cmds);
 immdata_alloc_fail:
+       iscsi_pool_free(&session->mgmtpool, (void**)session->mgmt_cmds);
 mgmtpool_alloc_fail:
        iscsi_pool_free(&session->cmdpool, (void**)session->cmds);
 cmdpool_alloc_fail:
+       iscsi_transport_destroy_session(shost);
        return NULL;
 }
 
 static void
-iscsi_session_destroy(struct Scsi_Host *shost)
+iscsi_session_destroy(struct iscsi_cls_session *cls_session)
 {
+       struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
        struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
        int cmd_i;
        struct iscsi_data_task *dtask, *n;
@@ -3350,10 +3352,10 @@ iscsi_session_destroy(struct Scsi_Host *shost)
 }
 
 static int
-iscsi_conn_set_param(iscsi_connh_t connh, enum iscsi_param param,
+iscsi_conn_set_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param,
                     uint32_t value)
 {
-       struct iscsi_conn *conn = iscsi_ptr(connh);
+       struct iscsi_conn *conn = cls_conn->dd_data;
        struct iscsi_session *session = conn->session;
 
        spin_lock_bh(&session->lock);
@@ -3495,9 +3497,10 @@ iscsi_conn_set_param(iscsi_connh_t connh, enum iscsi_param param,
 }
 
 static int
-iscsi_session_get_param(struct Scsi_Host *shost,
+iscsi_session_get_param(struct iscsi_cls_session *cls_session,
                        enum iscsi_param param, uint32_t *value)
 {
+       struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
        struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
 
        switch(param) {
@@ -3539,9 +3542,10 @@ iscsi_session_get_param(struct Scsi_Host *shost,
 }
 
 static int
-iscsi_conn_get_param(void *data, enum iscsi_param param, uint32_t *value)
+iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
+                    enum iscsi_param param, uint32_t *value)
 {
-       struct iscsi_conn *conn = data;
+       struct iscsi_conn *conn = cls_conn->dd_data;
 
        switch(param) {
        case ISCSI_PARAM_MAX_RECV_DLENGTH:
@@ -3564,9 +3568,9 @@ iscsi_conn_get_param(void *data, enum iscsi_param param, uint32_t *value)
 }
 
 static void
-iscsi_conn_get_stats(iscsi_connh_t connh, struct iscsi_stats *stats)
+iscsi_conn_get_stats(struct iscsi_cls_conn *cls_conn, struct iscsi_stats *stats)
 {
-       struct iscsi_conn *conn = iscsi_ptr(connh);
+       struct iscsi_conn *conn = cls_conn->dd_data;
 
        stats->txdata_octets = conn->txdata_octets;
        stats->rxdata_octets = conn->rxdata_octets;
@@ -3587,10 +3591,10 @@ iscsi_conn_get_stats(iscsi_connh_t connh, struct iscsi_stats *stats)
 }
 
 static int
-iscsi_conn_send_pdu(iscsi_connh_t connh, struct iscsi_hdr *hdr, char *data,
-                   uint32_t data_size)
+iscsi_conn_send_pdu(struct iscsi_cls_conn *cls_conn, struct iscsi_hdr *hdr,
+                   char *data, uint32_t data_size)
 {
-       struct iscsi_conn *conn = iscsi_ptr(connh);
+       struct iscsi_conn *conn = cls_conn->dd_data;
        int rc;
 
        mutex_lock(&conn->xmitmutex);
index f95e61b76f70baf3ba5bdd45906439db5971c4ba..ba26741ac1544bd41ec348b95579432471d5d75b 100644 (file)
@@ -113,7 +113,10 @@ struct iscsi_tcp_recv {
        int                     datadgst;
 };
 
+struct iscsi_cls_conn;
+
 struct iscsi_conn {
+       struct iscsi_cls_conn   *cls_conn;      /* ptr to class connection */
        struct iscsi_hdr        hdr;            /* header placeholder */
        char                    hdrext[4*sizeof(__u16) +
                                    sizeof(__u32)];
@@ -143,7 +146,6 @@ struct iscsi_conn {
        struct iscsi_mgmt_task  *login_mtask;   /* mtask used for login/text */
        struct iscsi_mgmt_task  *mtask;         /* xmit mtask in progress */
        struct iscsi_cmd_task   *ctask;         /* xmit ctask in progress */
-       spinlock_t              lock;           /* FIXME: to be removed */
 
        /* old values for socket callbacks */
        void                    (*old_data_ready)(struct sock *, int);
index d101a8a6f4e86f4206bd3f70697af1f3506158ff..7144674bc8e677adae796bef8ed8a5cea0e0f323 100644 (file)
@@ -5049,7 +5049,7 @@ static struct pci_device_id megaraid_pci_tbl[] = {
 MODULE_DEVICE_TABLE(pci, megaraid_pci_tbl);
 
 static struct pci_driver megaraid_pci_driver = {
-       .name           = "megaraid",
+       .name           = "megaraid_legacy",
        .id_table       = megaraid_pci_tbl,
        .probe          = megaraid_probe_one,
        .remove         = __devexit_p(megaraid_remove_one),
index 4b3e0d6e5afacc6fbc05ae1085b2c02fcbe9fb28..4b75fe619d9cf44c7758d8636cfa47f453891bac 100644 (file)
@@ -5,7 +5,7 @@
 #include <linux/mutex.h>
 
 #define MEGARAID_VERSION       \
-       "v2.00.3 (Release Date: Wed Feb 19 08:51:30 EST 2003)\n"
+       "v2.00.4 (Release Date: Thu Feb 9 08:51:30 EST 2006)\n"
 
 /*
  * Driver features - change the values to enable or disable features in the
index a487f414960e5e9a6553c7c1b7dc7fe2042253c2..7de267e14458ba0bafaa1138c54537796c269bff 100644 (file)
@@ -10,7 +10,7 @@
  *        2 of the License, or (at your option) any later version.
  *
  * FILE                : megaraid_sas.c
- * Version     : v00.00.02.02
+ * Version     : v00.00.02.04
  *
  * Authors:
  *     Sreenivas Bagalkote     <Sreenivas.Bagalkote@lsil.com>
@@ -59,6 +59,12 @@ static struct pci_device_id megasas_pci_table[] = {
         PCI_ANY_ID,
         PCI_ANY_ID,
         },
+       {
+        PCI_VENDOR_ID_LSI_LOGIC,
+        PCI_DEVICE_ID_LSI_SAS1078R, // ppc IOP
+        PCI_ANY_ID,
+        PCI_ANY_ID,
+       },
        {
         PCI_VENDOR_ID_DELL,
         PCI_DEVICE_ID_DELL_PERC5, // xscale IOP
@@ -198,6 +204,86 @@ static struct megasas_instance_template megasas_instance_template_xscale = {
 *      to xscale (deviceid : 1064R, PERC5) controllers
 */
 
+/**
+*      The following functions are defined for ppc (deviceid : 0x60) 
+*      controllers
+*/
+
+/**
+ * megasas_enable_intr_ppc -   Enables interrupts
+ * @regs:                      MFI register set
+ */
+static inline void
+megasas_enable_intr_ppc(struct megasas_register_set __iomem * regs)
+{
+       writel(0xFFFFFFFF, &(regs)->outbound_doorbell_clear);
+    
+       writel(~0x80000004, &(regs)->outbound_intr_mask);
+
+       /* Dummy readl to force pci flush */
+       readl(&regs->outbound_intr_mask);
+}
+
+/**
+ * megasas_read_fw_status_reg_ppc - returns the current FW status value
+ * @regs:                      MFI register set
+ */
+static u32
+megasas_read_fw_status_reg_ppc(struct megasas_register_set __iomem * regs)
+{
+       return readl(&(regs)->outbound_scratch_pad);
+}
+
+/**
+ * megasas_clear_interrupt_ppc -       Check & clear interrupt
+ * @regs:                              MFI register set
+ */
+static int 
+megasas_clear_intr_ppc(struct megasas_register_set __iomem * regs)
+{
+       u32 status;
+       /*
+        * Check if it is our interrupt
+        */
+       status = readl(&regs->outbound_intr_status);
+
+       if (!(status & MFI_REPLY_1078_MESSAGE_INTERRUPT)) {
+               return 1;
+       }
+
+       /*
+        * Clear the interrupt by writing back the same value
+        */
+       writel(status, &regs->outbound_doorbell_clear);
+
+       return 0;
+}
+/**
+ * megasas_fire_cmd_ppc -      Sends command to the FW
+ * @frame_phys_addr :          Physical address of cmd
+ * @frame_count :              Number of frames for the command
+ * @regs :                     MFI register set
+ */
+static inline void 
+megasas_fire_cmd_ppc(dma_addr_t frame_phys_addr, u32 frame_count, struct megasas_register_set __iomem *regs)
+{
+       writel((frame_phys_addr | (frame_count<<1))|1, 
+                       &(regs)->inbound_queue_port);
+}
+
+static struct megasas_instance_template megasas_instance_template_ppc = {
+       
+       .fire_cmd = megasas_fire_cmd_ppc,
+       .enable_intr = megasas_enable_intr_ppc,
+       .clear_intr = megasas_clear_intr_ppc,
+       .read_fw_status_reg = megasas_read_fw_status_reg_ppc,
+};
+
+/**
+*      This is the end of set of functions & definitions
+*      specific to ppc (deviceid : 0x60) controllers
+*/
+
 /**
  * megasas_disable_intr -      Disables interrupts
  * @regs:                      MFI register set
@@ -1607,7 +1693,17 @@ static int megasas_init_mfi(struct megasas_instance *instance)
 
        reg_set = instance->reg_set;
 
-       instance->instancet = &megasas_instance_template_xscale;
+       switch(instance->pdev->device)
+       {
+               case PCI_DEVICE_ID_LSI_SAS1078R:        
+                       instance->instancet = &megasas_instance_template_ppc;
+                       break;
+               case PCI_DEVICE_ID_LSI_SAS1064R:
+               case PCI_DEVICE_ID_DELL_PERC5:
+               default:
+                       instance->instancet = &megasas_instance_template_xscale;
+                       break;
+       }
 
        /*
         * We expect the FW state to be READY
@@ -1983,6 +2079,7 @@ static int megasas_io_attach(struct megasas_instance *instance)
        host->max_channel = MEGASAS_MAX_CHANNELS - 1;
        host->max_id = MEGASAS_MAX_DEV_PER_CHANNEL;
        host->max_lun = MEGASAS_MAX_LUN;
+       host->max_cmd_len = 16;
 
        /*
         * Notify the mid-layer about the new controller
index d6d166c0663ff664930b06432b4c2753c93631b3..89639f0c38ef2e3683f012328a763dd4755f6123 100644 (file)
@@ -18,9 +18,9 @@
 /**
  * MegaRAID SAS Driver meta data
  */
-#define MEGASAS_VERSION                                "00.00.02.02"
-#define MEGASAS_RELDATE                                "Jan 23, 2006"
-#define MEGASAS_EXT_VERSION                    "Mon Jan 23 14:09:01 PST 2006"
+#define MEGASAS_VERSION                                "00.00.02.04"
+#define MEGASAS_RELDATE                                "Feb 03, 2006"
+#define MEGASAS_EXT_VERSION                    "Fri Feb 03 14:31:44 PST 2006"
 /*
  * =====================================
  * MegaRAID SAS MFI firmware definitions
@@ -553,31 +553,46 @@ struct megasas_ctrl_info {
 #define MFI_OB_INTR_STATUS_MASK                        0x00000002
 #define MFI_POLL_TIMEOUT_SECS                  10
 
+#define MFI_REPLY_1078_MESSAGE_INTERRUPT       0x80000000
+#define PCI_DEVICE_ID_LSI_SAS1078R             0x00000060
 struct megasas_register_set {
+       u32     reserved_0[4];                  /*0000h*/
 
-       u32 reserved_0[4];      /*0000h */
+       u32     inbound_msg_0;                  /*0010h*/
+       u32     inbound_msg_1;                  /*0014h*/
+       u32     outbound_msg_0;                 /*0018h*/
+       u32     outbound_msg_1;                 /*001Ch*/
 
-       u32 inbound_msg_0;      /*0010h */
-       u32 inbound_msg_1;      /*0014h */
-       u32 outbound_msg_0;     /*0018h */
-       u32 outbound_msg_1;     /*001Ch */
+       u32     inbound_doorbell;               /*0020h*/
+       u32     inbound_intr_status;            /*0024h*/
+       u32     inbound_intr_mask;              /*0028h*/
 
-       u32 inbound_doorbell;   /*0020h */
-       u32 inbound_intr_status;        /*0024h */
-       u32 inbound_intr_mask;  /*0028h */
+       u32     outbound_doorbell;              /*002Ch*/
+       u32     outbound_intr_status;           /*0030h*/
+       u32     outbound_intr_mask;             /*0034h*/
 
-       u32 outbound_doorbell;  /*002Ch */
-       u32 outbound_intr_status;       /*0030h */
-       u32 outbound_intr_mask; /*0034h */
+       u32     reserved_1[2];                  /*0038h*/
 
-       u32 reserved_1[2];      /*0038h */
+       u32     inbound_queue_port;             /*0040h*/
+       u32     outbound_queue_port;            /*0044h*/
 
-       u32 inbound_queue_port; /*0040h */
-       u32 outbound_queue_port;        /*0044h */
+       u32     reserved_2[22];                 /*0048h*/
 
-       u32 reserved_2;         /*004Ch */
+       u32     outbound_doorbell_clear;        /*00A0h*/
 
-       u32 index_registers[1004];      /*0050h */
+       u32     reserved_3[3];                  /*00A4h*/
+
+       u32     outbound_scratch_pad ;          /*00B0h*/
+
+       u32     reserved_4[3];                  /*00B4h*/
+
+       u32     inbound_low_queue_port ;        /*00C0h*/
+
+       u32     inbound_high_queue_port ;       /*00C4h*/
+
+       u32     reserved_5;                     /*00C8h*/
+       u32     index_registers[820];           /*00CCh*/
 
 } __attribute__ ((packed));
 
index b17ee62dd1a9ce67981d5bfc4ebf6ce2e7596898..92b3e13e9061d8b00d869d5c1ac07afcf30ff50d 100644 (file)
@@ -7,7 +7,6 @@
 #include "qla_def.h"
 
 #include <linux/vmalloc.h>
-#include <scsi/scsi_transport_fc.h>
 
 /* SYSFS attributes --------------------------------------------------------- */
 
@@ -114,7 +113,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, char *buf, loff_t off,
            struct device, kobj)));
        unsigned long   flags;
 
-       if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->nvram_size)
+       if (!capable(CAP_SYS_ADMIN) || off != 0)
                return 0;
 
        /* Read NVRAM. */
@@ -123,7 +122,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, char *buf, loff_t off,
            ha->nvram_size);
        spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
-       return (count);
+       return ha->nvram_size;
 }
 
 static ssize_t
@@ -175,19 +174,150 @@ static struct bin_attribute sysfs_nvram_attr = {
                .mode = S_IRUSR | S_IWUSR,
                .owner = THIS_MODULE,
        },
-       .size = 0,
+       .size = 512,
        .read = qla2x00_sysfs_read_nvram,
        .write = qla2x00_sysfs_write_nvram,
 };
 
+static ssize_t
+qla2x00_sysfs_read_optrom(struct kobject *kobj, char *buf, loff_t off,
+    size_t count)
+{
+       struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
+           struct device, kobj)));
+
+       if (ha->optrom_state != QLA_SREADING)
+               return 0;
+       if (off > ha->optrom_size)
+               return 0;
+       if (off + count > ha->optrom_size)
+               count = ha->optrom_size - off;
+
+       memcpy(buf, &ha->optrom_buffer[off], count);
+
+       return count;
+}
+
+static ssize_t
+qla2x00_sysfs_write_optrom(struct kobject *kobj, char *buf, loff_t off,
+    size_t count)
+{
+       struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
+           struct device, kobj)));
+
+       if (ha->optrom_state != QLA_SWRITING)
+               return -EINVAL;
+       if (off > ha->optrom_size)
+               return -ERANGE;
+       if (off + count > ha->optrom_size)
+               count = ha->optrom_size - off;
+
+       memcpy(&ha->optrom_buffer[off], buf, count);
+
+       return count;
+}
+
+static struct bin_attribute sysfs_optrom_attr = {
+       .attr = {
+               .name = "optrom",
+               .mode = S_IRUSR | S_IWUSR,
+               .owner = THIS_MODULE,
+       },
+       .size = OPTROM_SIZE_24XX,
+       .read = qla2x00_sysfs_read_optrom,
+       .write = qla2x00_sysfs_write_optrom,
+};
+
+static ssize_t
+qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, char *buf, loff_t off,
+    size_t count)
+{
+       struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
+           struct device, kobj)));
+       int val;
+
+       if (off)
+               return 0;
+
+       if (sscanf(buf, "%d", &val) != 1)
+               return -EINVAL;
+
+       switch (val) {
+       case 0:
+               if (ha->optrom_state != QLA_SREADING &&
+                   ha->optrom_state != QLA_SWRITING)
+                       break;
+
+               ha->optrom_state = QLA_SWAITING;
+               vfree(ha->optrom_buffer);
+               ha->optrom_buffer = NULL;
+               break;
+       case 1:
+               if (ha->optrom_state != QLA_SWAITING)
+                       break;
+
+               ha->optrom_state = QLA_SREADING;
+               ha->optrom_buffer = (uint8_t *)vmalloc(ha->optrom_size);
+               if (ha->optrom_buffer == NULL) {
+                       qla_printk(KERN_WARNING, ha,
+                           "Unable to allocate memory for optrom retrieval "
+                           "(%x).\n", ha->optrom_size);
+
+                       ha->optrom_state = QLA_SWAITING;
+                       return count;
+               }
+
+               memset(ha->optrom_buffer, 0, ha->optrom_size);
+               ha->isp_ops.read_optrom(ha, ha->optrom_buffer, 0,
+                   ha->optrom_size);
+               break;
+       case 2:
+               if (ha->optrom_state != QLA_SWAITING)
+                       break;
+
+               ha->optrom_state = QLA_SWRITING;
+               ha->optrom_buffer = (uint8_t *)vmalloc(ha->optrom_size);
+               if (ha->optrom_buffer == NULL) {
+                       qla_printk(KERN_WARNING, ha,
+                           "Unable to allocate memory for optrom update "
+                           "(%x).\n", ha->optrom_size);
+
+                       ha->optrom_state = QLA_SWAITING;
+                       return count;
+               }
+               memset(ha->optrom_buffer, 0, ha->optrom_size);
+               break;
+       case 3:
+               if (ha->optrom_state != QLA_SWRITING)
+                       break;
+
+               ha->isp_ops.write_optrom(ha, ha->optrom_buffer, 0,
+                   ha->optrom_size);
+               break;
+       }
+       return count;
+}
+
+static struct bin_attribute sysfs_optrom_ctl_attr = {
+       .attr = {
+               .name = "optrom_ctl",
+               .mode = S_IWUSR,
+               .owner = THIS_MODULE,
+       },
+       .size = 0,
+       .write = qla2x00_sysfs_write_optrom_ctl,
+};
+
 void
 qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha)
 {
        struct Scsi_Host *host = ha->host;
 
        sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_fw_dump_attr);
-       sysfs_nvram_attr.size = ha->nvram_size;
        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);
 }
 
 void
@@ -197,6 +327,12 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *ha)
 
        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 (ha->beacon_blink_led == 1)
+               ha->isp_ops.beacon_off(ha);
 }
 
 /* Scsi_Host attributes. */
@@ -384,6 +520,50 @@ qla2x00_zio_timer_store(struct class_device *cdev, const char *buf,
        return strlen(buf);
 }
 
+static ssize_t
+qla2x00_beacon_show(struct class_device *cdev, char *buf)
+{
+       scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
+       int len = 0;
+
+       if (ha->beacon_blink_led)
+               len += snprintf(buf + len, PAGE_SIZE-len, "Enabled\n");
+       else
+               len += snprintf(buf + len, PAGE_SIZE-len, "Disabled\n");
+       return len;
+}
+
+static ssize_t
+qla2x00_beacon_store(struct class_device *cdev, const char *buf,
+    size_t count)
+{
+       scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
+       int val = 0;
+       int rval;
+
+       if (IS_QLA2100(ha) || IS_QLA2200(ha))
+               return -EPERM;
+
+       if (test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)) {
+               qla_printk(KERN_WARNING, ha,
+                   "Abort ISP active -- ignoring beacon request.\n");
+               return -EBUSY;
+       }
+
+       if (sscanf(buf, "%d", &val) != 1)
+               return -EINVAL;
+
+       if (val)
+               rval = ha->isp_ops.beacon_on(ha);
+       else
+               rval = ha->isp_ops.beacon_off(ha);
+
+       if (rval != QLA_SUCCESS)
+               count = 0;
+
+       return count;
+}
+
 static CLASS_DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show,
        NULL);
 static CLASS_DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL);
@@ -398,6 +578,8 @@ static CLASS_DEVICE_ATTR(zio, S_IRUGO | S_IWUSR, qla2x00_zio_show,
     qla2x00_zio_store);
 static CLASS_DEVICE_ATTR(zio_timer, S_IRUGO | S_IWUSR, qla2x00_zio_timer_show,
     qla2x00_zio_timer_store);
+static CLASS_DEVICE_ATTR(beacon, S_IRUGO | S_IWUSR, qla2x00_beacon_show,
+    qla2x00_beacon_store);
 
 struct class_device_attribute *qla2x00_host_attrs[] = {
        &class_device_attr_driver_version,
@@ -411,6 +593,7 @@ struct class_device_attribute *qla2x00_host_attrs[] = {
        &class_device_attr_state,
        &class_device_attr_zio,
        &class_device_attr_zio_timer,
+       &class_device_attr_beacon,
        NULL,
 };
 
@@ -425,6 +608,49 @@ qla2x00_get_host_port_id(struct Scsi_Host *shost)
            ha->d_id.b.area << 8 | ha->d_id.b.al_pa;
 }
 
+static void
+qla2x00_get_host_speed(struct Scsi_Host *shost)
+{
+       scsi_qla_host_t *ha = to_qla_host(shost);
+       uint32_t speed = 0;
+
+       switch (ha->link_data_rate) {
+       case LDR_1GB:
+               speed = 1;
+               break;
+       case LDR_2GB:
+               speed = 2;
+               break;
+       case LDR_4GB:
+               speed = 4;
+               break;
+       }
+       fc_host_speed(shost) = speed;
+}
+
+static void
+qla2x00_get_host_port_type(struct Scsi_Host *shost)
+{
+       scsi_qla_host_t *ha = to_qla_host(shost);
+       uint32_t port_type = FC_PORTTYPE_UNKNOWN;
+
+       switch (ha->current_topology) {
+       case ISP_CFG_NL:
+               port_type = FC_PORTTYPE_LPORT;
+               break;
+       case ISP_CFG_FL:
+               port_type = FC_PORTTYPE_NLPORT;
+               break;
+       case ISP_CFG_N:
+               port_type = FC_PORTTYPE_PTP;
+               break;
+       case ISP_CFG_F:
+               port_type = FC_PORTTYPE_NPORT;
+               break;
+       }
+       fc_host_port_type(shost) = port_type;
+}
+
 static void
 qla2x00_get_starget_node_name(struct scsi_target *starget)
 {
@@ -512,6 +738,41 @@ qla2x00_issue_lip(struct Scsi_Host *shost)
        return 0;
 }
 
+static struct fc_host_statistics *
+qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
+{
+       scsi_qla_host_t *ha = to_qla_host(shost);
+       int rval;
+       uint16_t mb_stat[1];
+       link_stat_t stat_buf;
+       struct fc_host_statistics *pfc_host_stat;
+
+       pfc_host_stat = &ha->fc_host_stat;
+       memset(pfc_host_stat, -1, sizeof(struct fc_host_statistics));
+
+       if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) {
+               rval = qla24xx_get_isp_stats(ha, (uint32_t *)&stat_buf,
+                   sizeof(stat_buf) / 4, mb_stat);
+       } else {
+               rval = qla2x00_get_link_status(ha, ha->loop_id, &stat_buf,
+                   mb_stat);
+       }
+       if (rval != 0) {
+               qla_printk(KERN_WARNING, ha,
+                   "Unable to retrieve host statistics (%d).\n", mb_stat[0]);
+               return pfc_host_stat;
+       }
+
+       pfc_host_stat->link_failure_count = stat_buf.link_fail_cnt;
+       pfc_host_stat->loss_of_sync_count = stat_buf.loss_sync_cnt;
+       pfc_host_stat->loss_of_signal_count = stat_buf.loss_sig_cnt;
+       pfc_host_stat->prim_seq_protocol_err_count = stat_buf.prim_seq_err_cnt;
+       pfc_host_stat->invalid_tx_word_count = stat_buf.inval_xmit_word_cnt;
+       pfc_host_stat->invalid_crc_count = stat_buf.inval_crc_cnt;
+
+       return pfc_host_stat;
+}
+
 struct fc_function_template qla2xxx_transport_functions = {
 
        .show_host_node_name = 1,
@@ -520,6 +781,10 @@ struct fc_function_template qla2xxx_transport_functions = {
 
        .get_host_port_id = qla2x00_get_host_port_id,
        .show_host_port_id = 1,
+       .get_host_speed = qla2x00_get_host_speed,
+       .show_host_speed = 1,
+       .get_host_port_type = qla2x00_get_host_port_type,
+       .show_host_port_type = 1,
 
        .dd_fcrport_size = sizeof(struct fc_port *),
        .show_rport_supported_classes = 1,
@@ -536,6 +801,7 @@ struct fc_function_template qla2xxx_transport_functions = {
        .show_rport_dev_loss_tmo = 1,
 
        .issue_fc_host_lip = qla2x00_issue_lip,
+       .get_fc_host_stats = qla2x00_get_fc_host_stats,
 };
 
 void
index bad066e5772acfce0079784ef2fada7c73a9a707..b31a03bbd14f4fd495dcc44fe6bfe367aa0c4c6a 100644 (file)
@@ -29,6 +29,7 @@
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_transport_fc.h>
 
 #if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
 #if defined(CONFIG_SCSI_QLA21XX) || defined(CONFIG_SCSI_QLA21XX_MODULE)
 #define WRT_REG_WORD(addr, data)       writew(data,addr)
 #define WRT_REG_DWORD(addr, data)      writel(data,addr)
 
+/*
+ * The ISP2312 v2 chip cannot access the FLASH/GPIO registers via MMIO in an
+ * 133Mhz slot.
+ */
+#define RD_REG_WORD_PIO(addr)          (inw((unsigned long)addr))
+#define WRT_REG_WORD_PIO(addr, data)   (outw(data,(unsigned long)addr))
+
 /*
  * Fibre Channel device definitions.
  */
@@ -432,6 +440,9 @@ struct device_reg_2xxx {
 #define GPIO_LED_GREEN_ON_AMBER_OFF    0x0040
 #define GPIO_LED_GREEN_OFF_AMBER_ON    0x0080
 #define GPIO_LED_GREEN_ON_AMBER_ON     0x00C0
+#define GPIO_LED_ALL_OFF               0x0000
+#define GPIO_LED_RED_ON_OTHER_OFF      0x0001  /* isp2322 */
+#define GPIO_LED_RGA_ON                        0x00C1  /* isp2322: red green amber */
 
        union {
                struct {
@@ -2199,6 +2210,15 @@ struct isp_operations {
 
        void (*fw_dump) (struct scsi_qla_host *, int);
        void (*ascii_fw_dump) (struct scsi_qla_host *);
+
+       int (*beacon_on) (struct scsi_qla_host *);
+       int (*beacon_off) (struct scsi_qla_host *);
+       void (*beacon_blink) (struct scsi_qla_host *);
+
+       uint8_t * (*read_optrom) (struct scsi_qla_host *, uint8_t *,
+               uint32_t, uint32_t);
+       int (*write_optrom) (struct scsi_qla_host *, uint8_t *, uint32_t,
+               uint32_t);
 };
 
 /*
@@ -2331,6 +2351,10 @@ typedef struct scsi_qla_host {
        uint16_t        min_external_loopid;    /* First external loop Id */
 
        uint16_t        link_data_rate;         /* F/W operating speed */
+#define LDR_1GB                0
+#define LDR_2GB                1
+#define LDR_4GB                3
+#define LDR_UNKNOWN    0xFFFF
 
        uint8_t         current_topology;
        uint8_t         prev_topology;
@@ -2486,12 +2510,26 @@ typedef struct scsi_qla_host {
        uint8_t         *port_name;
        uint32_t    isp_abort_cnt;
 
+       /* Option ROM information. */
+       char            *optrom_buffer;
+       uint32_t        optrom_size;
+       int             optrom_state;
+#define QLA_SWAITING   0
+#define QLA_SREADING   1
+#define QLA_SWRITING   2
+
        /* Needed for BEACON */
        uint16_t        beacon_blink_led;
-       uint16_t        beacon_green_on;
+       uint8_t         beacon_color_state;
+#define QLA_LED_GRN_ON         0x01
+#define QLA_LED_YLW_ON         0x02
+#define QLA_LED_ABR_ON         0x04
+#define QLA_LED_ALL_ON         0x07    /* yellow, green, amber. */
+                                       /* ISP2322: red, green, amber. */
 
        uint16_t        zio_mode;
        uint16_t        zio_timer;
+       struct fc_host_statistics fc_host_stat;
 } scsi_qla_host_t;
 
 
@@ -2557,7 +2595,9 @@ struct _qla2x00stats  {
 /*
  * Flash support definitions
  */
-#define FLASH_IMAGE_SIZE       131072
+#define OPTROM_SIZE_2300       0x20000
+#define OPTROM_SIZE_2322       0x100000
+#define OPTROM_SIZE_24XX       0x100000
 
 #include "qla_gbl.h"
 #include "qla_dbg.h"
index 35266bd5d5383ba75919f1e285601577ad3abd54..ffdc2680f0490817f6d64a4dea44279fcef7831c 100644 (file)
@@ -75,12 +75,12 @@ extern void qla2x00_cmd_timeout(srb_t *);
 extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int, int);
 extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *, int);
 
-extern void qla2x00_blink_led(scsi_qla_host_t *);
-
 extern int qla2x00_down_timeout(struct semaphore *, unsigned long);
 
 extern struct fw_blob *qla2x00_request_firmware(scsi_qla_host_t *);
 
+extern int qla2x00_wait_for_hba_online(scsi_qla_host_t *);
+
 /*
  * Global Function Prototypes in qla_iocb.c source file.
  */
@@ -185,6 +185,13 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *,
 extern int
 qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map);
 
+extern int
+qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, link_stat_t *,
+    uint16_t *);
+
+extern int
+qla24xx_get_isp_stats(scsi_qla_host_t *, uint32_t *, uint32_t, uint16_t *);
+
 extern int qla24xx_abort_command(scsi_qla_host_t *, srb_t *);
 extern int qla24xx_abort_target(fc_port_t *);
 
@@ -228,6 +235,22 @@ extern int qla2x00_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
 extern int qla24xx_write_nvram_data(scsi_qla_host_t *, uint8_t *, uint32_t,
     uint32_t);
 
+extern int qla2x00_beacon_on(struct scsi_qla_host *);
+extern int qla2x00_beacon_off(struct scsi_qla_host *);
+extern void qla2x00_beacon_blink(struct scsi_qla_host *);
+extern int qla24xx_beacon_on(struct scsi_qla_host *);
+extern int qla24xx_beacon_off(struct scsi_qla_host *);
+extern void qla24xx_beacon_blink(struct scsi_qla_host *);
+
+extern uint8_t *qla2x00_read_optrom_data(struct scsi_qla_host *, uint8_t *,
+    uint32_t, uint32_t);
+extern int qla2x00_write_optrom_data(struct scsi_qla_host *, uint8_t *,
+    uint32_t, uint32_t);
+extern uint8_t *qla24xx_read_optrom_data(struct scsi_qla_host *, uint8_t *,
+    uint32_t, uint32_t);
+extern int qla24xx_write_optrom_data(struct scsi_qla_host *, uint8_t *,
+    uint32_t, uint32_t);
+
 /*
  * Global Function Prototypes in qla_dbg.c source file.
  */
index e67bb099781818339b6a1ef6342694c54825860c..634ee174bff2a315e95fc29dd6fc41a72145480f 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <linux/delay.h>
 #include <linux/vmalloc.h>
-#include <scsi/scsi_transport_fc.h>
 
 #include "qla_devtbl.h"
 
index 7ec0b8d6f07b379548c5e3ba777fec2dfc78bfef..6544b6d0891d07826012baaf73ab173ae80d1ee7 100644 (file)
@@ -814,6 +814,7 @@ qla24xx_start_scsi(srb_t *sp)
        cmd_pkt->port_id[2] = sp->fcport->d_id.b.domain;
 
        int_to_scsilun(sp->cmd->device->lun, &cmd_pkt->lun);
+       host_to_fcp_swap((uint8_t *)&cmd_pkt->lun, sizeof(cmd_pkt->lun));
 
        /* Load SCSI command packet. */
        memcpy(cmd_pkt->fcp_cdb, cmd->cmnd, cmd->cmd_len);
index 71a46fcee8cc47d3b7e0cba5cf0aad80786f8d2b..42aa7a7c1a7313795fc4f30a9362f14740e7ce54 100644 (file)
@@ -402,9 +402,9 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                break;
 
        case MBA_LOOP_UP:               /* Loop Up Event */
-               ha->link_data_rate = 0;
                if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
                        link_speed = link_speeds[0];
+                       ha->link_data_rate = LDR_1GB;
                } else {
                        link_speed = link_speeds[LS_UNKNOWN];
                        if (mb[1] < 5)
@@ -436,7 +436,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
                }
 
                ha->flags.management_server_logged_in = 0;
-               ha->link_data_rate = 0;
+               ha->link_data_rate = LDR_UNKNOWN;
                if (ql2xfdmienable)
                        set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags);
 
index 3099b379de9d89d554ebd1b5e9dde9d21fdb5d47..363dfdd042b08871c04e637fea9454978c52ea85 100644 (file)
@@ -7,7 +7,6 @@
 #include "qla_def.h"
 
 #include <linux/delay.h>
-#include <scsi/scsi_transport_fc.h>
 
 static void
 qla2x00_mbx_sem_timeout(unsigned long data)
@@ -1874,7 +1873,8 @@ qla2x00_get_id_list(scsi_qla_host_t *ha, void *id_list, dma_addr_t id_list_dma,
                mcp->mb[3] = LSW(id_list_dma);
                mcp->mb[6] = MSW(MSD(id_list_dma));
                mcp->mb[7] = LSW(MSD(id_list_dma));
-               mcp->out_mb |= MBX_7|MBX_6|MBX_3|MBX_2;
+               mcp->mb[8] = 0;
+               mcp->out_mb |= MBX_8|MBX_7|MBX_6|MBX_3|MBX_2;
        } else {
                mcp->mb[1] = MSW(id_list_dma);
                mcp->mb[2] = LSW(id_list_dma);
@@ -2017,8 +2017,109 @@ qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map)
 
        return rval;
 }
+#endif
+
+/*
+ * qla2x00_get_link_status
+ *
+ * Input:
+ *     ha = adapter block pointer.
+ *     loop_id = device loop ID.
+ *     ret_buf = pointer to link status return buffer.
+ *
+ * Returns:
+ *     0 = success.
+ *     BIT_0 = mem alloc error.
+ *     BIT_1 = mailbox error.
+ */
+int
+qla2x00_get_link_status(scsi_qla_host_t *ha, uint16_t loop_id,
+    link_stat_t *ret_buf, uint16_t *status)
+{
+       int rval;
+       mbx_cmd_t mc;
+       mbx_cmd_t *mcp = &mc;
+       link_stat_t *stat_buf;
+       dma_addr_t stat_buf_dma;
+
+       DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no);)
+
+       stat_buf = dma_pool_alloc(ha->s_dma_pool, GFP_ATOMIC, &stat_buf_dma);
+       if (stat_buf == NULL) {
+               DEBUG2_3_11(printk("%s(%ld): Failed to allocate memory.\n",
+                   __func__, ha->host_no));
+               return BIT_0;
+       }
+       memset(stat_buf, 0, sizeof(link_stat_t));
+
+       mcp->mb[0] = MBC_GET_LINK_STATUS;
+       mcp->mb[2] = MSW(stat_buf_dma);
+       mcp->mb[3] = LSW(stat_buf_dma);
+       mcp->mb[6] = MSW(MSD(stat_buf_dma));
+       mcp->mb[7] = LSW(MSD(stat_buf_dma));
+       mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_0;
+       mcp->in_mb = MBX_0;
+       if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) {
+               mcp->mb[1] = loop_id;
+               mcp->mb[4] = 0;
+               mcp->mb[10] = 0;
+               mcp->out_mb |= MBX_10|MBX_4|MBX_1;
+               mcp->in_mb |= MBX_1;
+       } else if (HAS_EXTENDED_IDS(ha)) {
+               mcp->mb[1] = loop_id;
+               mcp->mb[10] = 0;
+               mcp->out_mb |= MBX_10|MBX_1;
+       } else {
+               mcp->mb[1] = loop_id << 8;
+               mcp->out_mb |= MBX_1;
+       }
+       mcp->tov = 30;
+       mcp->flags = IOCTL_CMD;
+       rval = qla2x00_mailbox_command(ha, mcp);
+
+       if (rval == QLA_SUCCESS) {
+               if (mcp->mb[0] != MBS_COMMAND_COMPLETE) {
+                       DEBUG2_3_11(printk("%s(%ld): cmd failed. mbx0=%x.\n",
+                           __func__, ha->host_no, mcp->mb[0]);)
+                       status[0] = mcp->mb[0];
+                       rval = BIT_1;
+               } else {
+                       /* copy over data -- firmware data is LE. */
+                       ret_buf->link_fail_cnt =
+                           le32_to_cpu(stat_buf->link_fail_cnt);
+                       ret_buf->loss_sync_cnt =
+                           le32_to_cpu(stat_buf->loss_sync_cnt);
+                       ret_buf->loss_sig_cnt =
+                           le32_to_cpu(stat_buf->loss_sig_cnt);
+                       ret_buf->prim_seq_err_cnt =
+                           le32_to_cpu(stat_buf->prim_seq_err_cnt);
+                       ret_buf->inval_xmit_word_cnt =
+                           le32_to_cpu(stat_buf->inval_xmit_word_cnt);
+                       ret_buf->inval_crc_cnt =
+                           le32_to_cpu(stat_buf->inval_crc_cnt);
+
+                       DEBUG11(printk("%s(%ld): stat dump: fail_cnt=%d "
+                           "loss_sync=%d loss_sig=%d seq_err=%d "
+                           "inval_xmt_word=%d inval_crc=%d.\n", __func__,
+                           ha->host_no, stat_buf->link_fail_cnt,
+                           stat_buf->loss_sync_cnt, stat_buf->loss_sig_cnt,
+                           stat_buf->prim_seq_err_cnt,
+                           stat_buf->inval_xmit_word_cnt,
+                           stat_buf->inval_crc_cnt);)
+               }
+       } else {
+               /* Failed. */
+               DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
+                   ha->host_no, rval);)
+               rval = BIT_1;
+       }
+
+       dma_pool_free(ha->s_dma_pool, stat_buf, stat_buf_dma);
 
-uint8_t
+       return rval;
+}
+
+int
 qla24xx_get_isp_stats(scsi_qla_host_t *ha, uint32_t *dwbuf, uint32_t dwords,
     uint16_t *status)
 {
@@ -2080,7 +2181,6 @@ qla24xx_get_isp_stats(scsi_qla_host_t *ha, uint32_t *dwbuf, uint32_t dwords,
 
        return rval;
 }
-#endif
 
 int
 qla24xx_abort_command(scsi_qla_host_t *ha, srb_t *sp)
index 5866a7c706a82d627e71f597fe89970eb493d10f..9f91f1a20542cde30379643072d127cc873a9c6a 100644 (file)
@@ -366,6 +366,12 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
                goto qc_fail_command;
        }
 
+       /* Close window on fcport/rport state-transitioning. */
+       if (!*(fc_port_t **)rport->dd_data) {
+               cmd->result = DID_IMM_RETRY << 16;
+               goto qc_fail_command;
+       }
+
        if (atomic_read(&fcport->state) != FCS_ONLINE) {
                if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
                    atomic_read(&ha->loop_state) == LOOP_DEAD) {
@@ -421,6 +427,12 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
                goto qc24_fail_command;
        }
 
+       /* Close window on fcport/rport state-transitioning. */
+       if (!*(fc_port_t **)rport->dd_data) {
+               cmd->result = DID_IMM_RETRY << 16;
+               goto qc24_fail_command;
+       }
+
        if (atomic_read(&fcport->state) != FCS_ONLINE) {
                if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
                    atomic_read(&ha->loop_state) == LOOP_DEAD) {
@@ -513,7 +525,7 @@ qla2x00_eh_wait_on_command(scsi_qla_host_t *ha, struct scsi_cmnd *cmd)
  *    Success (Adapter is online) : 0
  *    Failed  (Adapter is offline/disabled) : 1
  */
-static int
+int
 qla2x00_wait_for_hba_online(scsi_qla_host_t *ha)
 {
        int             return_status;
@@ -1312,6 +1324,8 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
        ha->ports = MAX_BUSES;
        ha->init_cb_size = sizeof(init_cb_t);
        ha->mgmt_svr_loop_id = MANAGEMENT_SERVER;
+       ha->link_data_rate = LDR_UNKNOWN;
+       ha->optrom_size = OPTROM_SIZE_2300;
 
        /* Assign ISP specific operations. */
        ha->isp_ops.pci_config          = qla2100_pci_config;
@@ -1339,6 +1353,8 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
        ha->isp_ops.write_nvram         = qla2x00_write_nvram_data;
        ha->isp_ops.fw_dump             = qla2100_fw_dump;
        ha->isp_ops.ascii_fw_dump       = qla2100_ascii_fw_dump;
+       ha->isp_ops.read_optrom         = qla2x00_read_optrom_data;
+       ha->isp_ops.write_optrom        = qla2x00_write_optrom_data;
        if (IS_QLA2100(ha)) {
                host->max_id = MAX_TARGETS_2100;
                ha->mbx_count = MAILBOX_REGISTER_COUNT_2100;
@@ -1364,7 +1380,12 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
                ha->isp_ops.intr_handler = qla2300_intr_handler;
                ha->isp_ops.fw_dump = qla2300_fw_dump;
                ha->isp_ops.ascii_fw_dump = qla2300_ascii_fw_dump;
+               ha->isp_ops.beacon_on = qla2x00_beacon_on;
+               ha->isp_ops.beacon_off = qla2x00_beacon_off;
+               ha->isp_ops.beacon_blink = qla2x00_beacon_blink;
                ha->gid_list_info_size = 6;
+               if (IS_QLA2322(ha) || IS_QLA6322(ha))
+                       ha->optrom_size = OPTROM_SIZE_2322;
        } else if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) {
                host->max_id = MAX_TARGETS_2200;
                ha->mbx_count = MAILBOX_REGISTER_COUNT;
@@ -1400,7 +1421,13 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
                ha->isp_ops.write_nvram = qla24xx_write_nvram_data;
                ha->isp_ops.fw_dump = qla24xx_fw_dump;
                ha->isp_ops.ascii_fw_dump = qla24xx_ascii_fw_dump;
+               ha->isp_ops.read_optrom = qla24xx_read_optrom_data;
+               ha->isp_ops.write_optrom = qla24xx_write_optrom_data;
+               ha->isp_ops.beacon_on = qla24xx_beacon_on;
+               ha->isp_ops.beacon_off = qla24xx_beacon_off;
+               ha->isp_ops.beacon_blink = qla24xx_beacon_blink;
                ha->gid_list_info_size = 8;
+               ha->optrom_size = OPTROM_SIZE_24XX;
        }
        host->can_queue = ha->request_q_length + 128;
 
@@ -1657,11 +1684,13 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport,
                spin_lock_irqsave(&fcport->rport_lock, flags);
                fcport->drport = rport;
                fcport->rport = NULL;
+               *(fc_port_t **)rport->dd_data = NULL;
                spin_unlock_irqrestore(&fcport->rport_lock, flags);
                set_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags);
        } else {
                spin_lock_irqsave(&fcport->rport_lock, flags);
                fcport->rport = NULL;
+               *(fc_port_t **)rport->dd_data = NULL;
                spin_unlock_irqrestore(&fcport->rport_lock, flags);
                fc_remote_port_delete(rport);
        }
@@ -2066,6 +2095,8 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
        ha->fw_dumped = 0;
        ha->fw_dump_reading = 0;
        ha->fw_dump_buffer = NULL;
+
+       vfree(ha->optrom_buffer);
 }
 
 /*
@@ -2314,6 +2345,9 @@ qla2x00_do_dpc(void *data)
                if (!ha->interrupts_on)
                        ha->isp_ops.enable_intrs(ha);
 
+               if (test_and_clear_bit(BEACON_BLINK_NEEDED, &ha->dpc_flags))
+                       ha->isp_ops.beacon_blink(ha);
+
                ha->dpc_active = 0;
        } /* End of while(1) */
 
@@ -2491,6 +2525,12 @@ qla2x00_timer(scsi_qla_host_t *ha)
                    atomic_read(&ha->loop_down_timer)));
        }
 
+       /* Check if beacon LED needs to be blinked */
+       if (ha->beacon_blink_led == 1) {
+               set_bit(BEACON_BLINK_NEEDED, &ha->dpc_flags);
+               start_dpc++;
+       }
+
        /* Schedule the DPC routine if needed */
        if ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) ||
            test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) ||
@@ -2499,6 +2539,7 @@ qla2x00_timer(scsi_qla_host_t *ha)
            start_dpc ||
            test_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags) ||
            test_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) ||
+           test_bit(BEACON_BLINK_NEEDED, &ha->dpc_flags) ||
            test_bit(RELOGIN_NEEDED, &ha->dpc_flags)) &&
            ha->dpc_wait && !ha->dpc_active) {
 
index 2c3342108dd82219f311adc9644cd50acbc9a3eb..b70bebe18c0123458150e0e0031fa537edf0b05e 100644 (file)
@@ -6,8 +6,6 @@
  */
 #include "qla_def.h"
 
-#include <scsi/scsi_transport_fc.h>
-
 /**
  * IO descriptor handle definitions.
  *
index f4d755a643e44d985d0378b06e6c134930da531f..3866a5760f15b45966a2a3de8ebf40aaa88f9596 100644 (file)
@@ -695,3 +695,966 @@ qla24xx_write_nvram_data(scsi_qla_host_t *ha, uint8_t *buf, uint32_t naddr,
 
        return ret;
 }
+
+
+static inline void
+qla2x00_flip_colors(scsi_qla_host_t *ha, uint16_t *pflags)
+{
+       if (IS_QLA2322(ha)) {
+               /* Flip all colors. */
+               if (ha->beacon_color_state == QLA_LED_ALL_ON) {
+                       /* Turn off. */
+                       ha->beacon_color_state = 0;
+                       *pflags = GPIO_LED_ALL_OFF;
+               } else {
+                       /* Turn on. */
+                       ha->beacon_color_state = QLA_LED_ALL_ON;
+                       *pflags = GPIO_LED_RGA_ON;
+               }
+       } else {
+               /* Flip green led only. */
+               if (ha->beacon_color_state == QLA_LED_GRN_ON) {
+                       /* Turn off. */
+                       ha->beacon_color_state = 0;
+                       *pflags = GPIO_LED_GREEN_OFF_AMBER_OFF;
+               } else {
+                       /* Turn on. */
+                       ha->beacon_color_state = QLA_LED_GRN_ON;
+                       *pflags = GPIO_LED_GREEN_ON_AMBER_OFF;
+               }
+       }
+}
+
+void
+qla2x00_beacon_blink(struct scsi_qla_host *ha)
+{
+       uint16_t gpio_enable;
+       uint16_t gpio_data;
+       uint16_t led_color = 0;
+       unsigned long flags;
+       struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
+
+       if (ha->pio_address)
+               reg = (struct device_reg_2xxx __iomem *)ha->pio_address;
+
+       spin_lock_irqsave(&ha->hardware_lock, flags);
+
+       /* Save the Original GPIOE. */
+       if (ha->pio_address) {
+               gpio_enable = RD_REG_WORD_PIO(&reg->gpioe);
+               gpio_data = RD_REG_WORD_PIO(&reg->gpiod);
+       } else {
+               gpio_enable = RD_REG_WORD(&reg->gpioe);
+               gpio_data = RD_REG_WORD(&reg->gpiod);
+       }
+
+       /* Set the modified gpio_enable values */
+       gpio_enable |= GPIO_LED_MASK;
+
+       if (ha->pio_address) {
+               WRT_REG_WORD_PIO(&reg->gpioe, gpio_enable);
+       } else {
+               WRT_REG_WORD(&reg->gpioe, gpio_enable);
+               RD_REG_WORD(&reg->gpioe);
+       }
+
+       qla2x00_flip_colors(ha, &led_color);
+
+       /* Clear out any previously set LED color. */
+       gpio_data &= ~GPIO_LED_MASK;
+
+       /* Set the new input LED color to GPIOD. */
+       gpio_data |= led_color;
+
+       /* Set the modified gpio_data values */
+       if (ha->pio_address) {
+               WRT_REG_WORD_PIO(&reg->gpiod, gpio_data);
+       } else {
+               WRT_REG_WORD(&reg->gpiod, gpio_data);
+               RD_REG_WORD(&reg->gpiod);
+       }
+
+       spin_unlock_irqrestore(&ha->hardware_lock, flags);
+}
+
+int
+qla2x00_beacon_on(struct scsi_qla_host *ha)
+{
+       uint16_t gpio_enable;
+       uint16_t gpio_data;
+       unsigned long flags;
+       struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
+
+       ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING;
+       ha->fw_options[1] |= FO1_DISABLE_GPIO6_7;
+
+       if (qla2x00_set_fw_options(ha, ha->fw_options) != QLA_SUCCESS) {
+               qla_printk(KERN_WARNING, ha,
+                   "Unable to update fw options (beacon on).\n");
+               return QLA_FUNCTION_FAILED;
+       }
+
+       if (ha->pio_address)
+               reg = (struct device_reg_2xxx __iomem *)ha->pio_address;
+
+       /* Turn off LEDs. */
+       spin_lock_irqsave(&ha->hardware_lock, flags);
+       if (ha->pio_address) {
+               gpio_enable = RD_REG_WORD_PIO(&reg->gpioe);
+               gpio_data = RD_REG_WORD_PIO(&reg->gpiod);
+       } else {
+               gpio_enable = RD_REG_WORD(&reg->gpioe);
+               gpio_data = RD_REG_WORD(&reg->gpiod);
+       }
+       gpio_enable |= GPIO_LED_MASK;
+
+       /* Set the modified gpio_enable values. */
+       if (ha->pio_address) {
+               WRT_REG_WORD_PIO(&reg->gpioe, gpio_enable);
+       } else {
+               WRT_REG_WORD(&reg->gpioe, gpio_enable);
+               RD_REG_WORD(&reg->gpioe);
+       }
+
+       /* Clear out previously set LED colour. */
+       gpio_data &= ~GPIO_LED_MASK;
+       if (ha->pio_address) {
+               WRT_REG_WORD_PIO(&reg->gpiod, gpio_data);
+       } else {
+               WRT_REG_WORD(&reg->gpiod, gpio_data);
+               RD_REG_WORD(&reg->gpiod);
+       }
+       spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+       /*
+        * Let the per HBA timer kick off the blinking process based on
+        * the following flags. No need to do anything else now.
+        */
+       ha->beacon_blink_led = 1;
+       ha->beacon_color_state = 0;
+
+       return QLA_SUCCESS;
+}
+
+int
+qla2x00_beacon_off(struct scsi_qla_host *ha)
+{
+       int rval = QLA_SUCCESS;
+
+       ha->beacon_blink_led = 0;
+
+       /* Set the on flag so when it gets flipped it will be off. */
+       if (IS_QLA2322(ha))
+               ha->beacon_color_state = QLA_LED_ALL_ON;
+       else
+               ha->beacon_color_state = QLA_LED_GRN_ON;
+
+       ha->isp_ops.beacon_blink(ha);   /* This turns green LED off */
+
+       ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING;
+       ha->fw_options[1] &= ~FO1_DISABLE_GPIO6_7;
+
+       rval = qla2x00_set_fw_options(ha, ha->fw_options);
+       if (rval != QLA_SUCCESS)
+               qla_printk(KERN_WARNING, ha,
+                   "Unable to update fw options (beacon off).\n");
+       return rval;
+}
+
+
+static inline void
+qla24xx_flip_colors(scsi_qla_host_t *ha, uint16_t *pflags)
+{
+       /* Flip all colors. */
+       if (ha->beacon_color_state == QLA_LED_ALL_ON) {
+               /* Turn off. */
+               ha->beacon_color_state = 0;
+               *pflags = 0;
+       } else {
+               /* Turn on. */
+               ha->beacon_color_state = QLA_LED_ALL_ON;
+               *pflags = GPDX_LED_YELLOW_ON | GPDX_LED_AMBER_ON;
+       }
+}
+
+void
+qla24xx_beacon_blink(struct scsi_qla_host *ha)
+{
+       uint16_t led_color = 0;
+       uint32_t gpio_data;
+       unsigned long flags;
+       struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
+
+       /* Save the Original GPIOD. */
+       spin_lock_irqsave(&ha->hardware_lock, flags);
+       gpio_data = RD_REG_DWORD(&reg->gpiod);
+
+       /* Enable the gpio_data reg for update. */
+       gpio_data |= GPDX_LED_UPDATE_MASK;
+
+       WRT_REG_DWORD(&reg->gpiod, gpio_data);
+       gpio_data = RD_REG_DWORD(&reg->gpiod);
+
+       /* Set the color bits. */
+       qla24xx_flip_colors(ha, &led_color);
+
+       /* Clear out any previously set LED color. */
+       gpio_data &= ~GPDX_LED_COLOR_MASK;
+
+       /* Set the new input LED color to GPIOD. */
+       gpio_data |= led_color;
+
+       /* Set the modified gpio_data values. */
+       WRT_REG_DWORD(&reg->gpiod, gpio_data);
+       gpio_data = RD_REG_DWORD(&reg->gpiod);
+       spin_unlock_irqrestore(&ha->hardware_lock, flags);
+}
+
+int
+qla24xx_beacon_on(struct scsi_qla_host *ha)
+{
+       uint32_t gpio_data;
+       unsigned long flags;
+       struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
+
+       if (ha->beacon_blink_led == 0) {
+               /* Enable firmware for update */
+               ha->fw_options[1] |= ADD_FO1_DISABLE_GPIO_LED_CTRL;
+
+               if (qla2x00_set_fw_options(ha, ha->fw_options) != QLA_SUCCESS)
+                       return QLA_FUNCTION_FAILED;
+
+               if (qla2x00_get_fw_options(ha, ha->fw_options) !=
+                   QLA_SUCCESS) {
+                       qla_printk(KERN_WARNING, ha,
+                           "Unable to update fw options (beacon on).\n");
+                       return QLA_FUNCTION_FAILED;
+               }
+
+               spin_lock_irqsave(&ha->hardware_lock, flags);
+               gpio_data = RD_REG_DWORD(&reg->gpiod);
+
+               /* Enable the gpio_data reg for update. */
+               gpio_data |= GPDX_LED_UPDATE_MASK;
+               WRT_REG_DWORD(&reg->gpiod, gpio_data);
+               RD_REG_DWORD(&reg->gpiod);
+
+               spin_unlock_irqrestore(&ha->hardware_lock, flags);
+       }
+
+       /* So all colors blink together. */
+       ha->beacon_color_state = 0;
+
+       /* Let the per HBA timer kick off the blinking process. */
+       ha->beacon_blink_led = 1;
+
+       return QLA_SUCCESS;
+}
+
+int
+qla24xx_beacon_off(struct scsi_qla_host *ha)
+{
+       uint32_t gpio_data;
+       unsigned long flags;
+       struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
+
+       ha->beacon_blink_led = 0;
+       ha->beacon_color_state = QLA_LED_ALL_ON;
+
+       ha->isp_ops.beacon_blink(ha);   /* Will flip to all off. */
+
+       /* Give control back to firmware. */
+       spin_lock_irqsave(&ha->hardware_lock, flags);
+       gpio_data = RD_REG_DWORD(&reg->gpiod);
+
+       /* Disable the gpio_data reg for update. */
+       gpio_data &= ~GPDX_LED_UPDATE_MASK;
+       WRT_REG_DWORD(&reg->gpiod, gpio_data);
+       RD_REG_DWORD(&reg->gpiod);
+       spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+       ha->fw_options[1] &= ~ADD_FO1_DISABLE_GPIO_LED_CTRL;
+
+       if (qla2x00_set_fw_options(ha, ha->fw_options) != QLA_SUCCESS) {
+               qla_printk(KERN_WARNING, ha,
+                   "Unable to update fw options (beacon off).\n");
+               return QLA_FUNCTION_FAILED;
+       }
+
+       if (qla2x00_get_fw_options(ha, ha->fw_options) != QLA_SUCCESS) {
+               qla_printk(KERN_WARNING, ha,
+                   "Unable to get fw options (beacon off).\n");
+               return QLA_FUNCTION_FAILED;
+       }
+
+       return QLA_SUCCESS;
+}
+
+
+/*
+ * Flash support routines
+ */
+
+/**
+ * qla2x00_flash_enable() - Setup flash for reading and writing.
+ * @ha: HA context
+ */
+static void
+qla2x00_flash_enable(scsi_qla_host_t *ha)
+{
+       uint16_t data;
+       struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
+
+       data = RD_REG_WORD(&reg->ctrl_status);
+       data |= CSR_FLASH_ENABLE;
+       WRT_REG_WORD(&reg->ctrl_status, data);
+       RD_REG_WORD(&reg->ctrl_status);         /* PCI Posting. */
+}
+
+/**
+ * qla2x00_flash_disable() - Disable flash and allow RISC to run.
+ * @ha: HA context
+ */
+static void
+qla2x00_flash_disable(scsi_qla_host_t *ha)
+{
+       uint16_t data;
+       struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
+
+       data = RD_REG_WORD(&reg->ctrl_status);
+       data &= ~(CSR_FLASH_ENABLE);
+       WRT_REG_WORD(&reg->ctrl_status, data);
+       RD_REG_WORD(&reg->ctrl_status);         /* PCI Posting. */
+}
+
+/**
+ * qla2x00_read_flash_byte() - Reads a byte from flash
+ * @ha: HA context
+ * @addr: Address in flash to read
+ *
+ * A word is read from the chip, but, only the lower byte is valid.
+ *
+ * Returns the byte read from flash @addr.
+ */
+static uint8_t
+qla2x00_read_flash_byte(scsi_qla_host_t *ha, uint32_t addr)
+{
+       uint16_t data;
+       uint16_t bank_select;
+       struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
+
+       bank_select = RD_REG_WORD(&reg->ctrl_status);
+
+       if (IS_QLA2322(ha) || IS_QLA6322(ha)) {
+               /* Specify 64K address range: */
+               /*  clear out Module Select and Flash Address bits [19:16]. */
+               bank_select &= ~0xf8;
+               bank_select |= addr >> 12 & 0xf0;
+               bank_select |= CSR_FLASH_64K_BANK;
+               WRT_REG_WORD(&reg->ctrl_status, bank_select);
+               RD_REG_WORD(&reg->ctrl_status); /* PCI Posting. */
+
+               WRT_REG_WORD(&reg->flash_address, (uint16_t)addr);
+               data = RD_REG_WORD(&reg->flash_data);
+
+               return (uint8_t)data;
+       }
+
+       /* Setup bit 16 of flash address. */
+       if ((addr & BIT_16) && ((bank_select & CSR_FLASH_64K_BANK) == 0)) {
+               bank_select |= CSR_FLASH_64K_BANK;
+               WRT_REG_WORD(&reg->ctrl_status, bank_select);
+               RD_REG_WORD(&reg->ctrl_status); /* PCI Posting. */
+       } else if (((addr & BIT_16) == 0) &&
+           (bank_select & CSR_FLASH_64K_BANK)) {
+               bank_select &= ~(CSR_FLASH_64K_BANK);
+               WRT_REG_WORD(&reg->ctrl_status, bank_select);
+               RD_REG_WORD(&reg->ctrl_status); /* PCI Posting. */
+       }
+
+       /* Always perform IO mapped accesses to the FLASH registers. */
+       if (ha->pio_address) {
+               uint16_t data2;
+
+               reg = (struct device_reg_2xxx __iomem *)ha->pio_address;
+               WRT_REG_WORD_PIO(&reg->flash_address, (uint16_t)addr);
+               do {
+                       data = RD_REG_WORD_PIO(&reg->flash_data);
+                       barrier();
+                       cpu_relax();
+                       data2 = RD_REG_WORD_PIO(&reg->flash_data);
+               } while (data != data2);
+       } else {
+               WRT_REG_WORD(&reg->flash_address, (uint16_t)addr);
+               data = qla2x00_debounce_register(&reg->flash_data);
+       }
+
+       return (uint8_t)data;
+}
+
+/**
+ * qla2x00_write_flash_byte() - Write a byte to flash
+ * @ha: HA context
+ * @addr: Address in flash to write
+ * @data: Data to write
+ */
+static void
+qla2x00_write_flash_byte(scsi_qla_host_t *ha, uint32_t addr, uint8_t data)
+{
+       uint16_t bank_select;
+       struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
+
+       bank_select = RD_REG_WORD(&reg->ctrl_status);
+       if (IS_QLA2322(ha) || IS_QLA6322(ha)) {
+               /* Specify 64K address range: */
+               /*  clear out Module Select and Flash Address bits [19:16]. */
+               bank_select &= ~0xf8;
+               bank_select |= addr >> 12 & 0xf0;
+               bank_select |= CSR_FLASH_64K_BANK;
+               WRT_REG_WORD(&reg->ctrl_status, bank_select);
+               RD_REG_WORD(&reg->ctrl_status); /* PCI Posting. */
+
+               WRT_REG_WORD(&reg->flash_address, (uint16_t)addr);
+               RD_REG_WORD(&reg->ctrl_status);         /* PCI Posting. */
+               WRT_REG_WORD(&reg->flash_data, (uint16_t)data);
+               RD_REG_WORD(&reg->ctrl_status);         /* PCI Posting. */
+
+               return;
+       }
+
+       /* Setup bit 16 of flash address. */
+       if ((addr & BIT_16) && ((bank_select & CSR_FLASH_64K_BANK) == 0)) {
+               bank_select |= CSR_FLASH_64K_BANK;
+               WRT_REG_WORD(&reg->ctrl_status, bank_select);
+               RD_REG_WORD(&reg->ctrl_status); /* PCI Posting. */
+       } else if (((addr & BIT_16) == 0) &&
+           (bank_select & CSR_FLASH_64K_BANK)) {
+               bank_select &= ~(CSR_FLASH_64K_BANK);
+               WRT_REG_WORD(&reg->ctrl_status, bank_select);
+               RD_REG_WORD(&reg->ctrl_status); /* PCI Posting. */
+       }
+
+       /* Always perform IO mapped accesses to the FLASH registers. */
+       if (ha->pio_address) {
+               reg = (struct device_reg_2xxx __iomem *)ha->pio_address;
+               WRT_REG_WORD_PIO(&reg->flash_address, (uint16_t)addr);
+               WRT_REG_WORD_PIO(&reg->flash_data, (uint16_t)data);
+       } else {
+               WRT_REG_WORD(&reg->flash_address, (uint16_t)addr);
+               RD_REG_WORD(&reg->ctrl_status);         /* PCI Posting. */
+               WRT_REG_WORD(&reg->flash_data, (uint16_t)data);
+               RD_REG_WORD(&reg->ctrl_status);         /* PCI Posting. */
+       }
+}
+
+/**
+ * qla2x00_poll_flash() - Polls flash for completion.
+ * @ha: HA context
+ * @addr: Address in flash to poll
+ * @poll_data: Data to be polled
+ * @man_id: Flash manufacturer ID
+ * @flash_id: Flash ID
+ *
+ * This function polls the device until bit 7 of what is read matches data
+ * bit 7 or until data bit 5 becomes a 1.  If that hapens, the flash ROM timed
+ * out (a fatal error).  The flash book recommeds reading bit 7 again after
+ * reading bit 5 as a 1.
+ *
+ * Returns 0 on success, else non-zero.
+ */
+static int
+qla2x00_poll_flash(scsi_qla_host_t *ha, uint32_t addr, uint8_t poll_data,
+    uint8_t man_id, uint8_t flash_id)
+{
+       int status;
+       uint8_t flash_data;
+       uint32_t cnt;
+
+       status = 1;
+
+       /* Wait for 30 seconds for command to finish. */
+       poll_data &= BIT_7;
+       for (cnt = 3000000; cnt; cnt--) {
+               flash_data = qla2x00_read_flash_byte(ha, addr);
+               if ((flash_data & BIT_7) == poll_data) {
+                       status = 0;
+                       break;
+               }
+
+               if (man_id != 0x40 && man_id != 0xda) {
+                       if ((flash_data & BIT_5) && cnt > 2)
+                               cnt = 2;
+               }
+               udelay(10);
+               barrier();
+       }
+       return status;
+}
+
+#define IS_OEM_001(ha) \
+       ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2322 && \
+        (ha)->pdev->subsystem_vendor == 0x1028 && \
+        (ha)->pdev->subsystem_device == 0x0170)
+
+/**
+ * qla2x00_program_flash_address() - Programs a flash address
+ * @ha: HA context
+ * @addr: Address in flash to program
+ * @data: Data to be written in flash
+ * @man_id: Flash manufacturer ID
+ * @flash_id: Flash ID
+ *
+ * Returns 0 on success, else non-zero.
+ */
+static int
+qla2x00_program_flash_address(scsi_qla_host_t *ha, uint32_t addr, uint8_t data,
+    uint8_t man_id, uint8_t flash_id)
+{
+       /* Write Program Command Sequence. */
+       if (IS_OEM_001(ha)) {
+               qla2x00_write_flash_byte(ha, 0xaaa, 0xaa);
+               qla2x00_write_flash_byte(ha, 0x555, 0x55);
+               qla2x00_write_flash_byte(ha, 0xaaa, 0xa0);
+               qla2x00_write_flash_byte(ha, addr, data);
+       } else {
+               if (man_id == 0xda && flash_id == 0xc1) {
+                       qla2x00_write_flash_byte(ha, addr, data);
+                       if (addr & 0x7e)
+                               return 0;
+               } else {
+                       qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
+                       qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
+                       qla2x00_write_flash_byte(ha, 0x5555, 0xa0);
+                       qla2x00_write_flash_byte(ha, addr, data);
+               }
+       }
+
+       udelay(150);
+
+       /* Wait for write to complete. */
+       return qla2x00_poll_flash(ha, addr, data, man_id, flash_id);
+}
+
+/**
+ * qla2x00_erase_flash() - Erase the flash.
+ * @ha: HA context
+ * @man_id: Flash manufacturer ID
+ * @flash_id: Flash ID
+ *
+ * Returns 0 on success, else non-zero.
+ */
+static int
+qla2x00_erase_flash(scsi_qla_host_t *ha, uint8_t man_id, uint8_t flash_id)
+{
+       /* Individual Sector Erase Command Sequence */
+       if (IS_OEM_001(ha)) {
+               qla2x00_write_flash_byte(ha, 0xaaa, 0xaa);
+               qla2x00_write_flash_byte(ha, 0x555, 0x55);
+               qla2x00_write_flash_byte(ha, 0xaaa, 0x80);
+               qla2x00_write_flash_byte(ha, 0xaaa, 0xaa);
+               qla2x00_write_flash_byte(ha, 0x555, 0x55);
+               qla2x00_write_flash_byte(ha, 0xaaa, 0x10);
+       } else {
+               qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
+               qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
+               qla2x00_write_flash_byte(ha, 0x5555, 0x80);
+               qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
+               qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
+               qla2x00_write_flash_byte(ha, 0x5555, 0x10);
+       }
+
+       udelay(150);
+
+       /* Wait for erase to complete. */
+       return qla2x00_poll_flash(ha, 0x00, 0x80, man_id, flash_id);
+}
+
+/**
+ * qla2x00_erase_flash_sector() - Erase a flash sector.
+ * @ha: HA context
+ * @addr: Flash sector to erase
+ * @sec_mask: Sector address mask
+ * @man_id: Flash manufacturer ID
+ * @flash_id: Flash ID
+ *
+ * Returns 0 on success, else non-zero.
+ */
+static int
+qla2x00_erase_flash_sector(scsi_qla_host_t *ha, uint32_t addr,
+    uint32_t sec_mask, uint8_t man_id, uint8_t flash_id)
+{
+       /* Individual Sector Erase Command Sequence */
+       qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
+       qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
+       qla2x00_write_flash_byte(ha, 0x5555, 0x80);
+       qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
+       qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
+       if (man_id == 0x1f && flash_id == 0x13)
+               qla2x00_write_flash_byte(ha, addr & sec_mask, 0x10);
+       else
+               qla2x00_write_flash_byte(ha, addr & sec_mask, 0x30);
+
+       udelay(150);
+
+       /* Wait for erase to complete. */
+       return qla2x00_poll_flash(ha, addr, 0x80, man_id, flash_id);
+}
+
+/**
+ * qla2x00_get_flash_manufacturer() - Read manufacturer ID from flash chip.
+ * @man_id: Flash manufacturer ID
+ * @flash_id: Flash ID
+ */
+static void
+qla2x00_get_flash_manufacturer(scsi_qla_host_t *ha, uint8_t *man_id,
+    uint8_t *flash_id)
+{
+       qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
+       qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
+       qla2x00_write_flash_byte(ha, 0x5555, 0x90);
+       *man_id = qla2x00_read_flash_byte(ha, 0x0000);
+       *flash_id = qla2x00_read_flash_byte(ha, 0x0001);
+       qla2x00_write_flash_byte(ha, 0x5555, 0xaa);
+       qla2x00_write_flash_byte(ha, 0x2aaa, 0x55);
+       qla2x00_write_flash_byte(ha, 0x5555, 0xf0);
+}
+
+
+static inline void
+qla2x00_suspend_hba(struct scsi_qla_host *ha)
+{
+       int cnt;
+       unsigned long flags;
+       struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
+
+       /* Suspend HBA. */
+       scsi_block_requests(ha->host);
+       ha->isp_ops.disable_intrs(ha);
+       set_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags);
+
+       /* Pause RISC. */
+       spin_lock_irqsave(&ha->hardware_lock, flags);
+       WRT_REG_WORD(&reg->hccr, HCCR_PAUSE_RISC);
+       RD_REG_WORD(&reg->hccr);
+       if (IS_QLA2100(ha) || IS_QLA2200(ha) || IS_QLA2300(ha)) {
+               for (cnt = 0; cnt < 30000; cnt++) {
+                       if ((RD_REG_WORD(&reg->hccr) & HCCR_RISC_PAUSE) != 0)
+                               break;
+                       udelay(100);
+               }
+       } else {
+               udelay(10);
+       }
+       spin_unlock_irqrestore(&ha->hardware_lock, flags);
+}
+
+static inline void
+qla2x00_resume_hba(struct scsi_qla_host *ha)
+{
+       /* Resume HBA. */
+       clear_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags);
+       set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+       up(ha->dpc_wait);
+       qla2x00_wait_for_hba_online(ha);
+       scsi_unblock_requests(ha->host);
+}
+
+uint8_t *
+qla2x00_read_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
+    uint32_t offset, uint32_t length)
+{
+       unsigned long flags;
+       uint32_t addr, midpoint;
+       uint8_t *data;
+       struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
+
+       /* Suspend HBA. */
+       qla2x00_suspend_hba(ha);
+
+       /* Go with read. */
+       spin_lock_irqsave(&ha->hardware_lock, flags);
+       midpoint = ha->optrom_size / 2;
+
+       qla2x00_flash_enable(ha);
+       WRT_REG_WORD(&reg->nvram, 0);
+       RD_REG_WORD(&reg->nvram);               /* PCI Posting. */
+       for (addr = offset, data = buf; addr < length; addr++, data++) {
+               if (addr == midpoint) {
+                       WRT_REG_WORD(&reg->nvram, NVR_SELECT);
+                       RD_REG_WORD(&reg->nvram);       /* PCI Posting. */
+               }
+
+               *data = qla2x00_read_flash_byte(ha, addr);
+       }
+       qla2x00_flash_disable(ha);
+       spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+       /* Resume HBA. */
+       qla2x00_resume_hba(ha);
+
+       return buf;
+}
+
+int
+qla2x00_write_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
+    uint32_t offset, uint32_t length)
+{
+
+       int rval;
+       unsigned long flags;
+       uint8_t man_id, flash_id, sec_number, data;
+       uint16_t wd;
+       uint32_t addr, liter, sec_mask, rest_addr;
+       struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
+
+       /* Suspend HBA. */
+       qla2x00_suspend_hba(ha);
+
+       rval = QLA_SUCCESS;
+       sec_number = 0;
+
+       /* Reset ISP chip. */
+       spin_lock_irqsave(&ha->hardware_lock, flags);
+       WRT_REG_WORD(&reg->ctrl_status, CSR_ISP_SOFT_RESET);
+       pci_read_config_word(ha->pdev, PCI_COMMAND, &wd);
+
+       /* Go with write. */
+       qla2x00_flash_enable(ha);
+       do {    /* Loop once to provide quick error exit */
+               /* Structure of flash memory based on manufacturer */
+               if (IS_OEM_001(ha)) {
+                       /* OEM variant with special flash part. */
+                       man_id = flash_id = 0;
+                       rest_addr = 0xffff;
+                       sec_mask   = 0x10000;
+                       goto update_flash;
+               }
+               qla2x00_get_flash_manufacturer(ha, &man_id, &flash_id);
+               switch (man_id) {
+               case 0x20: /* ST flash. */
+                       if (flash_id == 0xd2 || flash_id == 0xe3) {
+                               /*
+                                * ST m29w008at part - 64kb sector size with
+                                * 32kb,8kb,8kb,16kb sectors at memory address
+                                * 0xf0000.
+                                */
+                               rest_addr = 0xffff;
+                               sec_mask = 0x10000;
+                               break;   
+                       }
+                       /*
+                        * ST m29w010b part - 16kb sector size
+                        * Default to 16kb sectors
+                        */
+                       rest_addr = 0x3fff;
+                       sec_mask = 0x1c000;
+                       break;
+               case 0x40: /* Mostel flash. */
+                       /* Mostel v29c51001 part - 512 byte sector size. */
+                       rest_addr = 0x1ff;
+                       sec_mask = 0x1fe00;
+                       break;
+               case 0xbf: /* SST flash. */
+                       /* SST39sf10 part - 4kb sector size. */
+                       rest_addr = 0xfff;
+                       sec_mask = 0x1f000;
+                       break;
+               case 0xda: /* Winbond flash. */
+                       /* Winbond W29EE011 part - 256 byte sector size. */
+                       rest_addr = 0x7f;
+                       sec_mask = 0x1ff80;
+                       break;
+               case 0xc2: /* Macronix flash. */
+                       /* 64k sector size. */
+                       if (flash_id == 0x38 || flash_id == 0x4f) {
+                               rest_addr = 0xffff;
+                               sec_mask = 0x10000;
+                               break;
+                       }
+                       /* Fall through... */
+
+               case 0x1f: /* Atmel flash. */
+                       /* 512k sector size. */
+                       if (flash_id == 0x13) {
+                               rest_addr = 0x7fffffff;
+                               sec_mask =   0x80000000;
+                               break;
+                       }
+                       /* Fall through... */
+
+               case 0x01: /* AMD flash. */
+                       if (flash_id == 0x38 || flash_id == 0x40 ||
+                           flash_id == 0x4f) {
+                               /* Am29LV081 part - 64kb sector size. */
+                               /* Am29LV002BT part - 64kb sector size. */
+                               rest_addr = 0xffff;
+                               sec_mask = 0x10000;
+                               break;
+                       } else if (flash_id == 0x3e) {
+                               /*
+                                * Am29LV008b part - 64kb sector size with
+                                * 32kb,8kb,8kb,16kb sector at memory address
+                                * h0xf0000.
+                                */
+                               rest_addr = 0xffff;
+                               sec_mask = 0x10000;
+                               break;
+                       } else if (flash_id == 0x20 || flash_id == 0x6e) {
+                               /*
+                                * Am29LV010 part or AM29f010 - 16kb sector
+                                * size.
+                                */
+                               rest_addr = 0x3fff;
+                               sec_mask = 0x1c000;
+                               break;
+                       } else if (flash_id == 0x6d) {
+                               /* Am29LV001 part - 8kb sector size. */
+                               rest_addr = 0x1fff;
+                               sec_mask = 0x1e000;
+                               break;
+                       }
+               default:
+                       /* Default to 16 kb sector size. */
+                       rest_addr = 0x3fff;
+                       sec_mask = 0x1c000;
+                       break;
+               }
+
+update_flash:
+               if (IS_QLA2322(ha) || IS_QLA6322(ha)) {
+                       if (qla2x00_erase_flash(ha, man_id, flash_id)) {
+                               rval = QLA_FUNCTION_FAILED;
+                               break;
+                       }
+               }
+
+               for (addr = offset, liter = 0; liter < length; liter++,
+                   addr++) {
+                       data = buf[liter];
+                       /* Are we at the beginning of a sector? */
+                       if ((addr & rest_addr) == 0) {
+                               if (IS_QLA2322(ha) || IS_QLA6322(ha)) {
+                                       if (addr >= 0x10000UL) {
+                                               if (((addr >> 12) & 0xf0) &&
+                                                   ((man_id == 0x01 &&
+                                                       flash_id == 0x3e) ||
+                                                    (man_id == 0x20 &&
+                                                        flash_id == 0xd2))) {
+                                                       sec_number++;
+                                                       if (sec_number == 1) {
+                                                               rest_addr =
+                                                                   0x7fff;
+                                                               sec_mask =
+                                                                   0x18000;
+                                                       } else if (
+                                                           sec_number == 2 ||
+                                                           sec_number == 3) {
+                                                               rest_addr =
+                                                                   0x1fff;
+                                                               sec_mask =
+                                                                   0x1e000;
+                                                       } else if (
+                                                           sec_number == 4) {
+                                                               rest_addr =
+                                                                   0x3fff;
+                                                               sec_mask =
+                                                                   0x1c000;
+                                                       }
+                                               }
+                                       }
+                               } else if (addr == ha->optrom_size / 2) {
+                                       WRT_REG_WORD(&reg->nvram, NVR_SELECT);
+                                       RD_REG_WORD(&reg->nvram);
+                               }
+
+                               if (flash_id == 0xda && man_id == 0xc1) {
+                                       qla2x00_write_flash_byte(ha, 0x5555,
+                                           0xaa);
+                                       qla2x00_write_flash_byte(ha, 0x2aaa,
+                                           0x55);
+                                       qla2x00_write_flash_byte(ha, 0x5555,
+                                           0xa0);
+                               } else if (!IS_QLA2322(ha) && !IS_QLA6322(ha)) {
+                                       /* Then erase it */
+                                       if (qla2x00_erase_flash_sector(ha,
+                                           addr, sec_mask, man_id,
+                                           flash_id)) {
+                                               rval = QLA_FUNCTION_FAILED;
+                                               break;
+                                       }
+                                       if (man_id == 0x01 && flash_id == 0x6d)
+                                               sec_number++;
+                               }
+                       }
+
+                       if (man_id == 0x01 && flash_id == 0x6d) {
+                               if (sec_number == 1 &&
+                                   addr == (rest_addr - 1)) {
+                                       rest_addr = 0x0fff;
+                                       sec_mask   = 0x1f000;
+                               } else if (sec_number == 3 && (addr & 0x7ffe)) {
+                                       rest_addr = 0x3fff;
+                                       sec_mask   = 0x1c000;
+                               }
+                       }
+
+                       if (qla2x00_program_flash_address(ha, addr, data,
+                           man_id, flash_id)) {
+                               rval = QLA_FUNCTION_FAILED;
+                               break;
+                       }
+               }
+       } while (0);
+       qla2x00_flash_disable(ha);
+       spin_unlock_irqrestore(&ha->hardware_lock, flags);
+
+       /* Resume HBA. */
+       qla2x00_resume_hba(ha);
+
+       return rval;
+}
+
+uint8_t *
+qla24xx_read_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
+    uint32_t offset, uint32_t length)
+{
+       /* Suspend HBA. */
+       scsi_block_requests(ha->host);
+       ha->isp_ops.disable_intrs(ha);
+       set_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags);
+
+       /* Go with read. */
+       qla24xx_read_flash_data(ha, (uint32_t *)buf, offset >> 2, length >> 2);
+
+       /* Resume HBA. */
+       clear_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags);
+       ha->isp_ops.enable_intrs(ha);
+       scsi_unblock_requests(ha->host);
+
+       return buf;
+}
+
+int
+qla24xx_write_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
+    uint32_t offset, uint32_t length)
+{
+       int rval;
+
+       /* Suspend HBA. */
+       scsi_block_requests(ha->host);
+       ha->isp_ops.disable_intrs(ha);
+       set_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags);
+
+       /* Go with write. */
+       rval = qla24xx_write_flash_data(ha, (uint32_t *)buf, offset >> 2,
+           length >> 2);
+
+       /* Resume HBA -- RISC reset needed. */
+       clear_bit(MBX_UPDATE_FLASH_ACTIVE, &ha->mbx_cmd_flags);
+       set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+       up(ha->dpc_wait);
+       qla2x00_wait_for_hba_online(ha);
+       scsi_unblock_requests(ha->host);
+
+       return rval;
+}
index cd54244058b513d7d8c56b42c0da6ab1f8c66172..6fddf17a3b70788f5335d37b986cdd2c721179d8 100644 (file)
@@ -509,6 +509,12 @@ static const struct mv_hw_ops mv6xxx_ops = {
        .reset_bus              = mv_reset_pci_bus,
 };
 
+/*
+ * module options
+ */
+static int msi;              /* Use PCI msi; either zero (off, default) or non-zero */
+
+
 /*
  * Functions
  */
@@ -2191,7 +2197,7 @@ static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
 
        /* Enable interrupts */
-       if (pci_enable_msi(pdev) == 0) {
+       if (msi && pci_enable_msi(pdev) == 0) {
                hpriv->hp_flags |= MV_HP_FLAG_MSI;
        } else {
                pci_intx(pdev, 1);
@@ -2246,5 +2252,8 @@ MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, mv_pci_tbl);
 MODULE_VERSION(DRV_VERSION);
 
+module_param(msi, int, 0444);
+MODULE_PARM_DESC(msi, "Enable use of PCI MSI (0=off, 1=on)");
+
 module_init(mv_init);
 module_exit(mv_exit);
index b017f85e6d6a12598436f2b5279ce734ccee0597..17f74d3c10e7c76ff4ef97846c61baa72bb9f4b4 100644 (file)
@@ -231,6 +231,10 @@ MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, sil_pci_tbl);
 MODULE_VERSION(DRV_VERSION);
 
+static int slow_down = 0;
+module_param(slow_down, int, 0444);
+MODULE_PARM_DESC(slow_down, "Sledgehammer used to work around random problems, by limiting commands to 15 sectors (0=off, 1=on)");
+
 
 static unsigned char sil_get_device_cache_line(struct pci_dev *pdev)
 {
@@ -354,8 +358,10 @@ static void sil_dev_config(struct ata_port *ap, struct ata_device *dev)
                }
 
        /* limit requests to 15 sectors */
-       if ((ap->flags & SIL_FLAG_MOD15WRITE) && (quirks & SIL_QUIRK_MOD15WRITE)) {
-               printk(KERN_INFO "ata%u(%u): applying Seagate errata fix\n",
+       if (slow_down ||
+           ((ap->flags & SIL_FLAG_MOD15WRITE) &&
+            (quirks & SIL_QUIRK_MOD15WRITE))) {
+               printk(KERN_INFO "ata%u(%u): applying Seagate errata fix (mod15write workaround)\n",
                       ap->id, dev->devno);
                ap->host->max_sectors = 15;
                ap->host->hostt->max_sectors = 15;
index 4a602853a98e72f89b94757c4b9e56b87587ad53..4362dcde74afddaf797587b67b5a65c79d942599 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
+#include <linux/hardirq.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_dbg.h>
@@ -2248,3 +2249,61 @@ scsi_target_unblock(struct device *dev)
                device_for_each_child(dev, NULL, target_unblock);
 }
 EXPORT_SYMBOL_GPL(scsi_target_unblock);
+
+
+struct work_queue_work {
+       struct work_struct      work;
+       void                    (*fn)(void *);
+       void                    *data;
+};
+
+static void execute_in_process_context_work(void *data)
+{
+       void (*fn)(void *data);
+       struct work_queue_work *wqw = data;
+
+       fn = wqw->fn;
+       data = wqw->data;
+
+       kfree(wqw);
+
+       fn(data);
+}
+
+/**
+ * scsi_execute_in_process_context - reliably execute the routine with user context
+ * @fn:                the function to execute
+ * @data:      data to pass to the function
+ *
+ * Executes the function immediately if process context is available,
+ * otherwise schedules the function for delayed execution.
+ *
+ * Returns:    0 - function was executed
+ *             1 - function was scheduled for execution
+ *             <0 - error
+ */
+int scsi_execute_in_process_context(void (*fn)(void *data), void *data)
+{
+       struct work_queue_work *wqw;
+
+       if (!in_interrupt()) {
+               fn(data);
+               return 0;
+       }
+
+       wqw = kmalloc(sizeof(struct work_queue_work), GFP_ATOMIC);
+
+       if (unlikely(!wqw)) {
+               printk(KERN_ERR "Failed to allocate memory\n");
+               WARN_ON(1);
+               return -ENOMEM;
+       }
+
+       INIT_WORK(&wqw->work, execute_in_process_context_work, wqw);
+       wqw->fn = fn;
+       wqw->data = data;
+       schedule_work(&wqw->work);
+
+       return 1;
+}
+EXPORT_SYMBOL_GPL(scsi_execute_in_process_context);
index 752fb5da3de4f55e461c2b93d3e3e108a2b2a89d..5acb83ca5ae535edfb3938395e0b53d67a5a41cf 100644 (file)
@@ -387,19 +387,12 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
        return found_target;
 }
 
-struct work_queue_wrapper {
-       struct work_struct      work;
-       struct scsi_target      *starget;
-};
-
-static void scsi_target_reap_work(void *data) {
-       struct work_queue_wrapper *wqw = (struct work_queue_wrapper *)data;
-       struct scsi_target *starget = wqw->starget;
+static void scsi_target_reap_usercontext(void *data)
+{
+       struct scsi_target *starget = data;
        struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
        unsigned long flags;
 
-       kfree(wqw);
-
        spin_lock_irqsave(shost->host_lock, flags);
 
        if (--starget->reap_ref == 0 && list_empty(&starget->devices)) {
@@ -428,18 +421,7 @@ static void scsi_target_reap_work(void *data) {
  */
 void scsi_target_reap(struct scsi_target *starget)
 {
-       struct work_queue_wrapper *wqw = 
-               kzalloc(sizeof(struct work_queue_wrapper), GFP_ATOMIC);
-
-       if (!wqw) {
-               starget_printk(KERN_ERR, starget,
-                              "Failed to allocate memory in scsi_reap_target()\n");
-               return;
-       }
-
-       INIT_WORK(&wqw->work, scsi_target_reap_work, wqw);
-       wqw->starget = starget;
-       schedule_work(&wqw->work);
+       scsi_execute_in_process_context(scsi_target_reap_usercontext, starget);
 }
 
 /**
index a77b32deaf8fdb732d45371a0eacf2c73a28d672..902a5def8e62102591e1b2e4657eb560d258efc2 100644 (file)
@@ -217,8 +217,9 @@ static void scsi_device_cls_release(struct class_device *class_dev)
        put_device(&sdev->sdev_gendev);
 }
 
-static void scsi_device_dev_release(struct device *dev)
+static void scsi_device_dev_release_usercontext(void *data)
 {
+       struct device *dev = data;
        struct scsi_device *sdev;
        struct device *parent;
        struct scsi_target *starget;
@@ -237,6 +238,7 @@ static void scsi_device_dev_release(struct device *dev)
 
        if (sdev->request_queue) {
                sdev->request_queue->queuedata = NULL;
+               /* user context needed to free queue */
                scsi_free_queue(sdev->request_queue);
                /* temporary expedient, try to catch use of queue lock
                 * after free of sdev */
@@ -252,6 +254,11 @@ static void scsi_device_dev_release(struct device *dev)
                put_device(parent);
 }
 
+static void scsi_device_dev_release(struct device *dev)
+{
+       scsi_execute_in_process_context(scsi_device_dev_release_usercontext,    dev);
+}
+
 static struct class sdev_class = {
        .name           = "scsi_device",
        .release        = scsi_device_cls_release,
index 723f7acbeb12b48c830f1e59ce3679478c633f2a..71e54a64adca01b5f71934d52e67f48fcfc34123 100644 (file)
@@ -38,10 +38,6 @@ struct iscsi_internal {
        struct scsi_transport_template t;
        struct iscsi_transport *iscsi_transport;
        struct list_head list;
-       /*
-        * List of sessions for this transport
-        */
-       struct list_head sessions;
        /*
         * based on transport capabilities, at register time we set these
         * bits to tell the transport class it wants attributes displayed
@@ -164,9 +160,43 @@ static struct mempool_zone *z_reply;
 #define Z_MAX_ERROR    16
 #define Z_HIWAT_ERROR  12
 
+static LIST_HEAD(sesslist);
+static DEFINE_SPINLOCK(sesslock);
 static LIST_HEAD(connlist);
 static DEFINE_SPINLOCK(connlock);
 
+static struct iscsi_cls_session *iscsi_session_lookup(uint64_t handle)
+{
+       unsigned long flags;
+       struct iscsi_cls_session *sess;
+
+       spin_lock_irqsave(&sesslock, flags);
+       list_for_each_entry(sess, &sesslist, sess_list) {
+               if (sess == iscsi_ptr(handle)) {
+                       spin_unlock_irqrestore(&sesslock, flags);
+                       return sess;
+               }
+       }
+       spin_unlock_irqrestore(&sesslock, flags);
+       return NULL;
+}
+
+static struct iscsi_cls_conn *iscsi_conn_lookup(uint64_t handle)
+{
+       unsigned long flags;
+       struct iscsi_cls_conn *conn;
+
+       spin_lock_irqsave(&connlock, flags);
+       list_for_each_entry(conn, &connlist, conn_list) {
+               if (conn == iscsi_ptr(handle)) {
+                       spin_unlock_irqrestore(&connlock, flags);
+                       return conn;
+               }
+       }
+       spin_unlock_irqrestore(&connlock, flags);
+       return NULL;
+}
+
 /*
  * The following functions can be used by LLDs that allocate
  * their own scsi_hosts or by software iscsi LLDs
@@ -365,6 +395,7 @@ iscsi_transport_create_session(struct scsi_transport_template *scsit,
 {
        struct iscsi_cls_session *session;
        struct Scsi_Host *shost;
+       unsigned long flags;
 
        shost = scsi_host_alloc(transport->host_template,
                                hostdata_privsize(transport));
@@ -389,6 +420,9 @@ iscsi_transport_create_session(struct scsi_transport_template *scsit,
                goto remove_host;
 
        *(unsigned long*)shost->hostdata = (unsigned long)session;
+       spin_lock_irqsave(&sesslock, flags);
+       list_add(&session->sess_list, &sesslist);
+       spin_unlock_irqrestore(&sesslock, flags);
        return shost;
 
 remove_host:
@@ -410,9 +444,13 @@ EXPORT_SYMBOL_GPL(iscsi_transport_create_session);
 int iscsi_transport_destroy_session(struct Scsi_Host *shost)
 {
        struct iscsi_cls_session *session;
+       unsigned long flags;
 
        scsi_remove_host(shost);
        session = hostdata_session(shost->hostdata);
+       spin_lock_irqsave(&sesslock, flags);
+       list_del(&session->sess_list);
+       spin_unlock_irqrestore(&sesslock, flags);
        iscsi_destroy_session(session);
        /* ref from host alloc */
        scsi_host_put(shost);
@@ -424,22 +462,6 @@ EXPORT_SYMBOL_GPL(iscsi_transport_destroy_session);
 /*
  * iscsi interface functions
  */
-static struct iscsi_cls_conn*
-iscsi_if_find_conn(uint64_t key)
-{
-       unsigned long flags;
-       struct iscsi_cls_conn *conn;
-
-       spin_lock_irqsave(&connlock, flags);
-       list_for_each_entry(conn, &connlist, conn_list)
-               if (conn->connh == key) {
-                       spin_unlock_irqrestore(&connlock, flags);
-                       return conn;
-               }
-       spin_unlock_irqrestore(&connlock, flags);
-       return NULL;
-}
-
 static struct iscsi_internal *
 iscsi_if_transport_lookup(struct iscsi_transport *tt)
 {
@@ -504,6 +526,12 @@ mempool_zone_init(unsigned max, unsigned size, unsigned hiwat)
        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) {
@@ -511,13 +539,6 @@ mempool_zone_init(unsigned max, unsigned size, unsigned hiwat)
                return NULL;
        }
 
-       zp->size = size;
-       zp->hiwat = hiwat;
-
-       INIT_LIST_HEAD(&zp->freequeue);
-       spin_lock_init(&zp->freelock);
-       atomic_set(&zp->allocated, 0);
-
        return zp;
 }
 
@@ -559,25 +580,21 @@ iscsi_unicast_skb(struct mempool_zone *zone, struct sk_buff *skb)
        return 0;
 }
 
-int iscsi_recv_pdu(iscsi_connh_t connh, struct iscsi_hdr *hdr,
+int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
                   char *data, uint32_t data_size)
 {
        struct nlmsghdr *nlh;
        struct sk_buff *skb;
        struct iscsi_uevent *ev;
-       struct iscsi_cls_conn *conn;
        char *pdu;
        int len = NLMSG_SPACE(sizeof(*ev) + sizeof(struct iscsi_hdr) +
                              data_size);
 
-       conn = iscsi_if_find_conn(connh);
-       BUG_ON(!conn);
-
        mempool_zone_complete(conn->z_pdu);
 
        skb = mempool_zone_get_skb(conn->z_pdu);
        if (!skb) {
-               iscsi_conn_error(connh, ISCSI_ERR_CONN_FAILED);
+               iscsi_conn_error(conn, ISCSI_ERR_CONN_FAILED);
                dev_printk(KERN_ERR, &conn->dev, "iscsi: can not deliver "
                           "control PDU: OOM\n");
                return -ENOMEM;
@@ -590,7 +607,7 @@ int iscsi_recv_pdu(iscsi_connh_t connh, struct iscsi_hdr *hdr,
        ev->type = ISCSI_KEVENT_RECV_PDU;
        if (atomic_read(&conn->z_pdu->allocated) >= conn->z_pdu->hiwat)
                ev->iferror = -ENOMEM;
-       ev->r.recv_req.conn_handle = connh;
+       ev->r.recv_req.conn_handle = iscsi_handle(conn);
        pdu = (char*)ev + sizeof(*ev);
        memcpy(pdu, hdr, sizeof(struct iscsi_hdr));
        memcpy(pdu + sizeof(struct iscsi_hdr), data, data_size);
@@ -599,17 +616,13 @@ int iscsi_recv_pdu(iscsi_connh_t connh, struct iscsi_hdr *hdr,
 }
 EXPORT_SYMBOL_GPL(iscsi_recv_pdu);
 
-void iscsi_conn_error(iscsi_connh_t connh, enum iscsi_err error)
+void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error)
 {
        struct nlmsghdr *nlh;
        struct sk_buff  *skb;
        struct iscsi_uevent *ev;
-       struct iscsi_cls_conn *conn;
        int len = NLMSG_SPACE(sizeof(*ev));
 
-       conn = iscsi_if_find_conn(connh);
-       BUG_ON(!conn);
-
        mempool_zone_complete(conn->z_error);
 
        skb = mempool_zone_get_skb(conn->z_error);
@@ -626,7 +639,7 @@ void iscsi_conn_error(iscsi_connh_t connh, enum iscsi_err error)
        if (atomic_read(&conn->z_error->allocated) >= conn->z_error->hiwat)
                ev->iferror = -ENOMEM;
        ev->r.connerror.error = error;
-       ev->r.connerror.conn_handle = connh;
+       ev->r.connerror.conn_handle = iscsi_handle(conn);
 
        iscsi_unicast_skb(conn->z_error, skb);
 
@@ -662,8 +675,7 @@ iscsi_if_send_reply(int pid, int seq, int type, int done, int multi,
 }
 
 static int
-iscsi_if_get_stats(struct iscsi_transport *transport, struct sk_buff *skb,
-                  struct nlmsghdr *nlh)
+iscsi_if_get_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh)
 {
        struct iscsi_uevent *ev = NLMSG_DATA(nlh);
        struct iscsi_stats *stats;
@@ -677,7 +689,7 @@ iscsi_if_get_stats(struct iscsi_transport *transport, struct sk_buff *skb,
                              ISCSI_STATS_CUSTOM_MAX);
        int err = 0;
 
-       conn = iscsi_if_find_conn(ev->u.get_stats.conn_handle);
+       conn = iscsi_conn_lookup(ev->u.get_stats.conn_handle);
        if (!conn)
                return -EEXIST;
 
@@ -707,14 +719,14 @@ iscsi_if_get_stats(struct iscsi_transport *transport, struct sk_buff *skb,
                        ((char*)evstat + sizeof(*evstat));
                memset(stats, 0, sizeof(*stats));
 
-               transport->get_stats(ev->u.get_stats.conn_handle, stats);
+               transport->get_stats(conn, stats);
                actual_size = NLMSG_SPACE(sizeof(struct iscsi_uevent) +
                                          sizeof(struct iscsi_stats) +
                                          sizeof(struct iscsi_stats_custom) *
                                          stats->custom_length);
                actual_size -= sizeof(*nlhstat);
                actual_size = NLMSG_LENGTH(actual_size);
-               skb_trim(skb, NLMSG_ALIGN(actual_size));
+               skb_trim(skbstat, NLMSG_ALIGN(actual_size));
                nlhstat->nlmsg_len = actual_size;
 
                err = iscsi_unicast_skb(conn->z_pdu, skbstat);
@@ -727,58 +739,34 @@ static int
 iscsi_if_create_session(struct iscsi_internal *priv, struct iscsi_uevent *ev)
 {
        struct iscsi_transport *transport = priv->iscsi_transport;
-       struct Scsi_Host *shost;
-
-       if (!transport->create_session)
-               return -EINVAL;
+       struct iscsi_cls_session *session;
+       uint32_t sid;
 
-       shost = transport->create_session(&priv->t,
-                                         ev->u.c_session.initial_cmdsn);
-       if (!shost)
+       session = transport->create_session(&priv->t,
+                                           ev->u.c_session.initial_cmdsn,
+                                           &sid);
+       if (!session)
                return -ENOMEM;
 
-       ev->r.c_session_ret.session_handle = iscsi_handle(iscsi_hostdata(shost->hostdata));
-       ev->r.c_session_ret.sid = shost->host_no;
+       ev->r.c_session_ret.session_handle = iscsi_handle(session);
+       ev->r.c_session_ret.sid = sid;
        return 0;
 }
 
 static int
-iscsi_if_destroy_session(struct iscsi_internal *priv, struct iscsi_uevent *ev)
+iscsi_if_create_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev)
 {
-       struct iscsi_transport *transport = priv->iscsi_transport;
-
-       struct Scsi_Host *shost;
-
-       if (!transport->destroy_session)
-               return -EINVAL;
-
-       shost = scsi_host_lookup(ev->u.d_session.sid);
-       if (shost == ERR_PTR(-ENXIO))
-               return -EEXIST;
-
-       if (transport->destroy_session)
-               transport->destroy_session(shost);
-        /* ref from host lookup */
-        scsi_host_put(shost);
-       return 0;
-}
-
-static int
-iscsi_if_create_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev){
-       struct Scsi_Host *shost;
        struct iscsi_cls_conn *conn;
+       struct iscsi_cls_session *session;
        unsigned long flags;
 
-       if (!transport->create_conn)
+       session = iscsi_session_lookup(ev->u.c_conn.session_handle);
+       if (!session)
                return -EINVAL;
 
-       shost = scsi_host_lookup(ev->u.c_conn.sid);
-       if (shost == ERR_PTR(-ENXIO))
-               return -EEXIST;
-
-       conn = transport->create_conn(shost, ev->u.c_conn.cid);
+       conn = transport->create_conn(session, ev->u.c_conn.cid);
        if (!conn)
-               goto release_ref;
+               return -ENOMEM;
 
        conn->z_pdu = mempool_zone_init(Z_MAX_PDU,
                        NLMSG_SPACE(sizeof(struct iscsi_uevent) +
@@ -800,14 +788,13 @@ iscsi_if_create_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev)
                goto free_pdu_pool;
        }
 
-       ev->r.handle = conn->connh = iscsi_handle(conn->dd_data);
+       ev->r.handle = iscsi_handle(conn);
 
        spin_lock_irqsave(&connlock, flags);
        list_add(&conn->conn_list, &connlist);
        conn->active = 1;
        spin_unlock_irqrestore(&connlock, flags);
 
-       scsi_host_put(shost);
        return 0;
 
 free_pdu_pool:
@@ -815,8 +802,6 @@ free_pdu_pool:
 destroy_conn:
        if (transport->destroy_conn)
                transport->destroy_conn(conn->dd_data);
-release_ref:
-       scsi_host_put(shost);
        return -ENOMEM;
 }
 
@@ -827,13 +812,9 @@ iscsi_if_destroy_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev
        struct iscsi_cls_conn *conn;
        struct mempool_zone *z_error, *z_pdu;
 
-       conn = iscsi_if_find_conn(ev->u.d_conn.conn_handle);
+       conn = iscsi_conn_lookup(ev->u.d_conn.conn_handle);
        if (!conn)
-               return -EEXIST;
-
-       if (!transport->destroy_conn)
                return -EINVAL;
-
        spin_lock_irqsave(&connlock, flags);
        conn->active = 0;
        list_del(&conn->conn_list);
@@ -858,23 +839,27 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
        struct iscsi_uevent *ev = NLMSG_DATA(nlh);
        struct iscsi_transport *transport = NULL;
        struct iscsi_internal *priv;
-
-       if (NETLINK_CREDS(skb)->uid)
-               return -EPERM;
+       struct iscsi_cls_session *session;
+       struct iscsi_cls_conn *conn;
 
        priv = iscsi_if_transport_lookup(iscsi_ptr(ev->transport_handle));
        if (!priv)
                return -EINVAL;
        transport = priv->iscsi_transport;
 
-       daemon_pid = NETLINK_CREDS(skb)->pid;
+       if (!try_module_get(transport->owner))
+               return -EINVAL;
 
        switch (nlh->nlmsg_type) {
        case ISCSI_UEVENT_CREATE_SESSION:
                err = iscsi_if_create_session(priv, ev);
                break;
        case ISCSI_UEVENT_DESTROY_SESSION:
-               err = iscsi_if_destroy_session(priv, ev);
+               session = iscsi_session_lookup(ev->u.d_session.session_handle);
+               if (session)
+                       transport->destroy_session(session);
+               else
+                       err = -EINVAL;
                break;
        case ISCSI_UEVENT_CREATE_CONN:
                err = iscsi_if_create_conn(transport, ev);
@@ -883,56 +868,64 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                err = iscsi_if_destroy_conn(transport, ev);
                break;
        case ISCSI_UEVENT_BIND_CONN:
-               if (!iscsi_if_find_conn(ev->u.b_conn.conn_handle))
-                       return -EEXIST;
-               ev->r.retcode = transport->bind_conn(
-                       ev->u.b_conn.session_handle,
-                       ev->u.b_conn.conn_handle,
-                       ev->u.b_conn.transport_fd,
-                       ev->u.b_conn.is_leading);
+               session = iscsi_session_lookup(ev->u.b_conn.session_handle);
+               conn = iscsi_conn_lookup(ev->u.b_conn.conn_handle);
+
+               if (session && conn)
+                       ev->r.retcode = transport->bind_conn(session, conn,
+                                       ev->u.b_conn.transport_fd,
+                                       ev->u.b_conn.is_leading);
+               else
+                       err = -EINVAL;
                break;
        case ISCSI_UEVENT_SET_PARAM:
-               if (!iscsi_if_find_conn(ev->u.set_param.conn_handle))
-                       return -EEXIST;
-               ev->r.retcode = transport->set_param(
-                       ev->u.set_param.conn_handle,
-                       ev->u.set_param.param, ev->u.set_param.value);
+               conn = iscsi_conn_lookup(ev->u.set_param.conn_handle);
+               if (conn)
+                       ev->r.retcode = transport->set_param(conn,
+                               ev->u.set_param.param, ev->u.set_param.value);
+               else
+                       err = -EINVAL;
                break;
        case ISCSI_UEVENT_START_CONN:
-               if (!iscsi_if_find_conn(ev->u.start_conn.conn_handle))
-                       return -EEXIST;
-               ev->r.retcode = transport->start_conn(
-                       ev->u.start_conn.conn_handle);
+               conn = iscsi_conn_lookup(ev->u.start_conn.conn_handle);
+               if (conn)
+                       ev->r.retcode = transport->start_conn(conn);
+               else
+                       err = -EINVAL;
+
                break;
        case ISCSI_UEVENT_STOP_CONN:
-               if (!iscsi_if_find_conn(ev->u.stop_conn.conn_handle))
-                       return -EEXIST;
-               transport->stop_conn(ev->u.stop_conn.conn_handle,
-                       ev->u.stop_conn.flag);
+               conn = iscsi_conn_lookup(ev->u.stop_conn.conn_handle);
+               if (conn)
+                       transport->stop_conn(conn, ev->u.stop_conn.flag);
+               else
+                       err = -EINVAL;
                break;
        case ISCSI_UEVENT_SEND_PDU:
-               if (!iscsi_if_find_conn(ev->u.send_pdu.conn_handle))
-                       return -EEXIST;
-               ev->r.retcode = transport->send_pdu(
-                      ev->u.send_pdu.conn_handle,
-                      (struct iscsi_hdr*)((char*)ev + sizeof(*ev)),
-                      (char*)ev + sizeof(*ev) + ev->u.send_pdu.hdr_size,
-                       ev->u.send_pdu.data_size);
+               conn = iscsi_conn_lookup(ev->u.send_pdu.conn_handle);
+               if (conn)
+                       ev->r.retcode = transport->send_pdu(conn,
+                               (struct iscsi_hdr*)((char*)ev + sizeof(*ev)),
+                               (char*)ev + sizeof(*ev) + ev->u.send_pdu.hdr_size,
+                               ev->u.send_pdu.data_size);
+               else
+                       err = -EINVAL;
                break;
        case ISCSI_UEVENT_GET_STATS:
-               err = iscsi_if_get_stats(transport, skb, nlh);
+               err = iscsi_if_get_stats(transport, nlh);
                break;
        default:
                err = -EINVAL;
                break;
        }
 
+       module_put(transport->owner);
        return err;
 }
 
 /* Get message from skb (based on rtnetlink_rcv_skb).  Each message is
  * processed by iscsi_if_recv_msg.  Malformed skbs with wrong length are
- * discarded silently.  */
+ * or invalid creds discarded silently.  */
 static void
 iscsi_if_rx(struct sock *sk, int len)
 {
@@ -940,6 +933,12 @@ iscsi_if_rx(struct sock *sk, int len)
 
        mutex_lock(&rx_queue_mutex);
        while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) {
+               if (NETLINK_CREDS(skb)->uid) {
+                       skb_pull(skb, skb->len);
+                       goto free_skb;
+               }
+               daemon_pid = NETLINK_CREDS(skb)->pid;
+
                while (skb->len >= NLMSG_SPACE(0)) {
                        int err;
                        uint32_t rlen;
@@ -951,10 +950,12 @@ iscsi_if_rx(struct sock *sk, int len)
                            skb->len < nlh->nlmsg_len) {
                                break;
                        }
+
                        ev = NLMSG_DATA(nlh);
                        rlen = NLMSG_ALIGN(nlh->nlmsg_len);
                        if (rlen > skb->len)
                                rlen = skb->len;
+
                        err = iscsi_if_recv_msg(skb, nlh);
                        if (err) {
                                ev->type = ISCSI_KEVENT_IF_ERROR;
@@ -978,6 +979,7 @@ iscsi_if_rx(struct sock *sk, int len)
                        } while (err < 0 && err != -ECONNREFUSED);
                        skb_pull(skb, rlen);
                }
+free_skb:
                kfree_skb(skb);
        }
        mutex_unlock(&rx_queue_mutex);
@@ -997,7 +999,7 @@ show_conn_int_param_##param(struct class_device *cdev, char *buf)   \
        struct iscsi_cls_conn *conn = iscsi_cdev_to_conn(cdev);         \
        struct iscsi_transport *t = conn->transport;                    \
                                                                        \
-       t->get_conn_param(conn->dd_data, param, &value);                \
+       t->get_conn_param(conn, param, &value);                         \
        return snprintf(buf, 20, format"\n", value);                    \
 }
 
@@ -1024,10 +1026,9 @@ show_session_int_param_##param(struct class_device *cdev, char *buf)     \
 {                                                                      \
        uint32_t value = 0;                                             \
        struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev);        \
-       struct Scsi_Host *shost = iscsi_session_to_shost(session);      \
        struct iscsi_transport *t = session->transport;                 \
                                                                        \
-       t->get_session_param(shost, param, &value);                     \
+       t->get_session_param(session, param, &value);                   \
        return snprintf(buf, 20, format"\n", value);                    \
 }
 
@@ -1121,7 +1122,6 @@ iscsi_register_transport(struct iscsi_transport *tt)
                return NULL;
        memset(priv, 0, sizeof(*priv));
        INIT_LIST_HEAD(&priv->list);
-       INIT_LIST_HEAD(&priv->sessions);
        priv->iscsi_transport = tt;
 
        priv->cdev.class = &iscsi_transport_class;
index 8260f040d39c8ea82ba2eeb84cb810de062b132a..f4854c33f48d479c5d8901ef1326de3c2e4fecf0 100644 (file)
@@ -3588,7 +3588,7 @@ static int sym_evaluate_dp(struct sym_hcb *np, struct sym_ccb *cp, u32 scr, int
 
        if (pm) {
                dp_scr  = scr_to_cpu(pm->ret);
-               dp_ofs -= scr_to_cpu(pm->sg.size);
+               dp_ofs -= scr_to_cpu(pm->sg.size) & 0x00ffffff;
        }
 
        /*
index 1d85533d46d2170caecdb44779fd06e4885e90a0..f3763d2ccb866e31de2d3ff06ddda631f20eac7c 100644 (file)
@@ -1717,11 +1717,9 @@ ioc4_change_speed(struct uart_port *the_port,
        }
 
        if (cflag & CRTSCTS) {
-               info->flags |= ASYNC_CTS_FLOW;
                port->ip_sscr |= IOC4_SSCR_HFC_EN;
        }
        else {
-               info->flags &= ~ASYNC_CTS_FLOW;
                port->ip_sscr &= ~IOC4_SSCR_HFC_EN;
        }
        writel(port->ip_sscr, &port->ip_serial_regs->sscr);
@@ -1760,18 +1758,6 @@ static inline int ic4_startup_local(struct uart_port *the_port)
 
        info = the_port->info;
 
-       if (info->tty) {
-               set_bit(TTY_IO_ERROR, &info->tty->flags);
-               clear_bit(TTY_IO_ERROR, &info->tty->flags);
-               if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
-                       info->tty->alt_speed = 57600;
-               if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
-                       info->tty->alt_speed = 115200;
-               if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
-                       info->tty->alt_speed = 230400;
-               if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
-                       info->tty->alt_speed = 460800;
-       }
        local_open(port);
 
        /* set the speed of the serial port */
index e9e5bc178cef2e9a71eb2e70e96ced328ec7d00d..118288d944233bf4b54dd9209562836654f084d1 100644 (file)
@@ -191,8 +191,9 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
                }
                if (wait_time <= 0)
                        printk(KERN_WARNING "%s %s: BIOS handoff "
-                                       "failed (BIOS bug ?)\n",
-                                       pdev->dev.bus_id, "OHCI");
+                                       "failed (BIOS bug ?) %08x\n",
+                                       pdev->dev.bus_id, "OHCI",
+                                       readl(base + OHCI_CONTROL));
 
                /* reset controller, preserving RWC */
                writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL);
@@ -243,6 +244,12 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
                                pr_debug("%s %s: BIOS handoff\n",
                                                pdev->dev.bus_id, "EHCI");
 
+#if 0
+/* aleksey_gorelov@phoenix.com reports that some systems need SMI forced on,
+ * but that seems dubious in general (the BIOS left it off intentionally)
+ * and is known to prevent some systems from booting.  so we won't do this
+ * unless maybe we can determine when we're on a system that needs SMI forced.
+ */
                                /* BIOS workaround (?): be sure the
                                 * pre-Linux code receives the SMI
                                 */
@@ -252,6 +259,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
                                pci_write_config_dword(pdev,
                                                offset + EHCI_USBLEGCTLSTS,
                                                val | EHCI_USBLEGCTLSTS_SOOE);
+#endif
                        }
 
                        /* always say Linux will own the hardware
@@ -274,8 +282,8 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
                                 * it down, and hope nothing goes too wrong
                                 */
                                printk(KERN_WARNING "%s %s: BIOS handoff "
-                                               "failed (BIOS bug ?)\n",
-                                       pdev->dev.bus_id, "EHCI");
+                                               "failed (BIOS bug ?) %08x\n",
+                                       pdev->dev.bus_id, "EHCI", cap);
                                pci_write_config_byte(pdev, offset + 2, 0);
                        }
 
index 466384d7c79fa7a9c2785af8361fcc3fe4100cf3..134d2000128a557778f604cc3cba78130cc272db 100644 (file)
@@ -101,7 +101,7 @@ static struct resource resources[] = {
        },
 };
 
-extern struct device_driver sl811h_driver;
+extern struct platform_driver sl811h_driver;
 
 static struct platform_device platform_dev = {
        .id                     = -1,
@@ -132,7 +132,7 @@ static int sl811_hc_init(struct device *parent, ioaddr_t base_addr, int irq)
         * initialized already because of the link order dependency created
         * by referencing "sl811h_driver".
         */
-       platform_dev.name = sl811h_driver.name;
+       platform_dev.name = sl811h_driver.driver.name;
        return platform_device_register(&platform_dev);
 }
 
index 6f7a684c3e076fcc2467766e136a08f2ca6d90c9..772478086bd3237a29cc6562d49ce5866e07ae56 100644 (file)
@@ -1435,17 +1435,20 @@ void hid_init_reports(struct hid_device *hid)
 #define USB_DEVICE_ID_VERNIER_CYCLOPS  0x0004
 
 #define USB_VENDOR_ID_LD               0x0f11
-#define USB_DEVICE_ID_CASSY            0x1000
-#define USB_DEVICE_ID_POCKETCASSY      0x1010
-#define USB_DEVICE_ID_MOBILECASSY      0x1020
-#define USB_DEVICE_ID_JWM              0x1080
-#define USB_DEVICE_ID_DMMP             0x1081
-#define USB_DEVICE_ID_UMIP             0x1090
-#define USB_DEVICE_ID_VIDEOCOM         0x1200
-#define USB_DEVICE_ID_COM3LAB          0x2000
-#define USB_DEVICE_ID_TELEPORT         0x2010
-#define USB_DEVICE_ID_NETWORKANALYSER  0x2020
-#define USB_DEVICE_ID_POWERCONTROL     0x2030
+#define USB_DEVICE_ID_LD_CASSY         0x1000
+#define USB_DEVICE_ID_LD_POCKETCASSY   0x1010
+#define USB_DEVICE_ID_LD_MOBILECASSY   0x1020
+#define USB_DEVICE_ID_LD_JWM           0x1080
+#define USB_DEVICE_ID_LD_DMMP          0x1081
+#define USB_DEVICE_ID_LD_UMIP          0x1090
+#define USB_DEVICE_ID_LD_XRAY1         0x1100
+#define USB_DEVICE_ID_LD_XRAY2         0x1101
+#define USB_DEVICE_ID_LD_VIDEOCOM      0x1200
+#define USB_DEVICE_ID_LD_COM3LAB       0x2000
+#define USB_DEVICE_ID_LD_TELEPORT      0x2010
+#define USB_DEVICE_ID_LD_NETWORKANALYSER 0x2020
+#define USB_DEVICE_ID_LD_POWERCONTROL  0x2030
+#define USB_DEVICE_ID_LD_MACHINETEST   0x2040
 
 #define USB_VENDOR_ID_APPLE            0x05ac
 #define USB_DEVICE_ID_APPLE_POWERMOUSE 0x0304
@@ -1491,17 +1494,20 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_LD, USB_DEVICE_ID_CASSY, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_LD, USB_DEVICE_ID_POCKETCASSY, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_LD, USB_DEVICE_ID_MOBILECASSY, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_LD, USB_DEVICE_ID_JWM, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_LD, USB_DEVICE_ID_DMMP, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_LD, USB_DEVICE_ID_UMIP, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_LD, USB_DEVICE_ID_VIDEOCOM, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_LD, USB_DEVICE_ID_COM3LAB, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_LD, USB_DEVICE_ID_TELEPORT, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_LD, USB_DEVICE_ID_NETWORKANALYSER, HID_QUIRK_IGNORE },
-       { USB_VENDOR_ID_LD, USB_DEVICE_ID_POWERCONTROL, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MOBILECASSY, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_JWM, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_DMMP, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_UMIP, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_XRAY1, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_XRAY2, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_VIDEOCOM, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_COM3LAB, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_TELEPORT, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_NETWORKANALYSER, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POWERCONTROL, HID_QUIRK_IGNORE },
+       { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MACHINETEST, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS, HID_QUIRK_IGNORE },
        { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_IGNORE },
index 6649531fa824516d137aa8aa92a8099d1bb8915a..8ba6a701e9c144afcb42473fa166e08ca959c3b8 100644 (file)
@@ -141,7 +141,7 @@ source "drivers/usb/misc/sisusbvga/Kconfig"
 
 config USB_LD
        tristate "USB LD driver"
-       depends on USB && EXPERIMENTAL
+       depends on USB
        help
          This driver is for generic USB devices that use interrupt transfers,
          like LD Didactic's USB devices.
index 331d4ae949ed3ae175f39ecec2df72e2e72af125..e2d1198623eb08c2e792c1d46338cc58026de115 100644 (file)
@@ -24,6 +24,7 @@
  * V0.1  (mh) Initial version
  * V0.11 (mh) Added raw support for HID 1.0 devices (no interrupt out endpoint)
  * V0.12 (mh) Added kmalloc check for string buffer
+ * V0.13 (mh) Added support for LD X-Ray and Machine Test System
  */
 
 #include <linux/config.h>
 
 /* Define these values to match your devices */
 #define USB_VENDOR_ID_LD               0x0f11  /* USB Vendor ID of LD Didactic GmbH */
-#define USB_DEVICE_ID_CASSY            0x1000  /* USB Product ID for all CASSY-S modules */
-#define USB_DEVICE_ID_POCKETCASSY      0x1010  /* USB Product ID for Pocket-CASSY */
-#define USB_DEVICE_ID_MOBILECASSY      0x1020  /* USB Product ID for Mobile-CASSY */
-#define USB_DEVICE_ID_JWM              0x1080  /* USB Product ID for Joule and Wattmeter */
-#define USB_DEVICE_ID_DMMP             0x1081  /* USB Product ID for Digital Multimeter P (reserved) */
-#define USB_DEVICE_ID_UMIP             0x1090  /* USB Product ID for UMI P */
-#define USB_DEVICE_ID_VIDEOCOM         0x1200  /* USB Product ID for VideoCom */
-#define USB_DEVICE_ID_COM3LAB          0x2000  /* USB Product ID for COM3LAB */
-#define USB_DEVICE_ID_TELEPORT         0x2010  /* USB Product ID for Terminal Adapter */
-#define USB_DEVICE_ID_NETWORKANALYSER  0x2020  /* USB Product ID for Network Analyser */
-#define USB_DEVICE_ID_POWERCONTROL     0x2030  /* USB Product ID for Controlling device for Power Electronics */
+#define USB_DEVICE_ID_LD_CASSY         0x1000  /* USB Product ID of CASSY-S */
+#define USB_DEVICE_ID_LD_POCKETCASSY   0x1010  /* USB Product ID of Pocket-CASSY */
+#define USB_DEVICE_ID_LD_MOBILECASSY   0x1020  /* USB Product ID of Mobile-CASSY */
+#define USB_DEVICE_ID_LD_JWM           0x1080  /* USB Product ID of Joule and Wattmeter */
+#define USB_DEVICE_ID_LD_DMMP          0x1081  /* USB Product ID of Digital Multimeter P (reserved) */
+#define USB_DEVICE_ID_LD_UMIP          0x1090  /* USB Product ID of UMI P */
+#define USB_DEVICE_ID_LD_XRAY1         0x1100  /* USB Product ID of X-Ray Apparatus */
+#define USB_DEVICE_ID_LD_XRAY2         0x1101  /* USB Product ID of X-Ray Apparatus */
+#define USB_DEVICE_ID_LD_VIDEOCOM      0x1200  /* USB Product ID of VideoCom */
+#define USB_DEVICE_ID_LD_COM3LAB       0x2000  /* USB Product ID of COM3LAB */
+#define USB_DEVICE_ID_LD_TELEPORT      0x2010  /* USB Product ID of Terminal Adapter */
+#define USB_DEVICE_ID_LD_NETWORKANALYSER 0x2020        /* USB Product ID of Network Analyser */
+#define USB_DEVICE_ID_LD_POWERCONTROL  0x2030  /* USB Product ID of Converter Control Unit */
+#define USB_DEVICE_ID_LD_MACHINETEST   0x2040  /* USB Product ID of Machine Test System */
 
 #define USB_VENDOR_ID_VERNIER          0x08f7
 #define USB_DEVICE_ID_VERNIER_LABPRO   0x0001
 
 /* table of devices that work with this driver */
 static struct usb_device_id ld_usb_table [] = {
-       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_CASSY) },
-       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_POCKETCASSY) },
-       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_MOBILECASSY) },
-       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_JWM) },
-       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_DMMP) },
-       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_UMIP) },
-       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_VIDEOCOM) },
-       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_COM3LAB) },
-       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_TELEPORT) },
-       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_NETWORKANALYSER) },
-       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_POWERCONTROL) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MOBILECASSY) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_JWM) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_DMMP) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_UMIP) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_XRAY1) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_XRAY2) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_VIDEOCOM) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_COM3LAB) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_TELEPORT) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_NETWORKANALYSER) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POWERCONTROL) },
+       { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MACHINETEST) },
        { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO) },
        { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP) },
        { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) },
@@ -85,7 +92,7 @@ static struct usb_device_id ld_usb_table [] = {
        { }                                     /* Terminating entry */
 };
 MODULE_DEVICE_TABLE(usb, ld_usb_table);
-MODULE_VERSION("V0.12");
+MODULE_VERSION("V0.13");
 MODULE_AUTHOR("Michael Hund <mhund@ld-didactic.de>");
 MODULE_DESCRIPTION("LD USB Driver");
 MODULE_LICENSE("GPL");
@@ -632,8 +639,8 @@ static int ld_usb_probe(struct usb_interface *intf, const struct usb_device_id *
 
        /* workaround for early firmware versions on fast computers */
        if ((le16_to_cpu(udev->descriptor.idVendor) == USB_VENDOR_ID_LD) &&
-           ((le16_to_cpu(udev->descriptor.idProduct) == USB_DEVICE_ID_CASSY) ||
-            (le16_to_cpu(udev->descriptor.idProduct) == USB_DEVICE_ID_COM3LAB)) &&
+           ((le16_to_cpu(udev->descriptor.idProduct) == USB_DEVICE_ID_LD_CASSY) ||
+            (le16_to_cpu(udev->descriptor.idProduct) == USB_DEVICE_ID_LD_COM3LAB)) &&
            (le16_to_cpu(udev->descriptor.bcdDevice) <= 0x103)) {
                buffer = kmalloc(256, GFP_KERNEL);
                if (buffer == NULL) {
index e8e575e037c11352b1d1fc65c51192167ec3c74e..37c81c08faadcb19a15442ff2cfbd89126d09bbc 100644 (file)
@@ -73,9 +73,10 @@ static struct usb_device_id id_table [] = {
        { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X65) },
        { USB_DEVICE(SIEMENS_VENDOR_ID, SIEMENS_PRODUCT_ID_X75) },
        { USB_DEVICE(SYNTECH_VENDOR_ID, SYNTECH_PRODUCT_ID) },
-       { USB_DEVICE(NOKIA_CA42_VENDOR_ID, NOKIA_CA42_PRODUCT_ID ) },
-       { USB_DEVICE(CA_42_CA42_VENDOR_ID, CA_42_CA42_PRODUCT_ID ) },
+       { USB_DEVICE(NOKIA_CA42_VENDOR_ID, NOKIA_CA42_PRODUCT_ID) },
+       { USB_DEVICE(CA_42_CA42_VENDOR_ID, CA_42_CA42_PRODUCT_ID) },
        { USB_DEVICE(SAGEM_VENDOR_ID, SAGEM_PRODUCT_ID) },
+       { USB_DEVICE(LEADTEK_VENDOR_ID, LEADTEK_9531_PRODUCT_ID) },
        { }                                     /* Terminating entry */
 };
 
index 1807087a76e3dbe0f218b73c873b172100ab79d4..9bc4755162adf3db1462b40c380382aa159b89e5 100644 (file)
@@ -71,3 +71,7 @@
 
 #define SAGEM_VENDOR_ID                0x079b
 #define SAGEM_PRODUCT_ID       0x0027
+
+/* Leadtek GPS 9531 (ID 0413:2101) */
+#define LEADTEK_VENDOR_ID      0x0413
+#define LEADTEK_9531_PRODUCT_ID        0x2101
index ee958f986eb8a37c86422b837906f71d4fd1f508..e71c5ca1a07b6824c1a56dd4a54744dc80b9efa3 100644 (file)
@@ -106,6 +106,13 @@ UNUSUAL_DEV(  0x0411, 0x001c, 0x0113, 0x0113,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_FIX_INQUIRY ),
 
+/* Reported by Christian Leber <christian@leber.de> */
+UNUSUAL_DEV(  0x0419, 0xaaf5, 0x0100, 0x0100,
+               "TrekStor",
+               "i.Beat 115 2.0",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_IGNORE_RESIDUE | US_FL_NOT_LOCKABLE ),
+
 /* Reported by Stefan Werner <dustbln@gmx.de> */
 UNUSUAL_DEV(  0x0419, 0xaaf6, 0x0100, 0x0100,
                "TrekStor",
@@ -127,6 +134,14 @@ UNUSUAL_DEV(  0x0436, 0x0005, 0x0100, 0x0100,
                US_SC_SCSI, US_PR_DPCM_USB, NULL, 0 ),
 #endif
 
+/* Patch submitted by Daniel Drake <dsd@gentoo.org>
+ * Device reports nonsense bInterfaceProtocol 6 when connected over USB2 */
+UNUSUAL_DEV(  0x0451, 0x5416, 0x0100, 0x0100,
+               "Neuros Audio",
+               "USB 2.0 HD 2.5",
+               US_SC_DEVICE, US_PR_BULK, NULL,
+               US_FL_NEED_OVERRIDE ),
+
 /*
  * Pete Zaitcev <zaitcev@yahoo.com>, from Patrick C. F. Ernzer, bz#162559.
  * The key does not actually break, but it returns zero sense which
@@ -137,13 +152,16 @@ UNUSUAL_DEV(  0x0457, 0x0150, 0x0100, 0x0100,
                "USB Mass Storage Device",
                US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ),
 
-/* Patch submitted by Daniel Drake <dsd@gentoo.org>
- * Device reports nonsense bInterfaceProtocol 6 when connected over USB2 */
-UNUSUAL_DEV(  0x0451, 0x5416, 0x0100, 0x0100,
-               "Neuros Audio",
-               "USB 2.0 HD 2.5",
-               US_SC_DEVICE, US_PR_BULK, NULL,
-               US_FL_NEED_OVERRIDE ),
+/*
+* Bohdan Linda <bohdan.linda@gmail.com>
+* 1GB USB sticks MyFlash High Speed. I have restricted
+* the revision to my model only
+*/
+UNUSUAL_DEV(  0x0457, 0x0151, 0x0100, 0x0100,
+                "USB 2.0",
+                "Flash Disk",
+                US_SC_DEVICE, US_PR_DEVICE, NULL,
+                US_FL_NOT_LOCKABLE ),
 
 UNUSUAL_DEV(  0x045a, 0x5210, 0x0101, 0x0101,
                "Rio",
@@ -946,6 +964,12 @@ UNUSUAL_DEV(  0x084d, 0x0011, 0x0110, 0x0110,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_BULK32),
 
+/* Submitted by Jan De Luyck <lkml@kcore.org> */
+UNUSUAL_DEV(  0x08bd, 0x1100, 0x0000, 0x0000,
+               "CITIZEN",
+               "X1DE-USB",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_SINGLE_LUN),
 
 /* Entry needed for flags. Moreover, all devices with this ID use
  * bulk-only transport, but _some_ falsely report Control/Bulk instead.
@@ -1085,6 +1109,13 @@ UNUSUAL_DEV(  0x0dda, 0x0301, 0x0012, 0x0012,
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_IGNORE_RESIDUE ),
 
+/* Reported by Jim McCloskey <mcclosk@ucsc.edu> */
+UNUSUAL_DEV( 0x0e21, 0x0520, 0x0100, 0x0100,
+               "Cowon Systems",
+               "iAUDIO M5",
+               US_SC_DEVICE, US_PR_BULK, NULL,
+               0 ),
+
 /* Submitted by Antoine Mairesse <antoine.mairesse@free.fr> */
 UNUSUAL_DEV( 0x0ed1, 0x6660, 0x0100, 0x0300,
                "USB",
@@ -1162,6 +1193,13 @@ UNUSUAL_DEV(  0x55aa, 0xa103, 0x0000, 0x9999,
                US_FL_SINGLE_LUN),
 #endif
 
+/* Reported by Andrew Simmons <andrew.simmons@gmail.com> */
+UNUSUAL_DEV(  0xed06, 0x4500, 0x0001, 0x0001,
+               "DataStor",
+               "USB4500 FW1.04",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_FIX_CAPACITY),
+
 /* Control/Bulk transport for all SubClass values */
 USUAL_DEV(US_SC_RBC, US_PR_CB, USB_US_TYPE_STOR),
 USUAL_DEV(US_SC_8020, US_PR_CB, USB_US_TYPE_STOR),
index 3e153d313bb01457cc54401925f78aad88da734c..e64ed16bd42fdd446d0a5b0a438b2955a907eabe 100644 (file)
@@ -525,11 +525,6 @@ config FB_GBE_MEM
          This is the amount of memory reserved for the framebuffer,
          which can be any value between 1MB and 8MB.
 
-config BUS_I2C
-       bool
-       depends on (FB = y) && VISWS
-       default y
-
 config FB_SUN3
        bool "Sun3 framebuffer support"
        depends on (FB = y) && (SUN3 || SUN3X) && BROKEN
index d2dede6ed3e5c44bda0906208daf9dca1965f001..996c7b58564e33b4f555c9669ff14935b79ae457 100644 (file)
@@ -1550,6 +1550,7 @@ int fb_get_options(char *name, char **option)
        return retval;
 }
 
+#ifndef MODULE
 /**
  *     video_setup - process command line options
  *     @options: string of options
@@ -1593,6 +1594,7 @@ static int __init video_setup(char *options)
        return 0;
 }
 __setup("video=", video_setup);
+#endif
 
     /*
      *  Visible symbols for modules
index 747602aa56158976aa5b7ce67aed28d72e2aa1ee..a2e201dc40f774a57976d1b41201cfb9aa574031 100644 (file)
@@ -843,6 +843,9 @@ static int neofb_set_par(struct fb_info *info)
 
        par->SysIfaceCntl2 = 0xc0;      /* VESA Bios sets this to 0x80! */
 
+       /* Initialize: by default, we want display config register to be read */
+       par->PanelDispCntlRegRead = 1;
+
        /* Enable any user specified display devices. */
        par->PanelDispCntlReg1 = 0x00;
        if (par->internal_display)
@@ -1334,6 +1337,18 @@ static int neofb_blank(int blank_mode, struct fb_info *info)
        struct neofb_par *par = info->par;
        int seqflags, lcdflags, dpmsflags, reg;
 
+
+       /*
+        * Reload the value stored in the register, if sensible. It might have
+        * been changed via FN keystroke.
+        */
+       if (par->PanelDispCntlRegRead) {
+               neoUnlock();
+               par->PanelDispCntlReg1 = vga_rgfx(NULL, 0x20) & 0x03;
+               neoLock(&par->state);
+       }
+       par->PanelDispCntlRegRead = !blank_mode;
+
        switch (blank_mode) {
        case FB_BLANK_POWERDOWN:        /* powerdown - both sync lines down */
                seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */
@@ -1366,7 +1381,7 @@ static int neofb_blank(int blank_mode, struct fb_info *info)
        case FB_BLANK_NORMAL:           /* just blank screen (backlight stays on) */
                seqflags = VGA_SR01_SCREEN_OFF; /* Disable sequencer */
                lcdflags = par->PanelDispCntlReg1 & 0x02; /* LCD normal */
-               dpmsflags = 0;                  /* no hsync/vsync suppression */
+               dpmsflags = 0x00;       /* no hsync/vsync suppression */
                break;
        case FB_BLANK_UNBLANK:          /* unblank */
                seqflags = 0;                   /* Enable sequencer */
index dbcb8962e57dd790e9bf9e0dafc2363e805e7007..a7c4e5e8ead63781420bdb9d0a8c203d8f97a915 100644 (file)
@@ -138,6 +138,8 @@ static struct pci_device_id nvidiafb_pci_tbl[] = {
         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420_8X,
         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_4000,
+        PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_448_GO,
         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE4_488_GO,
index d17c97d07c80e44895503e6d336b8328c0ffd348..675bd25682979fc8a87bdb082da0bc3ec37d0ce9 100644 (file)
@@ -1442,13 +1442,15 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
                                         &bytes_read, &smb_read_data,
                                         &buf_type);
                        pSMBr = (struct smb_com_read_rsp *)smb_read_data;
-                       if (copy_to_user(current_offset, 
-                                        smb_read_data + 4 /* RFC1001 hdr */
-                                        + le16_to_cpu(pSMBr->DataOffset), 
-                                        bytes_read)) {
-                               rc = -EFAULT;
-                       }
                        if (smb_read_data) {
+                               if (copy_to_user(current_offset,
+                                               smb_read_data +
+                                               4 /* RFC1001 length field */ +
+                                               le16_to_cpu(pSMBr->DataOffset),
+                                               bytes_read)) {
+                                       rc = -EFAULT;
+                               }
+
                                if(buf_type == CIFS_SMALL_BUFFER)
                                        cifs_small_buf_release(smb_read_data);
                                else if(buf_type == CIFS_LARGE_BUFFER)
index 70c5af4cc2704d3097848783825835456a52f8ee..a2ba78bdf7f71384de2491779e8f83627e6ca4b0 100644 (file)
@@ -1751,11 +1751,15 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
        ret = compat_core_sys_select(n, inp, outp, exp, &timeout);
 
        if (tvp) {
+               struct compat_timeval rtv;
+
                if (current->personality & STICKY_TIMEOUTS)
                        goto sticky;
-               tv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
-               tv.tv_sec = timeout;
-               if (copy_to_user(tvp, &tv, sizeof(tv))) {
+               rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
+               rtv.tv_sec = timeout;
+               if (compat_timeval_compare(&rtv, &tv) < 0)
+                       rtv = tv;
+               if (copy_to_user(tvp, &rtv, sizeof(rtv))) {
 sticky:
                        /*
                         * If an application puts its timeval in read-only
@@ -1822,13 +1826,17 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp,
        } while (!ret && !timeout && tsp && (ts.tv_sec || ts.tv_nsec));
 
        if (tsp && !(current->personality & STICKY_TIMEOUTS)) {
-               ts.tv_sec += timeout / HZ;
-               ts.tv_nsec += (timeout % HZ) * (1000000000/HZ);
-               if (ts.tv_nsec >= 1000000000) {
-                       ts.tv_sec++;
-                       ts.tv_nsec -= 1000000000;
+               struct compat_timespec rts;
+
+               rts.tv_sec = timeout / HZ;
+               rts.tv_nsec = (timeout % HZ) * (NSEC_PER_SEC/HZ);
+               if (rts.tv_nsec >= NSEC_PER_SEC) {
+                       rts.tv_sec++;
+                       rts.tv_nsec -= NSEC_PER_SEC;
                }
-               (void)copy_to_user(tsp, &ts, sizeof(ts));
+               if (compat_timespec_compare(&rts, &ts) < 0)
+                       rts = ts;
+               copy_to_user(tsp, &rts, sizeof(rts));
        }
 
        if (ret == -ERESTARTNOHAND) {
@@ -1918,12 +1926,17 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
                sigprocmask(SIG_SETMASK, &sigsaved, NULL);
 
        if (tsp && timeout >= 0) {
+               struct compat_timespec rts;
+
                if (current->personality & STICKY_TIMEOUTS)
                        goto sticky;
                /* Yes, we know it's actually an s64, but it's also positive. */
-               ts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) * 1000;
-               ts.tv_sec = timeout;
-               if (copy_to_user(tsp, &ts, sizeof(ts))) {
+               rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
+                                       1000;
+               rts.tv_sec = timeout;
+               if (compat_timespec_compare(&rts, &ts) < 0)
+                       rts = ts;
+               if (copy_to_user(tsp, &rts, sizeof(rts))) {
 sticky:
                        /*
                         * If an application puts its timeval in read-only
index 055378d2513e87359b899cafc2b981e1bd392407..0e1c95074d4201b33bda839d1fe41566bb69e5ec 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1403,7 +1403,7 @@ static void zap_threads (struct mm_struct *mm)
                do_each_thread(g,p) {
                        if (mm == p->mm && p != tsk &&
                            p->ptrace && p->parent->mm == mm) {
-                               __ptrace_unlink(p);
+                               __ptrace_detach(p, 0);
                        }
                } while_each_thread(g,p);
                write_unlock_irq(&tasklist_lock);
index e6265a0b56b8de25e8bceccd9e6be1eff10159f7..543ed543d1e5d6fa41e77279074f2bd51b8b68af 100644 (file)
 #include <linux/slab.h>
 
 /*
- * Unlink a buffer from a transaction checkpoint list.
+ * Unlink a buffer from a transaction.
  *
  * Called with j_list_lock held.
  */
 
-static void __buffer_unlink_first(struct journal_head *jh)
+static inline void __buffer_unlink(struct journal_head *jh)
 {
        transaction_t *transaction;
 
        transaction = jh->b_cp_transaction;
+       jh->b_cp_transaction = NULL;
 
        jh->b_cpnext->b_cpprev = jh->b_cpprev;
        jh->b_cpprev->b_cpnext = jh->b_cpnext;
-       if (transaction->t_checkpoint_list == jh) {
+       if (transaction->t_checkpoint_list == jh)
                transaction->t_checkpoint_list = jh->b_cpnext;
-               if (transaction->t_checkpoint_list == jh)
-                       transaction->t_checkpoint_list = NULL;
-       }
-}
-
-/*
- * Unlink a buffer from a transaction checkpoint(io) list.
- *
- * Called with j_list_lock held.
- */
-
-static inline void __buffer_unlink(struct journal_head *jh)
-{
-       transaction_t *transaction;
-
-       transaction = jh->b_cp_transaction;
-
-       __buffer_unlink_first(jh);
-       if (transaction->t_checkpoint_io_list == jh) {
-               transaction->t_checkpoint_io_list = jh->b_cpnext;
-               if (transaction->t_checkpoint_io_list == jh)
-                       transaction->t_checkpoint_io_list = NULL;
-       }
-}
-
-/*
- * Move a buffer from the checkpoint list to the checkpoint io list
- *
- * Called with j_list_lock held
- */
-
-static inline void __buffer_relink_io(struct journal_head *jh)
-{
-       transaction_t *transaction;
-
-       transaction = jh->b_cp_transaction;
-       __buffer_unlink_first(jh);
-
-       if (!transaction->t_checkpoint_io_list) {
-               jh->b_cpnext = jh->b_cpprev = jh;
-       } else {
-               jh->b_cpnext = transaction->t_checkpoint_io_list;
-               jh->b_cpprev = transaction->t_checkpoint_io_list->b_cpprev;
-               jh->b_cpprev->b_cpnext = jh;
-               jh->b_cpnext->b_cpprev = jh;
-       }
-       transaction->t_checkpoint_io_list = jh;
+       if (transaction->t_checkpoint_list == jh)
+               transaction->t_checkpoint_list = NULL;
 }
 
 /*
  * Try to release a checkpointed buffer from its transaction.
- * Returns 1 if we released it and 2 if we also released the
- * whole transaction.
- *
+ * Returns 1 if we released it.
  * Requires j_list_lock
  * Called under jbd_lock_bh_state(jh2bh(jh)), and drops it
  */
@@ -103,11 +57,12 @@ static int __try_to_free_cp_buf(struct journal_head *jh)
 
        if (jh->b_jlist == BJ_None && !buffer_locked(bh) && !buffer_dirty(bh)) {
                JBUFFER_TRACE(jh, "remove from checkpoint list");
-               ret = __journal_remove_checkpoint(jh) + 1;
+               __journal_remove_checkpoint(jh);
                jbd_unlock_bh_state(bh);
                journal_remove_journal_head(bh);
                BUFFER_TRACE(bh, "release");
                __brelse(bh);
+               ret = 1;
        } else {
                jbd_unlock_bh_state(bh);
        }
@@ -162,53 +117,83 @@ static void jbd_sync_bh(journal_t *journal, struct buffer_head *bh)
 }
 
 /*
- * Clean up transaction's list of buffers submitted for io.
- * We wait for any pending IO to complete and remove any clean
- * buffers. Note that we take the buffers in the opposite ordering
- * from the one in which they were submitted for IO.
+ * Clean up a transaction's checkpoint list.
+ *
+ * We wait for any pending IO to complete and make sure any clean
+ * buffers are removed from the transaction.
+ *
+ * Return 1 if we performed any actions which might have destroyed the
+ * checkpoint.  (journal_remove_checkpoint() deletes the transaction when
+ * the last checkpoint buffer is cleansed)
  *
  * Called with j_list_lock held.
  */
-
-static void __wait_cp_io(journal_t *journal, transaction_t *transaction)
+static int __cleanup_transaction(journal_t *journal, transaction_t *transaction)
 {
-       struct journal_head *jh;
+       struct journal_head *jh, *next_jh, *last_jh;
        struct buffer_head *bh;
-       tid_t this_tid;
-       int released = 0;
-
-       this_tid = transaction->t_tid;
-restart:
-       /* Didn't somebody clean up the transaction in the meanwhile */
-       if (journal->j_checkpoint_transactions != transaction ||
-               transaction->t_tid != this_tid)
-               return;
-       while (!released && transaction->t_checkpoint_io_list) {
-               jh = transaction->t_checkpoint_io_list;
+       int ret = 0;
+
+       assert_spin_locked(&journal->j_list_lock);
+       jh = transaction->t_checkpoint_list;
+       if (!jh)
+               return 0;
+
+       last_jh = jh->b_cpprev;
+       next_jh = jh;
+       do {
+               jh = next_jh;
                bh = jh2bh(jh);
-               if (!jbd_trylock_bh_state(bh)) {
-                       jbd_sync_bh(journal, bh);
-                       spin_lock(&journal->j_list_lock);
-                       goto restart;
-               }
                if (buffer_locked(bh)) {
                        atomic_inc(&bh->b_count);
                        spin_unlock(&journal->j_list_lock);
-                       jbd_unlock_bh_state(bh);
                        wait_on_buffer(bh);
                        /* the journal_head may have gone by now */
                        BUFFER_TRACE(bh, "brelse");
                        __brelse(bh);
-                       spin_lock(&journal->j_list_lock);
-                       goto restart;
+                       goto out_return_1;
                }
+
                /*
-                * Now in whatever state the buffer currently is, we know that
-                * it has been written out and so we can drop it from the list
+                * This is foul
                 */
-               released = __journal_remove_checkpoint(jh);
-               jbd_unlock_bh_state(bh);
-       }
+               if (!jbd_trylock_bh_state(bh)) {
+                       jbd_sync_bh(journal, bh);
+                       goto out_return_1;
+               }
+
+               if (jh->b_transaction != NULL) {
+                       transaction_t *t = jh->b_transaction;
+                       tid_t tid = t->t_tid;
+
+                       spin_unlock(&journal->j_list_lock);
+                       jbd_unlock_bh_state(bh);
+                       log_start_commit(journal, tid);
+                       log_wait_commit(journal, tid);
+                       goto out_return_1;
+               }
+
+               /*
+                * AKPM: I think the buffer_jbddirty test is redundant - it
+                * shouldn't have NULL b_transaction?
+                */
+               next_jh = jh->b_cpnext;
+               if (!buffer_dirty(bh) && !buffer_jbddirty(bh)) {
+                       BUFFER_TRACE(bh, "remove from checkpoint");
+                       __journal_remove_checkpoint(jh);
+                       jbd_unlock_bh_state(bh);
+                       journal_remove_journal_head(bh);
+                       __brelse(bh);
+                       ret = 1;
+               } else {
+                       jbd_unlock_bh_state(bh);
+               }
+       } while (jh != last_jh);
+
+       return ret;
+out_return_1:
+       spin_lock(&journal->j_list_lock);
+       return 1;
 }
 
 #define NR_BATCH       64
@@ -218,7 +203,9 @@ __flush_batch(journal_t *journal, struct buffer_head **bhs, int *batch_count)
 {
        int i;
 
+       spin_unlock(&journal->j_list_lock);
        ll_rw_block(SWRITE, *batch_count, bhs);
+       spin_lock(&journal->j_list_lock);
        for (i = 0; i < *batch_count; i++) {
                struct buffer_head *bh = bhs[i];
                clear_buffer_jwrite(bh);
@@ -234,46 +221,19 @@ __flush_batch(journal_t *journal, struct buffer_head **bhs, int *batch_count)
  * Return 1 if something happened which requires us to abort the current
  * scan of the checkpoint list.  
  *
- * Called with j_list_lock held and drops it if 1 is returned
+ * Called with j_list_lock held.
  * Called under jbd_lock_bh_state(jh2bh(jh)), and drops it
  */
-static int __process_buffer(journal_t *journal, struct journal_head *jh,
-                       struct buffer_head **bhs, int *batch_count)
+static int __flush_buffer(journal_t *journal, struct journal_head *jh,
+                       struct buffer_head **bhs, int *batch_count,
+                       int *drop_count)
 {
        struct buffer_head *bh = jh2bh(jh);
        int ret = 0;
 
-       if (buffer_locked(bh)) {
-               get_bh(bh);
-               spin_unlock(&journal->j_list_lock);
-               jbd_unlock_bh_state(bh);
-               wait_on_buffer(bh);
-               /* the journal_head may have gone by now */
-               BUFFER_TRACE(bh, "brelse");
-               put_bh(bh);
-               ret = 1;
-       }
-       else if (jh->b_transaction != NULL) {
-               transaction_t *t = jh->b_transaction;
-               tid_t tid = t->t_tid;
+       if (buffer_dirty(bh) && !buffer_locked(bh) && jh->b_jlist == BJ_None) {
+               J_ASSERT_JH(jh, jh->b_transaction == NULL);
 
-               spin_unlock(&journal->j_list_lock);
-               jbd_unlock_bh_state(bh);
-               log_start_commit(journal, tid);
-               log_wait_commit(journal, tid);
-               ret = 1;
-       }
-       else if (!buffer_dirty(bh)) {
-               J_ASSERT_JH(jh, !buffer_jbddirty(bh));
-               BUFFER_TRACE(bh, "remove from checkpoint");
-               __journal_remove_checkpoint(jh);
-               spin_unlock(&journal->j_list_lock);
-               jbd_unlock_bh_state(bh);
-               journal_remove_journal_head(bh);
-               put_bh(bh);
-               ret = 1;
-       }
-       else {
                /*
                 * Important: we are about to write the buffer, and
                 * possibly block, while still holding the journal lock.
@@ -286,30 +246,45 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh,
                J_ASSERT_BH(bh, !buffer_jwrite(bh));
                set_buffer_jwrite(bh);
                bhs[*batch_count] = bh;
-               __buffer_relink_io(jh);
                jbd_unlock_bh_state(bh);
                (*batch_count)++;
                if (*batch_count == NR_BATCH) {
-                       spin_unlock(&journal->j_list_lock);
                        __flush_batch(journal, bhs, batch_count);
                        ret = 1;
                }
+       } else {
+               int last_buffer = 0;
+               if (jh->b_cpnext == jh) {
+                       /* We may be about to drop the transaction.  Tell the
+                        * caller that the lists have changed.
+                        */
+                       last_buffer = 1;
+               }
+               if (__try_to_free_cp_buf(jh)) {
+                       (*drop_count)++;
+                       ret = last_buffer;
+               }
        }
        return ret;
 }
 
 /*
- * Perform an actual checkpoint. We take the first transaction on the
- * list of transactions to be checkpointed and send all its buffers
- * to disk. We submit larger chunks of data at once.
+ * Perform an actual checkpoint.  We don't write out only enough to
+ * satisfy the current blocked requests: rather we submit a reasonably
+ * sized chunk of the outstanding data to disk at once for
+ * efficiency.  __log_wait_for_space() will retry if we didn't free enough.
  * 
+ * However, we _do_ take into account the amount requested so that once
+ * the IO has been queued, we can return as soon as enough of it has
+ * completed to disk.
+ *
  * The journal should be locked before calling this function.
  */
 int log_do_checkpoint(journal_t *journal)
 {
-       transaction_t *transaction;
-       tid_t this_tid;
        int result;
+       int batch_count = 0;
+       struct buffer_head *bhs[NR_BATCH];
 
        jbd_debug(1, "Start checkpoint\n");
 
@@ -324,70 +299,79 @@ int log_do_checkpoint(journal_t *journal)
                return result;
 
        /*
-        * OK, we need to start writing disk blocks.  Take one transaction
-        * and write it.
+        * OK, we need to start writing disk blocks.  Try to free up a
+        * quarter of the log in a single checkpoint if we can.
         */
-       spin_lock(&journal->j_list_lock);
-       if (!journal->j_checkpoint_transactions)
-               goto out;
-       transaction = journal->j_checkpoint_transactions;
-       this_tid = transaction->t_tid;
-restart:
        /*
-        * If someone cleaned up this transaction while we slept, we're
-        * done (maybe it's a new transaction, but it fell at the same
-        * address).
+        * AKPM: check this code.  I had a feeling a while back that it
+        * degenerates into a busy loop at unmount time.
         */
-       if (journal->j_checkpoint_transactions == transaction &&
-                       transaction->t_tid == this_tid) {
-               int batch_count = 0;
-               struct buffer_head *bhs[NR_BATCH];
-               struct journal_head *jh;
-               int retry = 0;
-
-               while (!retry && transaction->t_checkpoint_list) {
+       spin_lock(&journal->j_list_lock);
+       while (journal->j_checkpoint_transactions) {
+               transaction_t *transaction;
+               struct journal_head *jh, *last_jh, *next_jh;
+               int drop_count = 0;
+               int cleanup_ret, retry = 0;
+               tid_t this_tid;
+
+               transaction = journal->j_checkpoint_transactions;
+               this_tid = transaction->t_tid;
+               jh = transaction->t_checkpoint_list;
+               last_jh = jh->b_cpprev;
+               next_jh = jh;
+               do {
                        struct buffer_head *bh;
 
-                       jh = transaction->t_checkpoint_list;
+                       jh = next_jh;
+                       next_jh = jh->b_cpnext;
                        bh = jh2bh(jh);
                        if (!jbd_trylock_bh_state(bh)) {
                                jbd_sync_bh(journal, bh);
+                               spin_lock(&journal->j_list_lock);
                                retry = 1;
                                break;
                        }
-                       retry = __process_buffer(journal, jh, bhs,
-                                               &batch_count);
-                       if (!retry &&
-                           lock_need_resched(&journal->j_list_lock)) {
-                               spin_unlock(&journal->j_list_lock);
+                       retry = __flush_buffer(journal, jh, bhs, &batch_count, &drop_count);
+                       if (cond_resched_lock(&journal->j_list_lock)) {
                                retry = 1;
                                break;
                        }
-               }
+               } while (jh != last_jh && !retry);
 
                if (batch_count) {
-                       if (!retry) {
-                               spin_unlock(&journal->j_list_lock);
-                               retry = 1;
-                       }
                        __flush_batch(journal, bhs, &batch_count);
+                       retry = 1;
                }
 
-               if (retry) {
-                       spin_lock(&journal->j_list_lock);
-                       goto restart;
-               }
                /*
-                * Now we have cleaned up the first transaction's checkpoint
-                * list.  Let's clean up the second one.
+                * If someone cleaned up this transaction while we slept, we're
+                * done
+                */
+               if (journal->j_checkpoint_transactions != transaction)
+                       break;
+               if (retry)
+                       continue;
+               /*
+                * Maybe it's a new transaction, but it fell at the same
+                * address
                 */
-               __wait_cp_io(journal, transaction);
+               if (transaction->t_tid != this_tid)
+                       continue;
+               /*
+                * We have walked the whole transaction list without
+                * finding anything to write to disk.  We had better be
+                * able to make some progress or we are in trouble.
+                */
+               cleanup_ret = __cleanup_transaction(journal, transaction);
+               J_ASSERT(drop_count != 0 || cleanup_ret != 0);
+               if (journal->j_checkpoint_transactions != transaction)
+                       break;
        }
-out:
        spin_unlock(&journal->j_list_lock);
        result = cleanup_journal_tail(journal);
        if (result < 0)
                return result;
+
        return 0;
 }
 
@@ -471,53 +455,6 @@ int cleanup_journal_tail(journal_t *journal)
 
 /* Checkpoint list management */
 
-/*
- * journal_clean_one_cp_list
- *
- * Find all the written-back checkpoint buffers in the given list and release them.
- *
- * Called with the journal locked.
- * Called with j_list_lock held.
- * Returns number of bufers reaped (for debug)
- */
-
-static int journal_clean_one_cp_list(struct journal_head *jh, int *released)
-{
-       struct journal_head *last_jh;
-       struct journal_head *next_jh = jh;
-       int ret, freed = 0;
-
-       *released = 0;
-       if (!jh)
-               return 0;
-
-       last_jh = jh->b_cpprev;
-       do {
-               jh = next_jh;
-               next_jh = jh->b_cpnext;
-               /* Use trylock because of the ranking */
-               if (jbd_trylock_bh_state(jh2bh(jh))) {
-                       ret = __try_to_free_cp_buf(jh);
-                       if (ret) {
-                               freed++;
-                               if (ret == 2) {
-                                       *released = 1;
-                                       return freed;
-                               }
-                       }
-               }
-               /*
-                * This function only frees up some memory if possible so we
-                * dont have an obligation to finish processing. Bail out if
-                * preemption requested:
-                */
-               if (need_resched())
-                       return freed;
-       } while (jh != last_jh);
-
-       return freed;
-}
-
 /*
  * journal_clean_checkpoint_list
  *
@@ -525,38 +462,46 @@ static int journal_clean_one_cp_list(struct journal_head *jh, int *released)
  *
  * Called with the journal locked.
  * Called with j_list_lock held.
- * Returns number of buffers reaped (for debug)
+ * Returns number of bufers reaped (for debug)
  */
 
 int __journal_clean_checkpoint_list(journal_t *journal)
 {
        transaction_t *transaction, *last_transaction, *next_transaction;
-       int ret = 0, released;
+       int ret = 0;
 
        transaction = journal->j_checkpoint_transactions;
-       if (!transaction)
+       if (transaction == 0)
                goto out;
 
        last_transaction = transaction->t_cpprev;
        next_transaction = transaction;
        do {
+               struct journal_head *jh;
+
                transaction = next_transaction;
                next_transaction = transaction->t_cpnext;
-               ret += journal_clean_one_cp_list(transaction->
-                               t_checkpoint_list, &released);
-               if (need_resched())
-                       goto out;
-               if (released)
-                       continue;
-               /*
-                * It is essential that we are as careful as in the case of
-                * t_checkpoint_list with removing the buffer from the list as
-                * we can possibly see not yet submitted buffers on io_list
-                */
-               ret += journal_clean_one_cp_list(transaction->
-                               t_checkpoint_io_list, &released);
-               if (need_resched())
-                       goto out;
+               jh = transaction->t_checkpoint_list;
+               if (jh) {
+                       struct journal_head *last_jh = jh->b_cpprev;
+                       struct journal_head *next_jh = jh;
+
+                       do {
+                               jh = next_jh;
+                               next_jh = jh->b_cpnext;
+                               /* Use trylock because of the ranknig */
+                               if (jbd_trylock_bh_state(jh2bh(jh)))
+                                       ret += __try_to_free_cp_buf(jh);
+                               /*
+                                * This function only frees up some memory
+                                * if possible so we dont have an obligation
+                                * to finish processing. Bail out if preemption
+                                * requested:
+                                */
+                               if (need_resched())
+                                       goto out;
+                       } while (jh != last_jh);
+               }
        } while (transaction != last_transaction);
 out:
        return ret;
@@ -571,22 +516,18 @@ out:
  * buffer updates committed in that transaction have safely been stored
  * elsewhere on disk.  To achieve this, all of the buffers in a
  * transaction need to be maintained on the transaction's checkpoint
- * lists until they have been rewritten, at which point this function is
+ * list until they have been rewritten, at which point this function is
  * called to remove the buffer from the existing transaction's
- * checkpoint lists.
- *
- * The function returns 1 if it frees the transaction, 0 otherwise.
+ * checkpoint list.
  *
  * This function is called with the journal locked.
  * This function is called with j_list_lock held.
- * This function is called with jbd_lock_bh_state(jh2bh(jh))
  */
 
-int __journal_remove_checkpoint(struct journal_head *jh)
+void __journal_remove_checkpoint(struct journal_head *jh)
 {
        transaction_t *transaction;
        journal_t *journal;
-       int ret = 0;
 
        JBUFFER_TRACE(jh, "entry");
 
@@ -597,10 +538,8 @@ int __journal_remove_checkpoint(struct journal_head *jh)
        journal = transaction->t_journal;
 
        __buffer_unlink(jh);
-       jh->b_cp_transaction = NULL;
 
-       if (transaction->t_checkpoint_list != NULL ||
-           transaction->t_checkpoint_io_list != NULL)
+       if (transaction->t_checkpoint_list != NULL)
                goto out;
        JBUFFER_TRACE(jh, "transaction has no more buffers");
 
@@ -626,10 +565,8 @@ int __journal_remove_checkpoint(struct journal_head *jh)
        /* Just in case anybody was waiting for more transactions to be
            checkpointed... */
        wake_up(&journal->j_wait_logspace);
-       ret = 1;
 out:
        JBUFFER_TRACE(jh, "exit");
-       return ret;
 }
 
 /*
@@ -691,7 +628,6 @@ void __journal_drop_transaction(journal_t *journal, transaction_t *transaction)
        J_ASSERT(transaction->t_shadow_list == NULL);
        J_ASSERT(transaction->t_log_list == NULL);
        J_ASSERT(transaction->t_checkpoint_list == NULL);
-       J_ASSERT(transaction->t_checkpoint_io_list == NULL);
        J_ASSERT(transaction->t_updates == 0);
        J_ASSERT(journal->j_committing_transaction != transaction);
        J_ASSERT(journal->j_running_transaction != transaction);
index 29e62d98bae64b5f326fb94beb88e87a8c8f183a..002ad2bbc76992b6acda52def147799886147693 100644 (file)
@@ -829,8 +829,7 @@ restart_loop:
        journal->j_committing_transaction = NULL;
        spin_unlock(&journal->j_state_lock);
 
-       if (commit_transaction->t_checkpoint_list == NULL &&
-           commit_transaction->t_checkpoint_io_list == NULL) {
+       if (commit_transaction->t_checkpoint_list == NULL) {
                __journal_drop_transaction(journal, commit_transaction);
        } else {
                if (journal->j_checkpoint_transactions == NULL) {
index 3eaf6e70108781fec63c61a32141b435532faae3..da6354baa0b804b36d2778282b31bc5ae8e2d858 100644 (file)
@@ -111,9 +111,10 @@ long nlmclnt_block(struct nlm_rqst *req, long timeout)
 /*
  * The server lockd has called us back to tell us the lock was granted
  */
-u32
-nlmclnt_grant(struct nlm_lock *lock)
+u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *lock)
 {
+       const struct file_lock *fl = &lock->fl;
+       const struct nfs_fh *fh = &lock->fh;
        struct nlm_wait *block;
        u32 res = nlm_lck_denied;
 
@@ -122,14 +123,20 @@ nlmclnt_grant(struct nlm_lock *lock)
         * Warning: must not use cookie to match it!
         */
        list_for_each_entry(block, &nlm_blocked, b_list) {
-               if (nlm_compare_locks(block->b_lock, &lock->fl)) {
-                       /* Alright, we found a lock. Set the return status
-                        * and wake up the caller
-                        */
-                       block->b_status = NLM_LCK_GRANTED;
-                       wake_up(&block->b_wait);
-                       res = nlm_granted;
-               }
+               struct file_lock *fl_blocked = block->b_lock;
+
+               if (!nlm_compare_locks(fl_blocked, fl))
+                       continue;
+               if (!nlm_cmp_addr(&block->b_host->h_addr, addr))
+                       continue;
+               if (nfs_compare_fh(NFS_FH(fl_blocked->fl_file->f_dentry->d_inode) ,fh) != 0)
+                       continue;
+               /* Alright, we found a lock. Set the return status
+                * and wake up the caller
+                */
+               block->b_status = NLM_LCK_GRANTED;
+               wake_up(&block->b_wait);
+               res = nlm_granted;
        }
        return res;
 }
index 4063095d849e0280ceecbeb4d510a600810b7797..b10f913aa06ae44f7d797920ed9e981b610caa5d 100644 (file)
@@ -228,7 +228,7 @@ nlm4svc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
        resp->cookie = argp->cookie;
 
        dprintk("lockd: GRANTED       called\n");
-       resp->status = nlmclnt_grant(&argp->lock);
+       resp->status = nlmclnt_grant(&rqstp->rq_addr, &argp->lock);
        dprintk("lockd: GRANTED       status %d\n", ntohl(resp->status));
        return rpc_success;
 }
index 3bc437e0cf5b6f0d6618c806fc9f835b084dbc52..35681d9cf1fcf52ca816249221a5b4c48b293c4e 100644 (file)
@@ -256,7 +256,7 @@ nlmsvc_proc_granted(struct svc_rqst *rqstp, struct nlm_args *argp,
        resp->cookie = argp->cookie;
 
        dprintk("lockd: GRANTED       called\n");
-       resp->status = nlmclnt_grant(&argp->lock);
+       resp->status = nlmclnt_grant(&rqstp->rq_addr, &argp->lock);
        dprintk("lockd: GRANTED       status %d\n", ntohl(resp->status));
        return rpc_success;
 }
index 42eb53b5293be362df0b5d3a608c5f360a004122..23ceaa7127b4c117fbd3fa738a42665f4c612ab6 100644 (file)
@@ -208,6 +208,9 @@ static inline void __dlm_set_joining_node(struct dlm_ctxt *dlm,
 #define DLM_LOCK_RES_IN_PROGRESS          0x00000010
 #define DLM_LOCK_RES_MIGRATING            0x00000020
 
+/* max milliseconds to wait to sync up a network failure with a node death */
+#define DLM_NODE_DEATH_WAIT_MAX (5 * 1000)
+
 #define DLM_PURGE_INTERVAL_MS   (8 * 1000)
 
 struct dlm_lock_resource
@@ -658,6 +661,7 @@ int dlm_launch_recovery_thread(struct dlm_ctxt *dlm);
 void dlm_complete_recovery_thread(struct dlm_ctxt *dlm);
 void dlm_wait_for_recovery(struct dlm_ctxt *dlm);
 int dlm_is_node_dead(struct dlm_ctxt *dlm, u8 node);
+int dlm_wait_for_node_death(struct dlm_ctxt *dlm, u8 node, int timeout);
 
 void dlm_put(struct dlm_ctxt *dlm);
 struct dlm_ctxt *dlm_grab(struct dlm_ctxt *dlm);
index 6001b22a997d819a617c2703f5439d3722555348..f66e2d818ccdefa2c4eb20625fc77d417e464e37 100644 (file)
@@ -392,6 +392,11 @@ static enum dlm_status dlm_send_remote_convert_request(struct dlm_ctxt *dlm,
        } else {
                mlog_errno(tmpret);
                if (dlm_is_host_down(tmpret)) {
+                       /* instead of logging the same network error over
+                        * and over, sleep here and wait for the heartbeat
+                        * to notice the node is dead.  times out after 5s. */
+                       dlm_wait_for_node_death(dlm, res->owner, 
+                                               DLM_NODE_DEATH_WAIT_MAX);
                        ret = DLM_RECOVERING;
                        mlog(0, "node %u died so returning DLM_RECOVERING "
                             "from convert message!\n", res->owner);
@@ -421,7 +426,7 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data)
        struct dlm_lockstatus *lksb;
        enum dlm_status status = DLM_NORMAL;
        u32 flags;
-       int call_ast = 0, kick_thread = 0;
+       int call_ast = 0, kick_thread = 0, ast_reserved = 0;
 
        if (!dlm_grab(dlm)) {
                dlm_error(DLM_REJECTED);
@@ -490,6 +495,7 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data)
        status = __dlm_lockres_state_to_status(res);
        if (status == DLM_NORMAL) {
                __dlm_lockres_reserve_ast(res);
+               ast_reserved = 1;
                res->state |= DLM_LOCK_RES_IN_PROGRESS;
                status = __dlmconvert_master(dlm, res, lock, flags,
                                             cnv->requested_type,
@@ -512,10 +518,10 @@ leave:
        else
                dlm_lock_put(lock);
 
-       /* either queue the ast or release it */
+       /* either queue the ast or release it, if reserved */
        if (call_ast)
                dlm_queue_ast(dlm, lock);
-       else
+       else if (ast_reserved)
                dlm_lockres_release_ast(dlm, res);
 
        if (kick_thread)
index d1a0038557a32fa2cc5ab8d698c50fb390d5fc7f..671d4ff222cc083c15aa63ed33048c899da2d26b 100644 (file)
@@ -220,6 +220,17 @@ static enum dlm_status dlmlock_remote(struct dlm_ctxt *dlm,
                        dlm_error(status);
                dlm_revert_pending_lock(res, lock);
                dlm_lock_put(lock);
+       } else if (dlm_is_recovery_lock(res->lockname.name, 
+                                       res->lockname.len)) {
+               /* special case for the $RECOVERY lock.
+                * there will never be an AST delivered to put
+                * this lock on the proper secondary queue
+                * (granted), so do it manually. */
+               mlog(0, "%s: $RECOVERY lock for this node (%u) is "
+                    "mastered by %u; got lock, manually granting (no ast)\n",
+                    dlm->name, dlm->node_num, res->owner);
+               list_del_init(&lock->list);
+               list_add_tail(&lock->list, &res->granted);
        }
        spin_unlock(&res->spinlock);
 
@@ -646,7 +657,19 @@ retry_lock:
                        mlog(0, "retrying lock with migration/"
                             "recovery/in progress\n");
                        msleep(100);
-                       dlm_wait_for_recovery(dlm);
+                       /* no waiting for dlm_reco_thread */
+                       if (recovery) {
+                               if (status == DLM_RECOVERING) {
+                                       mlog(0, "%s: got RECOVERING "
+                                            "for $REOCVERY lock, master "
+                                            "was %u\n", dlm->name, 
+                                            res->owner);
+                                       dlm_wait_for_node_death(dlm, res->owner, 
+                                                       DLM_NODE_DEATH_WAIT_MAX);
+                               }
+                       } else {
+                               dlm_wait_for_recovery(dlm);
+                       }
                        goto retry_lock;
                }
 
index a3194fe173d97b498b5753777e85306569ed094b..2e2e95e6949924f99c81ff9d368c5852437e5ece 100644 (file)
@@ -2482,7 +2482,9 @@ top:
                                atomic_set(&mle->woken, 1);
                                spin_unlock(&mle->spinlock);
                                wake_up(&mle->wq);
-                               /* final put will take care of list removal */
+                               /* do not need events any longer, so detach 
+                                * from heartbeat */
+                               __dlm_mle_detach_hb_events(dlm, mle);
                                __dlm_put_mle(mle);
                        }
                        continue;
@@ -2537,6 +2539,9 @@ top:
                        spin_unlock(&res->spinlock);
                        dlm_lockres_put(res);
 
+                       /* about to get rid of mle, detach from heartbeat */
+                       __dlm_mle_detach_hb_events(dlm, mle);
+
                        /* dump the mle */
                        spin_lock(&dlm->master_lock);
                        __dlm_put_mle(mle);
index 186e9a76aa5807565ad09e31e0bd0fa7584dcab5..ed76bda1a5344c4abb53072c08667617f7e05461 100644 (file)
@@ -278,6 +278,24 @@ int dlm_is_node_dead(struct dlm_ctxt *dlm, u8 node)
        return dead;
 }
 
+int dlm_wait_for_node_death(struct dlm_ctxt *dlm, u8 node, int timeout)
+{
+       if (timeout) {
+               mlog(ML_NOTICE, "%s: waiting %dms for notification of "
+                    "death of node %u\n", dlm->name, timeout, node);
+               wait_event_timeout(dlm->dlm_reco_thread_wq,
+                          dlm_is_node_dead(dlm, node),
+                          msecs_to_jiffies(timeout));
+       } else {
+               mlog(ML_NOTICE, "%s: waiting indefinitely for notification "
+                    "of death of node %u\n", dlm->name, node);
+               wait_event(dlm->dlm_reco_thread_wq,
+                          dlm_is_node_dead(dlm, node));
+       }
+       /* for now, return 0 */
+       return 0;
+}
+
 /* callers of the top-level api calls (dlmlock/dlmunlock) should
  * block on the dlm->reco.event when recovery is in progress.
  * the dlm recovery thread will set this state when it begins
@@ -2032,6 +2050,30 @@ again:
                             dlm->reco.new_master);
                        status = -EEXIST;
                } else {
+                       status = 0;
+
+                       /* see if recovery was already finished elsewhere */
+                       spin_lock(&dlm->spinlock);
+                       if (dlm->reco.dead_node == O2NM_INVALID_NODE_NUM) {
+                               status = -EINVAL;       
+                               mlog(0, "%s: got reco EX lock, but "
+                                    "node got recovered already\n", dlm->name);
+                               if (dlm->reco.new_master != O2NM_INVALID_NODE_NUM) {
+                                       mlog(ML_ERROR, "%s: new master is %u "
+                                            "but no dead node!\n", 
+                                            dlm->name, dlm->reco.new_master);
+                                       BUG();
+                               }
+                       }
+                       spin_unlock(&dlm->spinlock);
+               }
+
+               /* if this node has actually become the recovery master,
+                * set the master and send the messages to begin recovery */
+               if (!status) {
+                       mlog(0, "%s: dead=%u, this=%u, sending "
+                            "begin_reco now\n", dlm->name, 
+                            dlm->reco.dead_node, dlm->node_num);
                        status = dlm_send_begin_reco_message(dlm,
                                      dlm->reco.dead_node);
                        /* this always succeeds */
index fa0bcac5ceaef0aeef8539f45a4b7ace3c6be648..d329c9df90ae8f19f03d03af7d8bd4036b22bf94 100644 (file)
@@ -1584,10 +1584,9 @@ static int ocfs2_commit_thread(void *arg)
        while (!(kthread_should_stop() &&
                 atomic_read(&journal->j_num_trans) == 0)) {
 
-               wait_event_interruptible_timeout(osb->checkpoint_event,
-                                                atomic_read(&journal->j_num_trans)
-                                                || kthread_should_stop(),
-                                                OCFS2_CHECKPOINT_INTERVAL);
+               wait_event_interruptible(osb->checkpoint_event,
+                                        atomic_read(&journal->j_num_trans)
+                                        || kthread_should_stop());
 
                status = ocfs2_commit_cache(osb);
                if (status < 0)
index 7d0a816184fa79cffa300c8ee6bcd391f6a97972..2f3a6acdac452e590e67e1235e3225c8975aeb8e 100644 (file)
@@ -29,8 +29,6 @@
 #include <linux/fs.h>
 #include <linux/jbd.h>
 
-#define OCFS2_CHECKPOINT_INTERVAL        (8 * HZ)
-
 enum ocfs2_journal_state {
        OCFS2_JOURNAL_FREE = 0,
        OCFS2_JOURNAL_LOADED,
index ef5e5414e7a83eb9b4295bbaba5464410b11e030..d63da756eb49b0096480b58adb519dc01bb2fdf5 100644 (file)
@@ -1124,8 +1124,6 @@ static void handle_attrs(struct super_block *s)
                                         "reiserfs: cannot support attributes until flag is set in super-block");
                        REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS);
                }
-       } else if (le32_to_cpu(rs->s_flags) & reiserfs_attrs_cleared) {
-               REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_ATTRS);
        }
 }
 
index 43de3ba833327d35618cd156d12ab96d53440c41..ab8894c3b9e51b6d589f957b4cf2e8ead3367dfd 100644 (file)
@@ -228,7 +228,8 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
                acl = ERR_PTR(retval);
        } else {
                acl = posix_acl_from_disk(value, retval);
-               *p_acl = posix_acl_dup(acl);
+               if (!IS_ERR(acl))
+                       *p_acl = posix_acl_dup(acl);
        }
 
        kfree(value);
index bc60a3e14ef37c05d07f579e123154d9ad9358fc..6ce68a9c8976e613ba271c627e6a571bc293cdb5 100644 (file)
@@ -398,11 +398,15 @@ asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
        ret = core_sys_select(n, inp, outp, exp, &timeout);
 
        if (tvp) {
+               struct timeval rtv;
+
                if (current->personality & STICKY_TIMEOUTS)
                        goto sticky;
-               tv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
-               tv.tv_sec = timeout;
-               if (copy_to_user(tvp, &tv, sizeof(tv))) {
+               rtv.tv_usec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ));
+               rtv.tv_sec = timeout;
+               if (timeval_compare(&rtv, &tv) < 0)
+                       rtv = tv;
+               if (copy_to_user(tvp, &rtv, sizeof(rtv))) {
 sticky:
                        /*
                         * If an application puts its timeval in read-only
@@ -460,11 +464,16 @@ asmlinkage long sys_pselect7(int n, fd_set __user *inp, fd_set __user *outp,
        ret = core_sys_select(n, inp, outp, exp, &timeout);
 
        if (tsp) {
+               struct timespec rts;
+
                if (current->personality & STICKY_TIMEOUTS)
                        goto sticky;
-               ts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) * 1000;
-               ts.tv_sec = timeout;
-               if (copy_to_user(tsp, &ts, sizeof(ts))) {
+               rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
+                                               1000;
+               rts.tv_sec = timeout;
+               if (timespec_compare(&rts, &ts) < 0)
+                       rts = ts;
+               if (copy_to_user(tsp, &rts, sizeof(rts))) {
 sticky:
                        /*
                         * If an application puts its timeval in read-only
@@ -758,12 +767,17 @@ asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds,
                sigprocmask(SIG_SETMASK, &sigsaved, NULL);
 
        if (tsp && timeout >= 0) {
+               struct timespec rts;
+
                if (current->personality & STICKY_TIMEOUTS)
                        goto sticky;
                /* Yes, we know it's actually an s64, but it's also positive. */
-               ts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) * 1000;
-               ts.tv_sec = timeout;
-               if (copy_to_user(tsp, &ts, sizeof(ts))) {
+               rts.tv_nsec = jiffies_to_usecs(do_div((*(u64*)&timeout), HZ)) *
+                                               1000;
+               rts.tv_sec = timeout;
+               if (timespec_compare(&rts, &ts) < 0)
+                       rts = ts;
+               if (copy_to_user(tsp, &rts, sizeof(rts))) {
                sticky:
                        /*
                         * If an application puts its timeval in read-only
index 24211b030f393e8ba18aea474efbd4bb4a71031b..9948cc1685a45ac86a3abd30a352c0806a5295ba 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -261,6 +261,7 @@ asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf)
        return error;
 }
 
+#ifndef __ARCH_WANT_STAT64
 asmlinkage long sys_newfstatat(int dfd, char __user *filename,
                                struct stat __user *statbuf, int flag)
 {
@@ -281,6 +282,7 @@ asmlinkage long sys_newfstatat(int dfd, char __user *filename,
 out:
        return error;
 }
+#endif
 
 asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf)
 {
@@ -395,6 +397,26 @@ asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf)
        return error;
 }
 
+asmlinkage long sys_fstatat64(int dfd, char __user *filename,
+                              struct stat64 __user *statbuf, int flag)
+{
+       struct kstat stat;
+       int error = -EINVAL;
+
+       if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
+               goto out;
+
+       if (flag & AT_SYMLINK_NOFOLLOW)
+               error = vfs_lstat_fd(dfd, filename, &stat);
+       else
+               error = vfs_stat_fd(dfd, filename, &stat);
+
+       if (!error)
+               error = cp_new_stat64(&stat, statbuf);
+
+out:
+       return error;
+}
 #endif /* __ARCH_WANT_STAT64 */
 
 void inode_add_bytes(struct inode *inode, loff_t bytes)
index f6439532a262d45e2ff47655edfd87cb9fcf55fb..5f24c755f577d9fc48add5c52300f377ed2690e4 100644 (file)
 #define MADV_WILLNEED  3               /* will need these pages */
 #define        MADV_SPACEAVAIL 5               /* ensure resources are available */
 #define MADV_DONTNEED  6               /* don't need these pages */
-#define MADV_REMOVE    7               /* remove these pages & resources */
+
+/* common/generic parameters */
+#define MADV_REMOVE    9               /* remove these pages & resources */
+#define MADV_DONTFORK  10              /* don't inherit across fork */
+#define MADV_DOFORK    11              /* do inherit across fork */
 
 /* compatibility flags */
 #define MAP_ANON       MAP_ANONYMOUS
diff --git a/include/asm-arm/arch-s3c2410/h1940-latch.h b/include/asm-arm/arch-s3c2410/h1940-latch.h
new file mode 100644 (file)
index 0000000..c580241
--- /dev/null
@@ -0,0 +1,64 @@
+/* linux/include/asm-arm/arch-s3c2410/h1940-latch.h
+ *
+ * (c) 2005 Simtec Electronics
+ *     http://armlinux.simtec.co.uk/
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ *  iPAQ H1940 series - latch definitions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_ARCH_H1940_LATCH_H
+#define __ASM_ARCH_H1940_LATCH_H
+
+
+#ifndef __ASSEMBLY__
+#define H1940_LATCH            ((void __iomem *)0xF8000000)
+#else
+#define H1940_LATCH            0xF8000000
+#endif
+
+#define H1940_PA_LATCH         (S3C2410_CS2)
+
+/* SD layer latch */
+
+#define H1940_LATCH_SDQ1               (1<<16)
+#define H1940_LATCH_LCD_P1             (1<<17)
+#define H1940_LATCH_LCD_P2             (1<<18)
+#define H1940_LATCH_LCD_P3             (1<<19)
+#define H1940_LATCH_MAX1698_nSHUTDOWN  (1<<20)         /* LCD backlight */
+#define H1940_LATCH_LED_RED            (1<<21)
+#define H1940_LATCH_SDQ7               (1<<22)
+#define H1940_LATCH_USB_DP             (1<<23)
+
+/* CPU layer latch */
+
+#define H1940_LATCH_UDA_POWER          (1<<24)
+#define H1940_LATCH_AUDIO_POWER                (1<<25)
+#define H1940_LATCH_SM803_ENABLE       (1<<26)
+#define H1940_LATCH_LCD_P4             (1<<27)
+#define H1940_LATCH_CPUQ5              (1<<28)         /* untraced */
+#define H1940_LATCH_BLUETOOTH_POWER    (1<<29)         /* active high */
+#define H1940_LATCH_LED_GREEN          (1<<30)
+#define H1940_LATCH_LED_FLASH          (1<<31)
+
+/* default settings */
+
+#define H1940_LATCH_DEFAULT            \
+       H1940_LATCH_LCD_P4              | \
+       H1940_LATCH_SM803_ENABLE        | \
+       H1940_LATCH_SDQ1                | \
+       H1940_LATCH_LCD_P1              | \
+       H1940_LATCH_LCD_P2              | \
+       H1940_LATCH_LCD_P3              | \
+       H1940_LATCH_MAX1698_nSHUTDOWN   | \
+       H1940_LATCH_CPUQ5
+
+/* control functions */
+
+extern void h1940_latch_control(unsigned int clear, unsigned int set);
+
+#endif /* __ASM_ARCH_H1940_LATCH_H */
index f0bebca2ac214a5b6b87dc8413c18b3cd9115ceb..54570d2e95b7b4856430550f75022853a966434a 100644 (file)
@@ -1,19 +1,7 @@
 #ifndef __ARM_MMAN_H__
 #define __ARM_MMAN_H__
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
+#include <asm-generic/mman.h>
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_POPULATE   0x8000          /* populate (prefault) page tables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* __ARM_MMAN_H__ */
index 0ed7780541fa1b27abba46b8541bcb6cf583d1c6..4000a6c1b76b802bab9f14f9addde3d93bb61f4b 100644 (file)
@@ -1,19 +1,7 @@
 #ifndef __ARM_MMAN_H__
 #define __ARM_MMAN_H__
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
+#include <asm-generic/mman.h>
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_POPULATE    0x8000          /* populate (prefault) page tables */
 #define MAP_NONBLOCK    0x10000         /* do not block on IO */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* __ARM_MMAN_H__ */
index 5a382b8bf3f738effedd851b6887f7ce4197817b..1c35e1b66b46e206a24d5b99a65a13eedcf44ad3 100644 (file)
@@ -3,19 +3,7 @@
 
 /* verbatim copy of asm-i386/ version */
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
+#include <asm-generic/mman.h>
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_POPULATE   0x8000          /* populate (prefault) pagetables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* __CRIS_MMAN_H__ */
index a59f684b4f33e8ea747068561ec1ecfa65d60ce5..5d9f84bfdcad3300ddccb8b031c86433b472648d 100644 (file)
@@ -220,9 +220,9 @@ extern unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsig
        switch (sizeof(__xg_orig)) {                                            \
        case 4:                                                                 \
                asm volatile(                                                   \
-                       "swap%I0 %2,%M0"                                        \
-                       : "+m"(*__xg_ptr), "=&r"(__xg_orig)                     \
-                       : "r"(x)                                                \
+                       "swap%I0 %M0,%1"                                        \
+                       : "+m"(*__xg_ptr), "=r"(__xg_orig)                      \
+                       : "1"(x)                                                \
                        : "memory"                                              \
                        );                                                      \
                break;                                                          \
index 3007deccb4904256521eda65a7defdc91c555f37..eaa5826bc1c8f1627d890f4a7fcda630716c13fb 100644 (file)
@@ -87,5 +87,17 @@ static inline void flush_icache_page(struct vm_area_struct *vma, struct page *pa
        flush_icache_user_range(vma, page, page_to_phys(page), PAGE_SIZE);
 }
 
+/*
+ * permit ptrace to access another process's address space through the icache
+ * and the dcache
+ */
+#define copy_to_user_page(vma, page, vaddr, dst, src, len)     \
+do {                                                           \
+       memcpy((dst), (src), (len));                            \
+       flush_icache_user_range((vma), (page), (vaddr), (len)); \
+} while(0)
+
+#define copy_from_user_page(vma, page, vaddr, dst, src, len)   \
+       memcpy((dst), (src), (len))
 
 #endif /* _ASM_CACHEFLUSH_H */
index 075369b1a34baba46412a739b95b2fe66517111d..01247cb2bc39d88ba228d4bd1b82131754848f33 100644 (file)
@@ -251,7 +251,6 @@ static inline void writel(uint32_t datum, volatile void __iomem *addr)
 #define IOMAP_WRITETHROUGH             3
 
 extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag);
-extern void __iounmap(void __iomem *addr, unsigned long size);
 
 static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size)
 {
index 8af4a41c255e113b6bf38b37fb0eafb26e312f65..b4371e9286836ff5f3d84da2c6ddf4becc6ce049 100644 (file)
@@ -1,19 +1,7 @@
 #ifndef __ASM_MMAN_H__
 #define __ASM_MMAN_H__
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
+#include <asm-generic/mman.h>
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_POPULATE   0x8000          /* populate (prefault) pagetables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* __ASM_MMAN_H__ */
 
index ef472f058d9c28bb5b67b38469bc919909ae8e58..c2a541ef828d88c87f73fed40dcd0f9b3e85dc99 100644 (file)
@@ -98,6 +98,7 @@
 #define TBR_TT_TRAP0           (0x80 << 4)
 #define TBR_TT_TRAP1           (0x81 << 4)
 #define TBR_TT_TRAP2           (0x82 << 4)
+#define TBR_TT_TRAP3           (0x83 << 4)
 #define TBR_TT_TRAP126         (0xfe << 4)
 #define TBR_TT_BREAK           (0xff << 4)
 
index d2aea70a5f64cc0ef37e55275394c06f1ad4b34b..f72ff0c4dc0b9050a580e0c4dba61b8a36b7b129 100644 (file)
@@ -40,8 +40,84 @@ do {                                                                 \
 
 /*
  * interrupt flag manipulation
+ * - use virtual interrupt management since touching the PSR is slow
+ *   - ICC2.Z: T if interrupts virtually disabled
+ *   - ICC2.C: F if interrupts really disabled
+ * - if Z==1 upon interrupt:
+ *   - C is set to 0
+ *   - interrupts are really disabled
+ *   - entry.S returns immediately
+ * - uses TIHI (TRAP if Z==0 && C==0) #2 to really reenable interrupts
+ *   - if taken, the trap:
+ *     - sets ICC2.C
+ *     - enables interrupts
  */
-#define local_irq_disable()                            \
+#define local_irq_disable()                                    \
+do {                                                           \
+       /* set Z flag, but don't change the C flag */           \
+       asm volatile("  andcc   gr0,gr0,gr0,icc2        \n"     \
+                    :                                          \
+                    :                                          \
+                    : "memory", "icc2"                         \
+                    );                                         \
+} while(0)
+
+#define local_irq_enable()                                     \
+do {                                                           \
+       /* clear Z flag and then test the C flag */             \
+       asm volatile("  oricc   gr0,#1,gr0,icc2         \n"     \
+                    "  tihi    icc2,gr0,#2             \n"     \
+                    :                                          \
+                    :                                          \
+                    : "memory", "icc2"                         \
+                    );                                         \
+} while(0)
+
+#define local_save_flags(flags)                                        \
+do {                                                           \
+       typecheck(unsigned long, flags);                        \
+       asm volatile("movsg ccr,%0"                             \
+                    : "=r"(flags)                              \
+                    :                                          \
+                    : "memory");                               \
+                                                               \
+       /* shift ICC2.Z to bit 0 */                             \
+       flags >>= 26;                                           \
+                                                               \
+       /* make flags 1 if interrupts disabled, 0 otherwise */  \
+       flags &= 1UL;                                           \
+} while(0)
+
+#define irqs_disabled() \
+       ({unsigned long flags; local_save_flags(flags); flags; })
+
+#define        local_irq_save(flags)                   \
+do {                                           \
+       typecheck(unsigned long, flags);        \
+       local_save_flags(flags);                \
+       local_irq_disable();                    \
+} while(0)
+
+#define        local_irq_restore(flags)                                        \
+do {                                                                   \
+       typecheck(unsigned long, flags);                                \
+                                                                       \
+       /* load the Z flag by turning 1 if disabled into 0 if disabled  \
+        * and thus setting the Z flag but not the C flag */            \
+       asm volatile("  xoricc  %0,#1,gr0,icc2          \n"             \
+                    /* then test Z=0 and C=0 */                        \
+                    "  tihi    icc2,gr0,#2             \n"             \
+                    :                                                  \
+                    : "r"(flags)                                       \
+                    : "memory", "icc2"                                 \
+                    );                                                 \
+                                                                       \
+} while(0)
+
+/*
+ * real interrupt flag manipulation
+ */
+#define __local_irq_disable()                          \
 do {                                                   \
        unsigned long psr;                              \
        asm volatile("  movsg   psr,%0          \n"     \
@@ -53,7 +129,7 @@ do {                                                 \
                     : "memory");                       \
 } while(0)
 
-#define local_irq_enable()                             \
+#define __local_irq_enable()                           \
 do {                                                   \
        unsigned long psr;                              \
        asm volatile("  movsg   psr,%0          \n"     \
@@ -64,7 +140,7 @@ do {                                                 \
                     : "memory");                       \
 } while(0)
 
-#define local_save_flags(flags)                        \
+#define __local_save_flags(flags)              \
 do {                                           \
        typecheck(unsigned long, flags);        \
        asm("movsg psr,%0"                      \
@@ -73,7 +149,7 @@ do {                                         \
            : "memory");                        \
 } while(0)
 
-#define        local_irq_save(flags)                           \
+#define        __local_irq_save(flags)                         \
 do {                                                   \
        unsigned long npsr;                             \
        typecheck(unsigned long, flags);                \
@@ -86,7 +162,7 @@ do {                                                 \
                     : "memory");                       \
 } while(0)
 
-#define        local_irq_restore(flags)                        \
+#define        __local_irq_restore(flags)                      \
 do {                                                   \
        typecheck(unsigned long, flags);                \
        asm volatile("  movgs   %0,psr          \n"     \
@@ -95,7 +171,7 @@ do {                                                 \
                     : "memory");                       \
 } while(0)
 
-#define irqs_disabled() \
+#define __irqs_disabled() \
        ((__get_PSR() & PSR_PIL) >= PSR_PIL_14)
 
 /*
index b6bcbe01f6ee43851e0f67570684010f529de01f..a1d140438863a957991f9cd765af3a2d1a2f6d10 100644 (file)
@@ -306,7 +306,4 @@ extern long strnlen_user(const char *src, long count);
 
 extern unsigned long search_exception_table(unsigned long addr);
 
-#define copy_to_user_page(vma, page, vaddr, dst, src, len)     memcpy(dst, src, len)
-#define copy_from_user_page(vma, page, vaddr, dst, src, len)   memcpy(dst, src, len)
-
 #endif /* _ASM_UACCESS_H */
index 4d994d2e99e30e50a7ed68da17914abfa939cefa..322531caa484f7697bcb48bd3fe2b824d0e3ed8b 100644 (file)
 #define __NR_add_key           286
 #define __NR_request_key       287
 #define __NR_keyctl            288
-#define __NR_vperfctr_open     289
-#define __NR_vperfctr_control  (__NR_perfctr_info+1)
-#define __NR_vperfctr_unlink   (__NR_perfctr_info+2)
-#define __NR_vperfctr_iresume  (__NR_perfctr_info+3)
-#define __NR_vperfctr_read     (__NR_perfctr_info+4)
+#define __NR_ioprio_set                289
+#define __NR_ioprio_get                290
+#define __NR_inotify_init      291
+#define __NR_inotify_add_watch 292
+#define __NR_inotify_rm_watch  293
+#define __NR_migrate_pages     294
+#define __NR_openat            295
+#define __NR_mkdirat           296
+#define __NR_mknodat           297
+#define __NR_fchownat          298
+#define __NR_futimesat         299
+#define __NR_newfstatat                300
+#define __NR_unlinkat          301
+#define __NR_renameat          302
+#define __NR_linkat            303
+#define __NR_symlinkat         304
+#define __NR_readlinkat                305
+#define __NR_fchmodat          306
+#define __NR_faccessat         307
+#define __NR_pselect6          308
+#define __NR_ppoll             309
 
-#define NR_syscalls 294
+#define NR_syscalls 310
 
 /*
  * process the return value of a syscall, consigning it to one of two possible fates
diff --git a/include/asm-generic/mman.h b/include/asm-generic/mman.h
new file mode 100644 (file)
index 0000000..3b41d2b
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef _ASM_GENERIC_MMAN_H
+#define _ASM_GENERIC_MMAN_H
+
+/*
+ Author: Michael S. Tsirkin <mst@mellanox.co.il>, Mellanox Technologies Ltd.
+ Based on: asm-xxx/mman.h
+*/
+
+#define PROT_READ      0x1             /* page can be read */
+#define PROT_WRITE     0x2             /* page can be written */
+#define PROT_EXEC      0x4             /* page can be executed */
+#define PROT_SEM       0x8             /* page may be used for atomic ops */
+#define PROT_NONE      0x0             /* page can not be accessed */
+#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
+#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
+
+#define MAP_SHARED     0x01            /* Share changes */
+#define MAP_PRIVATE    0x02            /* Changes are private */
+#define MAP_TYPE       0x0f            /* Mask for type of mapping */
+#define MAP_FIXED      0x10            /* Interpret addr exactly */
+#define MAP_ANONYMOUS  0x20            /* don't use a file */
+
+#define MS_ASYNC       1               /* sync memory asynchronously */
+#define MS_INVALIDATE  2               /* invalidate the caches */
+#define MS_SYNC                4               /* synchronous memory sync */
+
+#define MADV_NORMAL    0               /* no further special treatment */
+#define MADV_RANDOM    1               /* expect random page references */
+#define MADV_SEQUENTIAL        2               /* expect sequential page references */
+#define MADV_WILLNEED  3               /* will need these pages */
+#define MADV_DONTNEED  4               /* don't need these pages */
+
+/* common parameters: try to keep these consistent across architectures */
+#define MADV_REMOVE    9               /* remove these pages & resources */
+#define MADV_DONTFORK  10              /* don't inherit across fork */
+#define MADV_DOFORK    11              /* do inherit across fork */
+
+/* compatibility flags */
+#define MAP_ANON       MAP_ANONYMOUS
+#define MAP_FILE       0
+
+#endif
index 744a8fb485c230780ff6256abc483a58bab647b2..b9f104f22a36a96b976758baca4215e47955b9df 100644 (file)
@@ -1,19 +1,7 @@
 #ifndef __H8300_MMAN_H__
 #define __H8300_MMAN_H__
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
+#include <asm-generic/mman.h>
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_POPULATE   0x8000          /* populate (prefault) pagetables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* __H8300_MMAN_H__ */
index ba4941e6f643213f39bcff3379259cdadf8584d3..8fd9d7ab7fafcbf143751bc3967d384b1c9f729a 100644 (file)
@@ -1,19 +1,7 @@
 #ifndef __I386_MMAN_H__
 #define __I386_MMAN_H__
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
+#include <asm-generic/mman.h>
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_POPULATE   0x8000          /* populate (prefault) pagetables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* __I386_MMAN_H__ */
index af503a122b23592eb6e82836fffd30ead57de91a..aa958c6ee83e35898ad50ccecab748f18daf7d50 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef _ASM_I386_TOPOLOGY_H
 #define _ASM_I386_TOPOLOGY_H
 
-#ifdef CONFIG_SMP
+#ifdef CONFIG_X86_HT
 #define topology_physical_package_id(cpu)                              \
        (phys_proc_id[cpu] == BAD_APICID ? -1 : phys_proc_id[cpu])
 #define topology_core_id(cpu)                                          \
index cf6f2cd9c514e223aed23254828f256ec6f2203e..dc81a55dd94d08c0fa27bffb254b781bc6b1e1e5 100644 (file)
 #define __NR_mknodat           297
 #define __NR_fchownat          298
 #define __NR_futimesat         299
-#define __NR_newfstatat                300
+#define __NR_fstatat64         300
 #define __NR_unlinkat          301
 #define __NR_renameat          302
 #define __NR_linkat            303
index 828beb24a20ec7837fe7a00dde7c4b8b93bbe941..6ba179f1271845f92732ab46226f02874fbb714b 100644 (file)
@@ -8,19 +8,7 @@
  *     David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
+#include <asm-generic/mman.h>
 
 #define MAP_GROWSDOWN  0x00100         /* stack-like segment */
 #define MAP_GROWSUP    0x00200         /* register stack-like segment */
 #define MAP_POPULATE   0x08000         /* populate (prefault) pagetables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* _ASM_IA64_MMAN_H */
index 962f9bd1bdff71c81f6810c9cc144a0086ab2022..019956c613e4814d9341a912b20457b029470e0b 100644 (file)
 #define __NR_inotify_add_watch         1278
 #define __NR_inotify_rm_watch          1279
 #define __NR_migrate_pages             1280
+#define __NR_openat                    1281
+#define __NR_mkdirat                   1282
+#define __NR_mknodat                   1283
+#define __NR_fchownat                  1284
+#define __NR_futimesat                 1285
+#define __NR_newfstatat                        1286
+#define __NR_unlinkat                  1287
+#define __NR_renameat                  1288
+#define __NR_linkat                    1289
+#define __NR_symlinkat                 1290
+#define __NR_readlinkat                        1291
+#define __NR_fchmodat                  1292
+#define __NR_faccessat                 1293
+/* 1294, 1295 reserved for pselect/ppoll */
+#define __NR_unshare                   1296
 
 #ifdef __KERNEL__
 
 #include <linux/config.h>
 
-#define NR_syscalls                    270 /* length of syscall table */
+#define NR_syscalls                    273 /* length of syscall table */
 
 #define __ARCH_WANT_SYS_RT_SIGACTION
 
index 12e29747bc84a510163f6e948f3d6834047e0c7c..695a860c024fb0bd6c286f5739516563af831795 100644 (file)
@@ -1,21 +1,9 @@
 #ifndef __M32R_MMAN_H__
 #define __M32R_MMAN_H__
 
-/* orig : i386 2.6.0-test6 */
-
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
+#include <asm-generic/mman.h>
 
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
+/* orig : i386 2.6.0-test6 */
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_POPULATE   0x8000          /* populate (prefault) pagetables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* __M32R_MMAN_H__ */
index ea262ab88b3bb547761227d0a039e7800674bc4c..1626d37f48980c1fce8179051790323b557c5a70 100644 (file)
@@ -1,19 +1,7 @@
 #ifndef __M68K_MMAN_H__
 #define __M68K_MMAN_H__
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
+#include <asm-generic/mman.h>
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_POPULATE   0x8000          /* populate (prefault) pagetables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* __M68K_MMAN_H__ */
index 934e063e79f1752f0ca0a8368ced8a66c85c34ba..818b9a97e214280c0c6a93af52699028e32a95bb 100644 (file)
  */
 #define MIPS_CPU_ISA_I         0x00000001
 #define MIPS_CPU_ISA_II                0x00000002
-#define MIPS_CPU_ISA_III       0x00000003
-#define MIPS_CPU_ISA_IV                0x00000004
-#define MIPS_CPU_ISA_V         0x00000005
+#define MIPS_CPU_ISA_III       0x00000004
+#define MIPS_CPU_ISA_IV                0x00000008
+#define MIPS_CPU_ISA_V         0x00000010
 #define MIPS_CPU_ISA_M32R1     0x00000020
 #define MIPS_CPU_ISA_M32R2     0x00000040
 #define MIPS_CPU_ISA_M64R1     0x00000080
diff --git a/include/asm-mips/gcc/sgidefs.h b/include/asm-mips/gcc/sgidefs.h
deleted file mode 100644 (file)
index 0599437..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * include/sgidefs.h
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1996 by Ralf Baechle
- *
- * This file is here to satisfy GCC's expectations.
- */
-#ifndef __SGIDEFS_H
-#define __SGIDEFS_H
-
-#include <asm/sgidefs.h>
-
-#endif /* __SGIDEFS_H */
index c6a2e5f0574a46051624b915e02047a2b11f3a87..48b4cfaa0d5003f6ecf070f254fad7faccc62df2 100644 (file)
@@ -3,20 +3,11 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2003 by Ralf Baechle
+ * Copyright (C) 2003, 2005 by Ralf Baechle
  */
 #ifndef __ASM_MACH_GENERIC_TIMEX_H
 #define __ASM_MACH_GENERIC_TIMEX_H
 
-#include <linux/config.h>
-
-/*
- * Last remaining user of the i8254 PIC, will be converted, too ...
- */
-#ifdef CONFIG_SNI_RM200_PCI
-#define CLOCK_TICK_RATE                1193182
-#else
 #define CLOCK_TICK_RATE                500000
-#endif
 
 #endif /* __ASM_MACH_GENERIC_TIMEX_H */
diff --git a/include/asm-mips/mach-rm200/timex.h b/include/asm-mips/mach-rm200/timex.h
new file mode 100644 (file)
index 0000000..11ff6cb
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2003, 2005 by Ralf Baechle
+ */
+#ifndef __ASM_MACH_RM200_TIMEX_H
+#define __ASM_MACH_RM200_TIMEX_H
+
+#define CLOCK_TICK_RATE                1193182
+
+#endif /* __ASM_MACH_RM200_TIMEX_H */
index dd17c8bd62a1cbc4450db3b21035f8de94826639..046cf686bee7f74a773877ec658c29e8d8d10e2a 100644 (file)
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
+#define MADV_NORMAL    0               /* no further special treatment */
+#define MADV_RANDOM    1               /* expect random page references */
+#define MADV_SEQUENTIAL        2               /* expect sequential page references */
+#define MADV_WILLNEED  3               /* will need these pages */
+#define MADV_DONTNEED  4               /* don't need these pages */
+
+/* common parameters: try to keep these consistent across architectures */
+#define MADV_REMOVE    9               /* remove these pages & resources */
+#define MADV_DONTFORK  10              /* don't inherit across fork */
+#define MADV_DOFORK    11              /* do inherit across fork */
 
 /* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
+#define MAP_ANON       MAP_ANONYMOUS
+#define MAP_FILE       0
 
 #endif /* _ASM_MMAN_H */
index cc53196efa40a0623383c6df50b0adaed3553a0f..9632c27dad15045ad66b443cbfe026ad02966800 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <asm/asm.h>
 #include <asm/cacheops.h>
+#include <asm/cpu-features.h>
 
 /*
  * This macro return a properly sign-extended address suitable as base address
@@ -78,22 +79,25 @@ static inline void flush_scache_line(unsigned long addr)
        cache_op(Hit_Writeback_Inv_SD, addr);
 }
 
+#define protected_cache_op(op,addr)                            \
+       __asm__ __volatile__(                                   \
+       "       .set    push                    \n"             \
+       "       .set    noreorder               \n"             \
+       "       .set    mips3                   \n"             \
+       "1:     cache   %0, (%1)                \n"             \
+       "2:     .set    pop                     \n"             \
+       "       .section __ex_table,\"a\"       \n"             \
+       "       "STR(PTR)" 1b, 2b               \n"             \
+       "       .previous"                                      \
+       :                                                       \
+       : "i" (op), "r" (addr))
+
 /*
  * The next two are for badland addresses like signal trampolines.
  */
 static inline void protected_flush_icache_line(unsigned long addr)
 {
-       __asm__ __volatile__(
-               "       .set    push                    \n"
-               "       .set    noreorder               \n"
-               "       .set    mips3                   \n"
-               "1:     cache   %0, (%1)                \n"
-               "2:     .set    pop                     \n"
-               "       .section __ex_table,\"a\"       \n"
-               "       "STR(PTR)" 1b, 2b               \n"
-               "       .previous"
-               :
-               : "i" (Hit_Invalidate_I), "r" (addr));
+       protected_cache_op(Hit_Invalidate_I, addr);
 }
 
 /*
@@ -104,32 +108,12 @@ static inline void protected_flush_icache_line(unsigned long addr)
  */
 static inline void protected_writeback_dcache_line(unsigned long addr)
 {
-       __asm__ __volatile__(
-               "       .set    push                    \n"
-               "       .set    noreorder               \n"
-               "       .set    mips3                   \n"
-               "1:     cache   %0, (%1)                \n"
-               "2:     .set    pop                     \n"
-               "       .section __ex_table,\"a\"       \n"
-               "       "STR(PTR)" 1b, 2b               \n"
-               "       .previous"
-               :
-               : "i" (Hit_Writeback_Inv_D), "r" (addr));
+       protected_cache_op(Hit_Writeback_Inv_D, addr);
 }
 
 static inline void protected_writeback_scache_line(unsigned long addr)
 {
-       __asm__ __volatile__(
-               "       .set    push                    \n"
-               "       .set    noreorder               \n"
-               "       .set    mips3                   \n"
-               "1:     cache   %0, (%1)                \n"
-               "2:     .set    pop                     \n"
-               "       .section __ex_table,\"a\"       \n"
-               "       "STR(PTR)" 1b, 2b               \n"
-               "       .previous"
-               :
-               : "i" (Hit_Writeback_Inv_SD), "r" (addr));
+       protected_cache_op(Hit_Writeback_Inv_SD, addr);
 }
 
 /*
@@ -295,4 +279,28 @@ __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)
 __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64)
 __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128)
 
+/* build blast_xxx_range, protected_blast_xxx_range */
+#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot) \
+static inline void prot##blast_##pfx##cache##_range(unsigned long start, \
+                                                   unsigned long end)  \
+{                                                                      \
+       unsigned long lsize = cpu_##desc##_line_size();                 \
+       unsigned long addr = start & ~(lsize - 1);                      \
+       unsigned long aend = (end - 1) & ~(lsize - 1);                  \
+       while (1) {                                                     \
+               prot##cache_op(hitop, addr);                            \
+               if (addr == aend)                                       \
+                       break;                                          \
+               addr += lsize;                                          \
+       }                                                               \
+}
+
+__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_)
+__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_)
+__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_)
+__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, )
+__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, )
+/* blast_inv_dcache_range */
+__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, )
+
 #endif /* _ASM_R4KCACHE_H */
index 91d813a37823e03a68690233818a754eac0b8f05..7a553e9d44d3299ad26363b2947a299e2fd76727 100644 (file)
@@ -266,6 +266,8 @@ do {                                                                        \
  */
 #define __get_user_asm_ll32(val, addr)                                 \
 {                                                                      \
+        unsigned long long __gu_tmp;                                   \
+                                                                       \
        __asm__ __volatile__(                                           \
        "1:     lw      %1, (%3)                                \n"     \
        "2:     lw      %D1, 4(%3)                              \n"     \
@@ -280,8 +282,9 @@ do {                                                                        \
        "       " __UA_ADDR "   1b, 4b                          \n"     \
        "       " __UA_ADDR "   2b, 4b                          \n"     \
        "       .previous                                       \n"     \
-       : "=r" (__gu_err), "=&r" (val)                                  \
+       : "=r" (__gu_err), "=&r" (__gu_tmp)                             \
        : "0" (0), "r" (addr), "i" (-EFAULT));                          \
+       (val) = __gu_tmp;                                               \
 }
 
 /*
index e7ff9b1877835c4911d02afe6c747ecae6b02ca2..769305d20108338d00b8775c80ea4d8727e067ea 100644 (file)
@@ -1184,10 +1184,8 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
 #define __ARCH_WANT_SYS_RT_SIGACTION
-# ifndef __mips64
-#  define __ARCH_WANT_STAT64
-# endif
 # ifdef CONFIG_32BIT
+#  define __ARCH_WANT_STAT64
 #  define __ARCH_WANT_SYS_TIME
 # endif
 # ifdef CONFIG_MIPS32_O32
index 736b0abcac052b1ad468ff0362bfe8e3173c531a..0ef15ee0f17ef8e21eaaf394838ed3cd5e965bb3 100644 (file)
 #define MADV_SPACEAVAIL 5               /* insure that resources are reserved */
 #define MADV_VPS_PURGE  6               /* Purge pages from VM page cache */
 #define MADV_VPS_INHERIT 7              /* Inherit parents page size */
-#define MADV_REMOVE     8              /* remove these pages & resources */
+
+/* common/generic parameters */
+#define MADV_REMOVE    9               /* remove these pages & resources */
+#define MADV_DONTFORK  10              /* don't inherit across fork */
+#define MADV_DOFORK    11              /* do inherit across fork */
 
 /* The range 12-64 is reserved for page size specification. */
 #define MADV_4K_PAGES   12              /* Use 4K pages  */
index a2e34c21b44f8f09455dad99aef78285d166da1a..24cf664a829564ebeb9e8a6968a1ad5c2581265e 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _ASM_POWERPC_MMAN_H
 #define _ASM_POWERPC_MMAN_H
 
+#include <asm-generic/mman.h>
+
 /*
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -8,19 +10,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
 #define MAP_RENAME      MAP_ANONYMOUS   /* In SunOS terminology */
 #define MAP_NORESERVE   0x40            /* don't reserve swap pages */
 #define MAP_LOCKED     0x80
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_EXECUTABLE 0x1000          /* mark it as an executable */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT     0x2000          /* lock all currently mapped pages */
 #define MCL_FUTURE      0x4000          /* lock all additions to address space */
 
 #define MAP_POPULATE   0x8000          /* populate (prefault) pagetables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* _ASM_POWERPC_MMAN_H */
index a40cdff21a88e1d335474e5895012dbafadaec3f..35556993f06695662cb924f5e62b68930fc0d59e 100644 (file)
 #define __NR_spu_create                279
 #define __NR_pselect6          280
 #define __NR_ppoll             281
+#define __NR_unshare           282
 
-#define __NR_syscalls          282
+#define __NR_syscalls          283
 
 #ifdef __KERNEL__
 #define __NR__exit __NR_exit
index 61232760cc3bd50e5d5b72248f23d03dd3fdf87a..3628899f48bb34c45a17a45120e4b3acf47f846a 100644 (file)
@@ -518,8 +518,8 @@ static inline int __test_bit(unsigned long nr, const volatile unsigned long *ptr
 
 static inline int 
 __constant_test_bit(unsigned long nr, const volatile unsigned long *addr) {
-    return ((((volatile char *) addr)
-           [(nr^(__BITOPS_WORDSIZE-8))>>3] & (1<<(nr&7)))) != 0;
+    return (((volatile char *) addr)
+           [(nr^(__BITOPS_WORDSIZE-8))>>3] & (1<<(nr&7))) != 0;
 }
 
 #define test_bit(nr,addr) \
index c8d5409b5d563c383e9fa4f8378504b41c992473..7839767d837ea64f90d82193b04722e5395a59c6 100644 (file)
@@ -9,19 +9,7 @@
 #ifndef __S390_MMAN_H__
 #define __S390_MMAN_H__
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
+#include <asm-generic/mman.h>
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_POPULATE   0x8000          /* populate (prefault) pagetables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0              /* default page-in behavior */
-#define MADV_RANDOM    0x1              /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3              /* pre-fault pages */
-#define MADV_DONTNEED  0x4              /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* __S390_MMAN_H__ */
index 348a88137445ecfb326855d8c10763e15c1910c0..da3fd4a7bb3257f75b0e6be92d7c13c1879b7c4d 100644 (file)
@@ -8,6 +8,8 @@
 #ifndef _ASM_S390_SETUP_H
 #define _ASM_S390_SETUP_H
 
+#ifdef __KERNEL__
+
 #include <asm/types.h>
 
 #define PARMAREA               0x10400
@@ -114,7 +116,7 @@ extern u16 ipl_devno;
                                 IPL_PARMBLOCK_ORIGIN)
 #define IPL_PARMBLOCK_SIZE     (IPL_PARMBLOCK_START->hdr.length)
 
-#else 
+#else /* __ASSEMBLY__ */
 
 #ifndef __s390x__
 #define IPL_DEVICE        0x10404
@@ -127,6 +129,6 @@ extern u16 ipl_devno;
 #endif /* __s390x__ */
 #define COMMAND_LINE      0x10480
 
-#endif
-
-#endif
+#endif /* __ASSEMBLY__ */
+#endif /* __KERNEL__ */
+#endif /* _ASM_S390_SETUP_H */
index a2ae7628bbaaf8e0c0d06a9fab16863aac607777..9c6e9c300eb9797a54776b60e247df1515d17a37 100644 (file)
@@ -101,6 +101,7 @@ smp_call_function_on(void (*func) (void *info), void *info,
        func(info);
        return 0;
 }
+#define smp_cpu_not_running(cpu)       1
 #define smp_get_cpu(cpu) ({ 0; })
 #define smp_put_cpu(cpu) ({ 0; })
 #endif
index 29a9f357eb9ebc394b330738c9934eb44d5ba1d6..657d582e8149504e331e65dc7e30cf85aceb7117 100644 (file)
 #define __NR_mknodat           290
 #define __NR_fchownat          291
 #define __NR_futimesat         292
-#define __NR_newfstatat                293
+#define __NR_fstatat64         293
 #define __NR_unlinkat          294
 #define __NR_renameat          295
 #define __NR_linkat            296
 #define __NR_faccessat         300
 #define __NR_pselect6          301
 #define __NR_ppoll             302
+#define __NR_unshare           303
 
-#define NR_syscalls 303
+#define NR_syscalls 304
 
 /* 
  * There are some system calls that are not present on 64 bit, some
 #undef  __NR_fcntl64
 #undef  __NR_sendfile64
 #undef  __NR_fadvise64_64
+#undef  __NR_fstatat64
 
 #define __NR_select            142
 #define __NR_getrlimit         191     /* SuS compliant getrlimit */
 #define __NR_setgid            214
 #define __NR_setfsuid                  215
 #define __NR_setfsgid                  216
+#define __NR_newfstatat                293
 
 #endif
 
index 693bd55a37104f543a2c5e3a21878bbc5cd3d395..156eb0225cf64d0a49cd4e7ec14e1602467cabb7 100644 (file)
@@ -1,19 +1,7 @@
 #ifndef __ASM_SH_MMAN_H
 #define __ASM_SH_MMAN_H
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
+#include <asm-generic/mman.h>
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_POPULATE   0x8000          /* populate (prefault) page tables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* __ASM_SH_MMAN_H */
index 98435ad8619e0b0b5f5cd9aa882de51d6ea89948..88d1886abf3b4fabb8371bb6486c67f3937218be 100644 (file)
@@ -2,21 +2,10 @@
 #ifndef __SPARC_MMAN_H__
 #define __SPARC_MMAN_H__
 
+#include <asm-generic/mman.h>
+
 /* SunOS'ified... */
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
 #define MAP_RENAME      MAP_ANONYMOUS   /* In SunOS terminology */
 #define MAP_NORESERVE   0x40            /* don't reserve swap pages */
 #define MAP_INHERIT     0x80            /* SunOS doesn't do this, but... */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_EXECUTABLE 0x1000          /* mark it as an executable */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT     0x2000          /* lock all currently mapped pages */
 #define MCL_FUTURE      0x4000          /* lock all additions to address space */
 
 #define MC_LOCKAS       5  /* Lock an entire address space of the calling process */
 #define MC_UNLOCKAS     6  /* Unlock entire address space of calling process */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
 #define MADV_FREE      0x5             /* (Solaris) contents can be freed */
-#define MADV_REMOVE    0x6             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
 
 #endif /* __SPARC_MMAN_H__ */
index 0615d601a7c67560b23634a8f51ddd6dd4f96aa9..64ec640a40eed6dd3abcdf8f295dddd95e07f036 100644 (file)
 #define __NR_mknodat           286
 #define __NR_fchownat          287
 #define __NR_futimesat         288
-#define __NR_newfstatat                289
+#define __NR_fstatat64         289
 #define __NR_unlinkat          290
 #define __NR_renameat          291
 #define __NR_linkat            292
index cb4b6156194dbe12dc92adfba8c3247400ebd0f8..6fd878e614350d6ad5212b3795d1655f7077aaa6 100644 (file)
@@ -2,21 +2,10 @@
 #ifndef __SPARC64_MMAN_H__
 #define __SPARC64_MMAN_H__
 
+#include <asm-generic/mman.h>
+
 /* SunOS'ified... */
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
 #define MAP_RENAME      MAP_ANONYMOUS   /* In SunOS terminology */
 #define MAP_NORESERVE   0x40            /* don't reserve swap pages */
 #define MAP_INHERIT     0x80            /* SunOS doesn't do this, but... */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
 #define MAP_EXECUTABLE 0x1000          /* mark it as an executable */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT     0x2000          /* lock all currently mapped pages */
 #define MCL_FUTURE      0x4000          /* lock all additions to address space */
 
 #define MC_LOCKAS       5  /* Lock an entire address space of the calling process */
 #define MC_UNLOCKAS     6  /* Unlock entire address space of calling process */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
 #define MADV_FREE      0x5             /* (Solaris) contents can be freed */
-#define MADV_REMOVE    0x6             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
 
 #endif /* __SPARC64_MMAN_H__ */
index c58ba8a096cf4579aa65f136c17ff0396dbdbdc6..a284986b154149578cf9f453fa453b374e730f24 100644 (file)
 #define __NR_mknodat           286
 #define __NR_fchownat          287
 #define __NR_futimesat         288
-#define __NR_newfstatat                289
+#define __NR_fstatat64         289
 #define __NR_unlinkat          290
 #define __NR_renameat          291
 #define __NR_linkat            292
index edc79965193aa589e6810b35903fb7262c404927..edbf6edbfb37d54537040dc656dc49bd74457b51 100644 (file)
@@ -1,18 +1,7 @@
 #ifndef __V850_MMAN_H__
 #define __V850_MMAN_H__
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
+#include <asm-generic/mman.h>
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_DENYWRITE  0x0800          /* ETXTBSY */
@@ -20,22 +9,7 @@
 #define MAP_LOCKED     0x2000          /* pages are locked */
 #define MAP_NORESERVE  0x4000          /* don't check for reservations */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif /* __V850_MMAN_H__ */
index c20c28f5c7a00aa017ff38ddc4f26c95dabd978d..08b75c15269ae1fcd01cb2457cddaca1477b239a 100644 (file)
@@ -55,6 +55,8 @@ extern int is_hpet_enabled(void);
 extern int hpet_rtc_timer_init(void);
 extern int oem_force_hpet_timer(void);
 
+extern int hpet_use_timer;
+
 #ifdef CONFIG_HPET_EMULATE_RTC
 extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask);
 extern int hpet_set_rtc_irq_bit(unsigned long bit_mask);
index 20468983d4532f54fbf994b4d323ccd924db132d..eeb2bcd635de610095baa83a210564777d72ad53 100644 (file)
 #define __NR_ia32_mknodat              297
 #define __NR_ia32_fchownat             298
 #define __NR_ia32_futimesat            299
-#define __NR_ia32_newfstatat           300
+#define __NR_ia32_fstatat64            300
 #define __NR_ia32_unlinkat             301
 #define __NR_ia32_renameat             302
 #define __NR_ia32_linkat               303
index d0e97b74f73591d0e430719f0861dc00dda1d224..dd5cb0534d377d700a7db58e67fa547a1722c70e 100644 (file)
@@ -1,19 +1,8 @@
 #ifndef __X8664_MMAN_H__
 #define __X8664_MMAN_H__
 
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_SEM       0x8
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
+#include <asm-generic/mman.h>
 
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping */
-#define MAP_FIXED      0x10            /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x20            /* don't use a file */
 #define MAP_32BIT      0x40            /* only give out 32bit addresses */
 
 #define MAP_GROWSDOWN  0x0100          /* stack-like segment */
 #define MAP_POPULATE   0x8000          /* populate (prefault) pagetables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
 
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_INVALIDATE  2               /* invalidate the caches */
-#define MS_SYNC                4               /* synchronous memory sync */
-
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
-
-/* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
-
 #endif
index 082a7504925ed5bebeda7b910b25de6bc58075c1..ba394cbb48071b03ddc789f21bf80fef84d50eb1 100644 (file)
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
 
-#define MADV_NORMAL    0x0             /* default page-in behavior */
-#define MADV_RANDOM    0x1             /* page-in minimum required */
-#define MADV_SEQUENTIAL        0x2             /* read-ahead aggressively */
-#define MADV_WILLNEED  0x3             /* pre-fault pages */
-#define MADV_DONTNEED  0x4             /* discard these pages */
-#define MADV_REMOVE    0x5             /* remove these pages & resources */
+#define MADV_NORMAL    0               /* no further special treatment */
+#define MADV_RANDOM    1               /* expect random page references */
+#define MADV_SEQUENTIAL        2               /* expect sequential page references */
+#define MADV_WILLNEED  3               /* will need these pages */
+#define MADV_DONTNEED  4               /* don't need these pages */
+
+/* common parameters: try to keep these consistent across architectures */
+#define MADV_REMOVE    9               /* remove these pages & resources */
+#define MADV_DONTFORK  10              /* don't inherit across fork */
+#define MADV_DOFORK    11              /* do inherit across fork */
 
 /* compatibility flags */
-#define MAP_ANON       MAP_ANONYMOUS
-#define MAP_FILE       0
+#define MAP_ANON       MAP_ANONYMOUS
+#define MAP_FILE       0
 
 #endif /* _XTENSA_MMAN_H */
index f9ca534787e24c1075a965843e87bddd9632e3a9..c9ab2a26348cd6ff058f82e33d448e2313655783 100644 (file)
@@ -161,5 +161,25 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from);
 int get_compat_sigevent(struct sigevent *event,
                const struct compat_sigevent __user *u_event);
 
+static inline int compat_timeval_compare(struct compat_timeval *lhs,
+                                       struct compat_timeval *rhs)
+{
+       if (lhs->tv_sec < rhs->tv_sec)
+               return -1;
+       if (lhs->tv_sec > rhs->tv_sec)
+               return 1;
+       return lhs->tv_usec - rhs->tv_usec;
+}
+
+static inline int compat_timespec_compare(struct compat_timespec *lhs,
+                                       struct compat_timespec *rhs)
+{
+       if (lhs->tv_sec < rhs->tv_sec)
+               return -1;
+       if (lhs->tv_sec > rhs->tv_sec)
+               return 1;
+       return lhs->tv_nsec - rhs->tv_nsec;
+}
+
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
index 20b446f26ecd445e75016b8cfdceed711d25dad0..60e56c6e03dd3ee6c4836031b88626eaba249b1e 100644 (file)
@@ -328,7 +328,7 @@ static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp,
  * bitmap of size NR_CPUS.
  *
  *  #ifdef CONFIG_HOTPLUG_CPU
- *     cpu_possible_map - all NR_CPUS bits set
+ *     cpu_possible_map - has bit 'cpu' set iff cpu is populatable
  *     cpu_present_map  - has bit 'cpu' set iff cpu is populated
  *     cpu_online_map   - has bit 'cpu' set iff cpu available to scheduler
  *  #else
index 0fe4aa891ddc1f1086493b65218b656ef8d9b7e1..41ee79962bb26c7dfc26dd7027de7abf59de3736 100644 (file)
@@ -497,12 +497,6 @@ struct transaction_s
         */
        struct journal_head     *t_checkpoint_list;
 
-       /*
-        * Doubly-linked circular list of all buffers submitted for IO while
-        * checkpointing. [j_list_lock]
-        */
-       struct journal_head     *t_checkpoint_io_list;
-
        /*
         * Doubly-linked circular list of temporary buffers currently undergoing
         * IO in the log [j_list_lock]
@@ -852,7 +846,7 @@ extern void journal_commit_transaction(journal_t *);
 
 /* Checkpoint list management */
 int __journal_clean_checkpoint_list(journal_t *journal);
-int __journal_remove_checkpoint(struct journal_head *);
+void __journal_remove_checkpoint(struct journal_head *);
 void __journal_insert_checkpoint(struct journal_head *, transaction_t *);
 
 /* Buffer IO */
index 3aed37314ab805de8fe3dcfec0a5282d7035cc54..e87c32a5c86a022dde6ccdfdf03a794ebc327627 100644 (file)
@@ -153,8 +153,10 @@ static inline void con_schedule_flip(struct tty_struct *t)
 {
        unsigned long flags;
        spin_lock_irqsave(&t->buf.lock, flags);
-       if (t->buf.tail != NULL)
+       if (t->buf.tail != NULL) {
                t->buf.tail->active = 0;
+               t->buf.tail->commit = t->buf.tail->used;
+       }
        spin_unlock_irqrestore(&t->buf.lock, flags);
        schedule_work(&t->buf.work);
 }
index a311f58c8a7cdeeb04ee09b53ba8bceb9b2f78cd..cfb3410e32b16cf1761de1d7b4512ae918ed0f50 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/list.h>
 #include <linux/linkage.h>
 #include <linux/compat.h>
+#include <linux/ioport.h>
 #include <asm/kexec.h>
 
 /* Verify architecture specific macros are defined */
index 6aca67a569a2ff907830ef64e6b69dafc154996c..f3dec45ef874d2d40ff883380201eb8d1e540f42 100644 (file)
@@ -96,10 +96,16 @@ static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
                ({ (ktime_t){ .tv64 = (kt).tv64 + (nsval) }; })
 
 /* convert a timespec to ktime_t format: */
-#define timespec_to_ktime(ts)          ktime_set((ts).tv_sec, (ts).tv_nsec)
+static inline ktime_t timespec_to_ktime(struct timespec ts)
+{
+       return ktime_set(ts.tv_sec, ts.tv_nsec);
+}
 
 /* convert a timeval to ktime_t format: */
-#define timeval_to_ktime(tv)           ktime_set((tv).tv_sec, (tv).tv_usec * 1000)
+static inline ktime_t timeval_to_ktime(struct timeval tv)
+{
+       return ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC);
+}
 
 /* Map the ktime_t to timespec conversion to ns_to_timespec function */
 #define ktime_to_timespec(kt)          ns_to_timespec((kt).tv64)
index 920766cea79cbc15634411e4c9633c27f6c8fd61..ef21ed296039dc87527c3eb777992851e0774bcf 100644 (file)
@@ -149,7 +149,7 @@ struct nlm_rqst * nlmclnt_alloc_call(void);
 int              nlmclnt_prepare_block(struct nlm_rqst *req, struct nlm_host *host, struct file_lock *fl);
 void             nlmclnt_finish_block(struct nlm_rqst *req);
 long             nlmclnt_block(struct nlm_rqst *req, long timeout);
-u32              nlmclnt_grant(struct nlm_lock *);
+u32              nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *);
 void             nlmclnt_recovery(struct nlm_host *, u32);
 int              nlmclnt_reclaim(struct nlm_host *, struct file_lock *);
 int              nlmclnt_setgrantargs(struct nlm_rqst *, struct nlm_lock *);
@@ -204,7 +204,7 @@ nlmsvc_file_inode(struct nlm_file *file)
  * Compare two host addresses (needs modifying for ipv6)
  */
 static __inline__ int
-nlm_cmp_addr(struct sockaddr_in *sin1, struct sockaddr_in *sin2)
+nlm_cmp_addr(const struct sockaddr_in *sin1, const struct sockaddr_in *sin2)
 {
        return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr;
 }
@@ -214,7 +214,7 @@ nlm_cmp_addr(struct sockaddr_in *sin1, struct sockaddr_in *sin2)
  * When the second lock is of type F_UNLCK, this acts like a wildcard.
  */
 static __inline__ int
-nlm_compare_locks(struct file_lock *fl1, struct file_lock *fl2)
+nlm_compare_locks(const struct file_lock *fl1, const struct file_lock *fl2)
 {
        return  fl1->fl_pid   == fl2->fl_pid
             && fl1->fl_start == fl2->fl_start
index 4cf6088625c1c6d9bb3c70a3fa820c854e0bae4e..4688969398434d51135817b7fde491d36684817f 100644 (file)
@@ -184,8 +184,11 @@ static inline int nf_hook_thresh(int pf, unsigned int hook,
                                 struct sk_buff **pskb,
                                 struct net_device *indev,
                                 struct net_device *outdev,
-                                int (*okfn)(struct sk_buff *), int thresh)
+                                int (*okfn)(struct sk_buff *), int thresh,
+                                int cond)
 {
+       if (!cond)
+               return 1;
 #ifndef CONFIG_NETFILTER_DEBUG
        if (list_empty(&nf_hooks[pf][hook]))
                return 1;
@@ -197,7 +200,7 @@ static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb,
                          struct net_device *indev, struct net_device *outdev,
                          int (*okfn)(struct sk_buff *))
 {
-       return nf_hook_thresh(pf, hook, pskb, indev, outdev, okfn, INT_MIN);
+       return nf_hook_thresh(pf, hook, pskb, indev, outdev, okfn, INT_MIN, 1);
 }
                    
 /* Activate hook; either okfn or kfree_skb called, unless a hook
@@ -224,7 +227,13 @@ static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb,
 
 #define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh)            \
 ({int __ret;                                                                  \
-if ((__ret=nf_hook_thresh(pf, hook, &(skb), indev, outdev, okfn, thresh)) == 1)\
+if ((__ret=nf_hook_thresh(pf, hook, &(skb), indev, outdev, okfn, thresh, 1)) == 1)\
+       __ret = (okfn)(skb);                                                   \
+__ret;})
+
+#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond)                \
+({int __ret;                                                                  \
+if ((__ret=nf_hook_thresh(pf, hook, &(skb), indev, outdev, okfn, INT_MIN, cond)) == 1)\
        __ret = (okfn)(skb);                                                   \
 __ret;})
 
@@ -295,11 +304,13 @@ extern struct proc_dir_entry *proc_net_netfilter;
 
 #else /* !CONFIG_NETFILTER */
 #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb)
+#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb)
 static inline int nf_hook_thresh(int pf, unsigned int hook,
                                 struct sk_buff **pskb,
                                 struct net_device *indev,
                                 struct net_device *outdev,
-                                int (*okfn)(struct sk_buff *), int thresh)
+                                int (*okfn)(struct sk_buff *), int thresh,
+                                int cond)
 {
        return okfn(*pskb);
 }
@@ -307,7 +318,7 @@ static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb,
                          struct net_device *indev, struct net_device *outdev,
                          int (*okfn)(struct sk_buff *))
 {
-       return okfn(*pskb);
+       return 1;
 }
 static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
 struct flowi;
index fdc4a95273439edd826eb928e0207420db4ea373..43c09d790b838151aba69d891638801a57e1e9d0 100644 (file)
@@ -79,7 +79,7 @@ enum nf_ip_hook_priorities {
 
 #ifdef __KERNEL__
 extern int ip_route_me_harder(struct sk_buff **pskb);
-
+extern int ip_xfrm_me_harder(struct sk_buff **pskb);
 #endif /*__KERNEL__*/
 
 #endif /*__LINUX_IP_NETFILTER_H*/
index 6a2ccf78a3564025947dc5f06236155d67351677..c256ebe2a7b448ffae662ee78dab5acc62ace0e1 100644 (file)
@@ -160,7 +160,8 @@ extern int netlink_unregister_notifier(struct notifier_block *nb);
 
 /* finegrained unicast helpers: */
 struct sock *netlink_getsockbyfilp(struct file *filp);
-int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo);
+int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
+               long timeo, struct sock *ssk);
 void netlink_detachskb(struct sock *sk, struct sk_buff *skb);
 int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol);
 
index 7a61ccdcbc4bcb98aae1ca93f00227541dabdf4e..82b83da25d77c9535d849e454ae2d372baeafc6e 100644 (file)
 #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440_8X 0x0181
 #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440SE_8X 0x0182
 #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420_8X 0x0183
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_4000   0x0185
 #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_448_GO    0x0186
 #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_488_GO    0x0187
 #define PCI_DEVICE_ID_NVIDIA_QUADRO4_580_XGL    0x0188
index 9d5cd106b344bc7a316bfb712cbc9509a8920075..0d36750fc0f10954cad808cb863183cf5e0265cd 100644 (file)
@@ -84,6 +84,7 @@ extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __us
 extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);
 extern int ptrace_attach(struct task_struct *tsk);
 extern int ptrace_detach(struct task_struct *, unsigned int);
+extern void __ptrace_detach(struct task_struct *, unsigned int);
 extern void ptrace_disable(struct task_struct *);
 extern int ptrace_check_attach(struct task_struct *task, int kill);
 extern int ptrace_request(struct task_struct *child, long request, long addr, long data);
index 0cfcd1c7865ed391c2e655a0d18dc9a74514c627..b6f51e3a38ecdf990b018f38344afefa0a0110cc 100644 (file)
@@ -697,11 +697,8 @@ struct task_struct {
 
        int lock_depth;         /* BKL lock depth */
 
-#if defined(CONFIG_SMP)
-       int last_waker_cpu;     /* CPU that last woke this task up */
-#if defined(__ARCH_WANT_UNLOCKED_CTXSW)
+#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)
        int oncpu;
-#endif
 #endif
        int prio, static_prio;
        struct list_head run_list;
@@ -1098,7 +1095,7 @@ extern struct sigqueue *sigqueue_alloc(void);
 extern void sigqueue_free(struct sigqueue *);
 extern int send_sigqueue(int, struct sigqueue *,  struct task_struct *);
 extern int send_group_sigqueue(int, struct sigqueue *,  struct task_struct *);
-extern int do_sigaction(int, const struct k_sigaction *, struct k_sigaction *);
+extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);
 extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long);
 
 /* These can be the second arg to send_sig_info/send_group_sig_info.  */
index 3877209d23c35e27cd9e07355edf71b1bf1670c4..d73501ba7e441ac7496f3cbf110c9cb95c718495 100644 (file)
@@ -557,6 +557,8 @@ asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
                           int mode);
 asmlinkage long sys_newfstatat(int dfd, char __user *filename,
                               struct stat __user *statbuf, int flag);
+asmlinkage long sys_fstatat64(int dfd, char __user *filename,
+                              struct stat64 __user *statbuf, int flag);
 asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf,
                               int bufsiz);
 asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename,
index 7b4dc36532bb192a1689dc84fb6da7fa97ab8dd7..d9cdba54b7893196297d49d3c2dd787270d5d272 100644 (file)
@@ -33,11 +33,34 @@ struct timezone {
 #define NSEC_PER_SEC           1000000000L
 #define NSEC_PER_USEC          1000L
 
-static __inline__ int timespec_equal(struct timespec *a, struct timespec *b)
+static inline int timespec_equal(struct timespec *a, struct timespec *b)
 {
        return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec);
 }
 
+/*
+ * lhs < rhs:  return <0
+ * lhs == rhs: return 0
+ * lhs > rhs:  return >0
+ */
+static inline int timespec_compare(struct timespec *lhs, struct timespec *rhs)
+{
+       if (lhs->tv_sec < rhs->tv_sec)
+               return -1;
+       if (lhs->tv_sec > rhs->tv_sec)
+               return 1;
+       return lhs->tv_nsec - rhs->tv_nsec;
+}
+
+static inline int timeval_compare(struct timeval *lhs, struct timeval *rhs)
+{
+       if (lhs->tv_sec < rhs->tv_sec)
+               return -1;
+       if (lhs->tv_sec > rhs->tv_sec)
+               return 1;
+       return lhs->tv_usec - rhs->tv_usec;
+}
+
 extern unsigned long mktime(const unsigned int year, const unsigned int mon,
                            const unsigned int day, const unsigned int hour,
                            const unsigned int min, const unsigned int sec);
index a7bd3b4558d26efaa3ed8dae0b5bb53f0d184cab..f45cd74e6f243da99e34deac005b53cf9232c188 100644 (file)
@@ -58,6 +58,8 @@ struct tty_buffer {
        int used;
        int size;
        int active;
+       int commit;
+       int read;
        /* Data points here */
        unsigned long data[0];
 };
index 82961eb1988861a08c6c459d3d095a1535bf52fb..222faf97d5f9cbdabb6f8bced55f62fc3a7617cd 100644 (file)
@@ -29,8 +29,10 @@ _INLINE_ void tty_schedule_flip(struct tty_struct *tty)
 {
        unsigned long flags;
        spin_lock_irqsave(&tty->buf.lock, flags);
-       if (tty->buf.tail != NULL)
+       if (tty->buf.tail != NULL) {
                tty->buf.tail->active = 0;
+               tty->buf.tail->commit = tty->buf.tail->used;
+       }
        spin_unlock_irqrestore(&tty->buf.lock, flags);
        schedule_delayed_work(&tty->buf.work, 1);
 }
index bbfac86734ec44f50b34efaf5067498c8080a3dc..89d743cfdfdfdd107d315331d37d5650305e52ad 100644 (file)
@@ -33,7 +33,7 @@
 #define RFCOMM_DEFAULT_MTU     127
 #define RFCOMM_DEFAULT_CREDITS 7
 
-#define RFCOMM_MAX_L2CAP_MTU   1024
+#define RFCOMM_MAX_L2CAP_MTU   1013
 #define RFCOMM_MAX_CREDITS     40
 
 #define RFCOMM_SKB_HEAD_RESERVE        8
index 8de0697b364c9853592657d6b6d62a244ede011b..fab3d5b3ab1c34fbb1feca0f67c2391b17d02cbe 100644 (file)
@@ -41,6 +41,7 @@ struct inet_skb_parm
 #define IPSKB_XFRM_TUNNEL_SIZE 2
 #define IPSKB_XFRM_TRANSFORMED 4
 #define IPSKB_FRAG_COMPLETE    8
+#define IPSKB_REROUTED         16
 };
 
 struct ipcm_cookie
index 05a840837fe7b48ddf375bffecab74f1ba6d6e8e..1880e46ecc9b0774de64e867f4f4cb7e8388eff6 100644 (file)
@@ -82,9 +82,9 @@ do { if(!(expr)) { \
 #define IRDA_ASSERT_LABEL(label)
 #endif /* CONFIG_IRDA_DEBUG */
 
-#define IRDA_WARNING(args...) printk(KERN_WARNING args)
-#define IRDA_MESSAGE(args...) printk(KERN_INFO args)
-#define IRDA_ERROR(args...)   printk(KERN_ERR args)
+#define IRDA_WARNING(args...) do { if (net_ratelimit()) printk(KERN_WARNING args); } while (0)
+#define IRDA_MESSAGE(args...) do { if (net_ratelimit()) printk(KERN_INFO args); } while (0)
+#define IRDA_ERROR(args...)   do { if (net_ratelimit()) printk(KERN_ERR args); } while (0)
 
 /*
  *  Magic numbers used by Linux-IrDA. Random numbers which must be unique to 
index f55e86e75030e1b4170bf033f8b68d5bb8809fcc..2127cae1e0a68d9818daa7c05a368d7b1c2e4b7b 100644 (file)
@@ -50,6 +50,9 @@
 /* May be different when we get VFIR */
 #define LAP_MAX_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER)
 
+/* Each IrDA device gets a random 32 bits IRLAP device address */
+#define LAP_ALEN 4
+
 #define BROADCAST  0xffffffff /* Broadcast device address */
 #define CBROADCAST 0xfe       /* Connection broadcast address */
 #define XID_FORMAT 0x01       /* Discovery XID format */
index d09ca0e7d139632f92ae49c7c46f82d4bfce2795..d6111a2f0a23d07bb25afe53e3806594f538f02d 100644 (file)
@@ -866,7 +866,6 @@ extern int xfrm_state_mtu(struct xfrm_state *x, int mtu);
 extern int xfrm_init_state(struct xfrm_state *x);
 extern int xfrm4_rcv(struct sk_buff *skb);
 extern int xfrm4_output(struct sk_buff *skb);
-extern int xfrm4_output_finish(struct sk_buff *skb);
 extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler);
 extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler);
 extern int xfrm6_rcv_spi(struct sk_buff **pskb, u32 spi);
index 3e5cb5ab2d34c54cd997f672190907a3e38bdd41..e5618b90996e9a4c4e9eba4e06d105c8674e55bd 100644 (file)
@@ -163,9 +163,6 @@ enum iscsi_param {
 };
 #define ISCSI_PARAM_MAX                        14
 
-typedef uint64_t iscsi_sessionh_t;     /* iSCSI Data-Path session handle */
-typedef uint64_t iscsi_connh_t;                /* iSCSI Data-Path connection handle */
-
 #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle)
 #define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr)
 #define hostdata_session(_hostdata) (iscsi_ptr(*(unsigned long *)_hostdata))
index c60b8ff2f5e4f5d7a2952a8fb0951a689ec451b1..9c331258bc27a3792fdd90b23470e39cc168457d 100644 (file)
@@ -433,4 +433,6 @@ struct scsi_lun {
 /* Used to obtain the PCI location of a device */
 #define SCSI_IOCTL_GET_PCI             0x5387
 
+int scsi_execute_in_process_context(void (*fn)(void *data), void *data);
+
 #endif /* _SCSI_SCSI_H */
index 16602a547a630a0d1ffd9e7e95b3b45e9288ae19..b41cf077e54b7c327e07d8675036ae707bb2314f 100644 (file)
@@ -63,25 +63,28 @@ struct iscsi_transport {
        int max_lun;
        unsigned int max_conn;
        unsigned int max_cmd_len;
-       struct Scsi_Host *(*create_session) (struct scsi_transport_template *t,
-                                            uint32_t initial_cmdsn);
-       void (*destroy_session) (struct Scsi_Host *shost);
-       struct iscsi_cls_conn *(*create_conn) (struct Scsi_Host *shost,
+       struct iscsi_cls_session *(*create_session)
+               (struct scsi_transport_template *t, uint32_t sn, uint32_t *sid);
+       void (*destroy_session) (struct iscsi_cls_session *session);
+       struct iscsi_cls_conn *(*create_conn) (struct iscsi_cls_session *sess,
                                uint32_t cid);
-       int (*bind_conn) (iscsi_sessionh_t session, iscsi_connh_t conn,
+       int (*bind_conn) (struct iscsi_cls_session *session,
+                         struct iscsi_cls_conn *cls_conn,
                          uint32_t transport_fd, int is_leading);
-       int (*start_conn) (iscsi_connh_t conn);
-       void (*stop_conn) (iscsi_connh_t conn, int flag);
+       int (*start_conn) (struct iscsi_cls_conn *conn);
+       void (*stop_conn) (struct iscsi_cls_conn *conn, int flag);
        void (*destroy_conn) (struct iscsi_cls_conn *conn);
-       int (*set_param) (iscsi_connh_t conn, enum iscsi_param param,
+       int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param,
                          uint32_t value);
-       int (*get_conn_param) (void *conndata, enum iscsi_param param,
+       int (*get_conn_param) (struct iscsi_cls_conn *conn,
+                              enum iscsi_param param,
                               uint32_t *value);
-       int (*get_session_param) (struct Scsi_Host *shost,
+       int (*get_session_param) (struct iscsi_cls_session *session,
                                  enum iscsi_param param, uint32_t *value);
-       int (*send_pdu) (iscsi_connh_t conn, struct iscsi_hdr *hdr,
+       int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
                         char *data, uint32_t data_size);
-       void (*get_stats) (iscsi_connh_t conn, struct iscsi_stats *stats);
+       void (*get_stats) (struct iscsi_cls_conn *conn,
+                          struct iscsi_stats *stats);
 };
 
 /*
@@ -93,15 +96,14 @@ extern int iscsi_unregister_transport(struct iscsi_transport *tt);
 /*
  * control plane upcalls
  */
-extern void iscsi_conn_error(iscsi_connh_t conn, enum iscsi_err error);
-extern int iscsi_recv_pdu(iscsi_connh_t conn, struct iscsi_hdr *hdr,
+extern void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error);
+extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
                          char *data, uint32_t data_size);
 
 struct iscsi_cls_conn {
        struct list_head conn_list;     /* item in connlist */
        void *dd_data;                  /* LLD private data */
        struct iscsi_transport *transport;
-       iscsi_connh_t connh;
        int active;                     /* must be accessed with the connlock */
        struct device dev;              /* sysfs transport/container device */
        struct mempool_zone *z_error;
@@ -113,7 +115,7 @@ struct iscsi_cls_conn {
        container_of(_dev, struct iscsi_cls_conn, dev)
 
 struct iscsi_cls_session {
-       struct list_head list;  /* item in session_list */
+       struct list_head sess_list;             /* item in session_list */
        struct iscsi_transport *transport;
        struct device dev;      /* sysfs transport/container device */
 };
index 1d69049bd4c196ee13ab3e7a6439d20d5cf47008..78b1f15a538fc69a0aaf2f94c11a400d5ad2193d 100644 (file)
@@ -159,6 +159,7 @@ struct neofb_par {
        unsigned char PanelDispCntlReg1;
        unsigned char PanelDispCntlReg2;
        unsigned char PanelDispCntlReg3;
+       unsigned char PanelDispCntlRegRead;
        unsigned char PanelVertCenterReg1;
        unsigned char PanelVertCenterReg2;
        unsigned char PanelVertCenterReg3;
index 0c5d9a3f951baea7efa88f37683641e7efc3a978..637344b059813c7554a1acff0af67291b2272ca8 100644 (file)
@@ -466,10 +466,32 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only)
 extern char __initramfs_start[], __initramfs_end[];
 #ifdef CONFIG_BLK_DEV_INITRD
 #include <linux/initrd.h>
+#include <linux/kexec.h>
 
 static void __init free_initrd(void)
 {
-       free_initrd_mem(initrd_start, initrd_end);
+#ifdef CONFIG_KEXEC
+       unsigned long crashk_start = (unsigned long)__va(crashk_res.start);
+       unsigned long crashk_end   = (unsigned long)__va(crashk_res.end);
+
+       /*
+        * If the initrd region is overlapped with crashkernel reserved region,
+        * free only memory that is not part of crashkernel region.
+        */
+       if (initrd_start < crashk_end && initrd_end > crashk_start) {
+               /*
+                * Initialize initrd memory region since the kexec boot does
+                * not do.
+                */
+               memset((void *)initrd_start, 0, initrd_end - initrd_start);
+               if (initrd_start < crashk_start)
+                       free_initrd_mem(initrd_start, crashk_start);
+               if (initrd_end > crashk_end)
+                       free_initrd_mem(crashk_end, initrd_end);
+       } else
+#endif
+               free_initrd_mem(initrd_start, initrd_end);
+
        initrd_start = 0;
        initrd_end = 0;
 }
index 7c79da57d3a29fd665042e5747e88bca78409aca..4c194c47395f9b7c06fc4dd713d920eadcd2f757 100644 (file)
@@ -668,7 +668,6 @@ static int init(void * unused)
         */
        child_reaper = current;
 
-       /* Sets up cpus_possible() */
        smp_prepare_cpus(max_cpus);
 
        do_pre_smp_initcalls();
index 59302fc3643b9243889946661249ab31d5f66d6f..fd2e26b6f96619fa88d93ed6b4437a257971a52f 100644 (file)
@@ -1018,7 +1018,8 @@ retry:
                                goto out;
                        }
 
-                       ret = netlink_attachskb(sock, nc, 0, MAX_SCHEDULE_TIMEOUT);
+                       ret = netlink_attachskb(sock, nc, 0,
+                                       MAX_SCHEDULE_TIMEOUT, NULL);
                        if (ret == 1)
                                goto retry;
                        if (ret) {
index 4c28d2d8e305cca5781f02117b55e9b21922bdd0..9162123a7b23c348aca8669c56ea56bfbeacadb6 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -870,6 +870,7 @@ asmlinkage long sys_shmdt(char __user *shmaddr)
         * could possibly have landed at. Also cast things to loff_t to
         * prevent overflows and make comparisions vs. equal-width types.
         */
+       size = PAGE_ALIGN(size);
        while (vma && (loff_t)(vma->vm_end - addr) <= size) {
                next = vma->vm_next;
 
index ba42b0a76961f8eb3b667bf4a059405e3b9f52cf..12815d3f1a05ee25efc0eb489ff9c6abc4e4cb98 100644 (file)
@@ -1977,6 +1977,39 @@ void cpuset_fork(struct task_struct *child)
  * We don't need to task_lock() this reference to tsk->cpuset,
  * because tsk is already marked PF_EXITING, so attach_task() won't
  * mess with it, or task is a failed fork, never visible to attach_task.
+ *
+ * Hack:
+ *
+ *    Set the exiting tasks cpuset to the root cpuset (top_cpuset).
+ *
+ *    Don't leave a task unable to allocate memory, as that is an
+ *    accident waiting to happen should someone add a callout in
+ *    do_exit() after the cpuset_exit() call that might allocate.
+ *    If a task tries to allocate memory with an invalid cpuset,
+ *    it will oops in cpuset_update_task_memory_state().
+ *
+ *    We call cpuset_exit() while the task is still competent to
+ *    handle notify_on_release(), then leave the task attached to
+ *    the root cpuset (top_cpuset) for the remainder of its exit.
+ *
+ *    To do this properly, we would increment the reference count on
+ *    top_cpuset, and near the very end of the kernel/exit.c do_exit()
+ *    code we would add a second cpuset function call, to drop that
+ *    reference.  This would just create an unnecessary hot spot on
+ *    the top_cpuset reference count, to no avail.
+ *
+ *    Normally, holding a reference to a cpuset without bumping its
+ *    count is unsafe.   The cpuset could go away, or someone could
+ *    attach us to a different cpuset, decrementing the count on
+ *    the first cpuset that we never incremented.  But in this case,
+ *    top_cpuset isn't going away, and either task has PF_EXITING set,
+ *    which wards off any attach_task() attempts, or task is a failed
+ *    fork, never visible to attach_task.
+ *
+ *    Another way to do this would be to set the cpuset pointer
+ *    to NULL here, and check in cpuset_update_task_memory_state()
+ *    for a NULL pointer.  This hack avoids that NULL check, for no
+ *    cost (other than this way too long comment ;).
  **/
 
 void cpuset_exit(struct task_struct *tsk)
@@ -1984,7 +2017,7 @@ void cpuset_exit(struct task_struct *tsk)
        struct cpuset *cs;
 
        cs = tsk->cpuset;
-       tsk->cpuset = NULL;
+       tsk->cpuset = &top_cpuset;      /* Hack - see comment above */
 
        if (notify_on_release(cs)) {
                char *pathbuf = NULL;
index 8e88b374cee90b646234d7cfa64b108c8ab9bbe2..fbea12d7a94378105bfa728b4c9d6e98d07d2bf3 100644 (file)
@@ -1123,8 +1123,8 @@ static task_t *copy_process(unsigned long clone_flags,
                p->real_parent = current;
        p->parent = p->real_parent;
 
+       spin_lock(&current->sighand->siglock);
        if (clone_flags & CLONE_THREAD) {
-               spin_lock(&current->sighand->siglock);
                /*
                 * Important: if an exit-all has been started then
                 * do not create this new thread - the whole thread
@@ -1162,8 +1162,6 @@ static task_t *copy_process(unsigned long clone_flags,
                         */
                        p->it_prof_expires = jiffies_to_cputime(1);
                }
-
-               spin_unlock(&current->sighand->siglock);
        }
 
        /*
@@ -1175,8 +1173,6 @@ static task_t *copy_process(unsigned long clone_flags,
        if (unlikely(p->ptrace & PT_PTRACED))
                __ptrace_link(p, current->parent);
 
-       attach_pid(p, PIDTYPE_PID, p->pid);
-       attach_pid(p, PIDTYPE_TGID, p->tgid);
        if (thread_group_leader(p)) {
                p->signal->tty = current->signal->tty;
                p->signal->pgrp = process_group(current);
@@ -1186,9 +1182,12 @@ static task_t *copy_process(unsigned long clone_flags,
                if (p->pid)
                        __get_cpu_var(process_counts)++;
        }
+       attach_pid(p, PIDTYPE_TGID, p->tgid);
+       attach_pid(p, PIDTYPE_PID, p->pid);
 
        nr_threads++;
        total_forks++;
+       spin_unlock(&current->sighand->siglock);
        write_unlock_irq(&tasklist_lock);
        proc_fork_connector(p);
        return p;
index 2b6e1757aeddf118f43c31111f46224b00f5d25e..5ae51f1bc7c80347d091bd4da0df2e8840c0bae4 100644 (file)
@@ -418,8 +418,19 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
        /* Switch the timer base, if necessary: */
        new_base = switch_hrtimer_base(timer, base);
 
-       if (mode == HRTIMER_REL)
+       if (mode == HRTIMER_REL) {
                tim = ktime_add(tim, new_base->get_time());
+               /*
+                * CONFIG_TIME_LOW_RES is a temporary way for architectures
+                * to signal that they simply return xtime in
+                * do_gettimeoffset(). In this case we want to round up by
+                * resolution when starting a relative timer, to avoid short
+                * timeouts. This will go away with the GTOD framework.
+                */
+#ifdef CONFIG_TIME_LOW_RES
+               tim = ktime_add(tim, base->resolution);
+#endif
+       }
        timer->expires = tim;
 
        enqueue_hrtimer(timer, new_base);
index c5c4ab255834e5760715e3f7ce4871a2a943245e..126dc43f1c744a4d46e6e8d20610ac9f54744877 100644 (file)
@@ -130,6 +130,7 @@ NORET_TYPE void panic(const char * fmt, ...)
 #endif
        local_irq_enable();
        for (i = 0;;) {
+               touch_softlockup_watchdog();
                i += panic_blink(i);
                mdelay(1);
                i++;
index 41f66365f0d85daa0c772430ff9872c0395030aa..8d5a5986d6213919e991835d8a4fcc7ecaaf018d 100644 (file)
@@ -91,10 +91,8 @@ static int save_highmem_zone(struct zone *zone)
                 * corrected eventually when the cases giving rise to this
                 * are better understood.
                 */
-               if (PageReserved(page)) {
-                       printk("highmem reserved page?!\n");
+               if (PageReserved(page))
                        continue;
-               }
                BUG_ON(PageNosave(page));
                if (PageNosaveFree(page))
                        continue;
index 5f33cdb6fff5f7e629842a8bee7865bb2607515c..d95a72c9279dc2e1110d31c0dadacc39b30b198f 100644 (file)
@@ -72,8 +72,8 @@ void ptrace_untrace(task_t *child)
  */
 void __ptrace_unlink(task_t *child)
 {
-       if (!child->ptrace)
-               BUG();
+       BUG_ON(!child->ptrace);
+
        child->ptrace = 0;
        if (!list_empty(&child->ptrace_list)) {
                list_del_init(&child->ptrace_list);
@@ -184,22 +184,27 @@ bad:
        return retval;
 }
 
+void __ptrace_detach(struct task_struct *child, unsigned int data)
+{
+       child->exit_code = data;
+       /* .. re-parent .. */
+       __ptrace_unlink(child);
+       /* .. and wake it up. */
+       if (child->exit_state != EXIT_ZOMBIE)
+               wake_up_process(child);
+}
+
 int ptrace_detach(struct task_struct *child, unsigned int data)
 {
        if (!valid_signal(data))
-               return  -EIO;
+               return -EIO;
 
        /* Architecture-specific hardware disable .. */
        ptrace_disable(child);
 
-       /* .. re-parent .. */
-       child->exit_code = data;
-
        write_lock_irq(&tasklist_lock);
-       __ptrace_unlink(child);
-       /* .. and wake it up. */
-       if (child->exit_state != EXIT_ZOMBIE)
-               wake_up_process(child);
+       if (child->ptrace)
+               __ptrace_detach(child, data);
        write_unlock_irq(&tasklist_lock);
 
        return 0;
@@ -242,8 +247,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
                if (write) {
                        copy_to_user_page(vma, page, addr,
                                          maddr + offset, buf, bytes);
-                       if (!PageCompound(page))
-                               set_page_dirty_lock(page);
+                       set_page_dirty_lock(page);
                } else {
                        copy_from_user_page(vma, page, addr,
                                            buf, maddr + offset, bytes);
index bc38804e40ddf72954695470ae50fb3a5c0b82a9..66d957227de9c847953961224828eff723e71057 100644 (file)
@@ -215,7 +215,6 @@ struct runqueue {
         */
        unsigned long nr_running;
 #ifdef CONFIG_SMP
-       unsigned long prio_bias;
        unsigned long cpu_load[3];
 #endif
        unsigned long long nr_switches;
@@ -669,68 +668,13 @@ static int effective_prio(task_t *p)
        return prio;
 }
 
-#ifdef CONFIG_SMP
-static inline void inc_prio_bias(runqueue_t *rq, int prio)
-{
-       rq->prio_bias += MAX_PRIO - prio;
-}
-
-static inline void dec_prio_bias(runqueue_t *rq, int prio)
-{
-       rq->prio_bias -= MAX_PRIO - prio;
-}
-
-static inline void inc_nr_running(task_t *p, runqueue_t *rq)
-{
-       rq->nr_running++;
-       if (rt_task(p)) {
-               if (p != rq->migration_thread)
-                       /*
-                        * The migration thread does the actual balancing. Do
-                        * not bias by its priority as the ultra high priority
-                        * will skew balancing adversely.
-                        */
-                       inc_prio_bias(rq, p->prio);
-       } else
-               inc_prio_bias(rq, p->static_prio);
-}
-
-static inline void dec_nr_running(task_t *p, runqueue_t *rq)
-{
-       rq->nr_running--;
-       if (rt_task(p)) {
-               if (p != rq->migration_thread)
-                       dec_prio_bias(rq, p->prio);
-       } else
-               dec_prio_bias(rq, p->static_prio);
-}
-#else
-static inline void inc_prio_bias(runqueue_t *rq, int prio)
-{
-}
-
-static inline void dec_prio_bias(runqueue_t *rq, int prio)
-{
-}
-
-static inline void inc_nr_running(task_t *p, runqueue_t *rq)
-{
-       rq->nr_running++;
-}
-
-static inline void dec_nr_running(task_t *p, runqueue_t *rq)
-{
-       rq->nr_running--;
-}
-#endif
-
 /*
  * __activate_task - move a task to the runqueue.
  */
 static inline void __activate_task(task_t *p, runqueue_t *rq)
 {
        enqueue_task(p, rq->active);
-       inc_nr_running(p, rq);
+       rq->nr_running++;
 }
 
 /*
@@ -739,7 +683,7 @@ static inline void __activate_task(task_t *p, runqueue_t *rq)
 static inline void __activate_idle_task(task_t *p, runqueue_t *rq)
 {
        enqueue_task_head(p, rq->active);
-       inc_nr_running(p, rq);
+       rq->nr_running++;
 }
 
 static int recalc_task_prio(task_t *p, unsigned long long now)
@@ -863,7 +807,7 @@ static void activate_task(task_t *p, runqueue_t *rq, int local)
  */
 static void deactivate_task(struct task_struct *p, runqueue_t *rq)
 {
-       dec_nr_running(p, rq);
+       rq->nr_running--;
        dequeue_task(p, p->array);
        p->array = NULL;
 }
@@ -1007,61 +951,27 @@ void kick_process(task_t *p)
  * We want to under-estimate the load of migration sources, to
  * balance conservatively.
  */
-static unsigned long __source_load(int cpu, int type, enum idle_type idle)
+static inline unsigned long source_load(int cpu, int type)
 {
        runqueue_t *rq = cpu_rq(cpu);
-       unsigned long running = rq->nr_running;
-       unsigned long source_load, cpu_load = rq->cpu_load[type-1],
-               load_now = running * SCHED_LOAD_SCALE;
-
+       unsigned long load_now = rq->nr_running * SCHED_LOAD_SCALE;
        if (type == 0)
-               source_load = load_now;
-       else
-               source_load = min(cpu_load, load_now);
+               return load_now;
 
-       if (running > 1 || (idle == NOT_IDLE && running))
-               /*
-                * If we are busy rebalancing the load is biased by
-                * priority to create 'nice' support across cpus. When
-                * idle rebalancing we should only bias the source_load if
-                * there is more than one task running on that queue to
-                * prevent idle rebalance from trying to pull tasks from a
-                * queue with only one running task.
-                */
-               source_load = source_load * rq->prio_bias / running;
-
-       return source_load;
-}
-
-static inline unsigned long source_load(int cpu, int type)
-{
-       return __source_load(cpu, type, NOT_IDLE);
+       return min(rq->cpu_load[type-1], load_now);
 }
 
 /*
  * Return a high guess at the load of a migration-target cpu
  */
-static inline unsigned long __target_load(int cpu, int type, enum idle_type idle)
+static inline unsigned long target_load(int cpu, int type)
 {
        runqueue_t *rq = cpu_rq(cpu);
-       unsigned long running = rq->nr_running;
-       unsigned long target_load, cpu_load = rq->cpu_load[type-1],
-               load_now = running * SCHED_LOAD_SCALE;
-
+       unsigned long load_now = rq->nr_running * SCHED_LOAD_SCALE;
        if (type == 0)
-               target_load = load_now;
-       else
-               target_load = max(cpu_load, load_now);
-
-       if (running > 1 || (idle == NOT_IDLE && running))
-               target_load = target_load * rq->prio_bias / running;
+               return load_now;
 
-       return target_load;
-}
-
-static inline unsigned long target_load(int cpu, int type)
-{
-       return __target_load(cpu, type, NOT_IDLE);
+       return max(rq->cpu_load[type-1], load_now);
 }
 
 /*
@@ -1294,9 +1204,6 @@ static int try_to_wake_up(task_t *p, unsigned int state, int sync)
                }
        }
 
-       if (p->last_waker_cpu != this_cpu)
-               goto out_set_cpu;
-
        if (unlikely(!cpu_isset(this_cpu, p->cpus_allowed)))
                goto out_set_cpu;
 
@@ -1367,8 +1274,6 @@ out_set_cpu:
                cpu = task_cpu(p);
        }
 
-       p->last_waker_cpu = this_cpu;
-
 out_activate:
 #endif /* CONFIG_SMP */
        if (old_state == TASK_UNINTERRUPTIBLE) {
@@ -1450,12 +1355,9 @@ void fastcall sched_fork(task_t *p, int clone_flags)
 #ifdef CONFIG_SCHEDSTATS
        memset(&p->sched_info, 0, sizeof(p->sched_info));
 #endif
-#if defined(CONFIG_SMP)
-       p->last_waker_cpu = cpu;
-#if defined(__ARCH_WANT_UNLOCKED_CTXSW)
+#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)
        p->oncpu = 0;
 #endif
-#endif
 #ifdef CONFIG_PREEMPT
        /* Want to start with kernel preemption disabled. */
        task_thread_info(p)->preempt_count = 1;
@@ -1530,7 +1432,7 @@ void fastcall wake_up_new_task(task_t *p, unsigned long clone_flags)
                                list_add_tail(&p->run_list, &current->run_list);
                                p->array = current->array;
                                p->array->nr_active++;
-                               inc_nr_running(p, rq);
+                               rq->nr_running++;
                        }
                        set_need_resched();
                } else
@@ -1875,9 +1777,9 @@ void pull_task(runqueue_t *src_rq, prio_array_t *src_array, task_t *p,
               runqueue_t *this_rq, prio_array_t *this_array, int this_cpu)
 {
        dequeue_task(p, src_array);
-       dec_nr_running(p, src_rq);
+       src_rq->nr_running--;
        set_task_cpu(p, this_cpu);
-       inc_nr_running(p, this_rq);
+       this_rq->nr_running++;
        enqueue_task(p, this_array);
        p->timestamp = (p->timestamp - src_rq->timestamp_last_tick)
                                + this_rq->timestamp_last_tick;
@@ -2056,9 +1958,9 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
 
                        /* Bias balancing toward cpus of our domain */
                        if (local_group)
-                               load = __target_load(i, load_idx, idle);
+                               load = target_load(i, load_idx);
                        else
-                               load = __source_load(i, load_idx, idle);
+                               load = source_load(i, load_idx);
 
                        avg_load += load;
                }
@@ -2171,7 +2073,7 @@ static runqueue_t *find_busiest_queue(struct sched_group *group,
        int i;
 
        for_each_cpu_mask(i, group->cpumask) {
-               load = __source_load(i, 0, idle);
+               load = source_load(i, 0);
 
                if (load > max_load) {
                        max_load = load;
@@ -3571,10 +3473,8 @@ void set_user_nice(task_t *p, long nice)
                goto out_unlock;
        }
        array = p->array;
-       if (array) {
+       if (array)
                dequeue_task(p, array);
-               dec_prio_bias(rq, p->static_prio);
-       }
 
        old_prio = p->prio;
        new_prio = NICE_TO_PRIO(nice);
@@ -3584,7 +3484,6 @@ void set_user_nice(task_t *p, long nice)
 
        if (array) {
                enqueue_task(p, array);
-               inc_prio_bias(rq, p->static_prio);
                /*
                 * If the task increased its priority or is running and
                 * lowered its priority, then reschedule its CPU:
index b373fc2420da06d73840fd3694301e504688468f..ea154104a00bf43a6a62a7d90d229465a4bfbc95 100644 (file)
@@ -2430,7 +2430,7 @@ sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo)
 }
 
 int
-do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact)
+do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
 {
        struct k_sigaction *k;
        sigset_t mask;
@@ -2454,6 +2454,8 @@ do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact)
                *oact = *k;
 
        if (act) {
+               sigdelsetmask(&act->sa.sa_mask,
+                             sigmask(SIGKILL) | sigmask(SIGSTOP));
                /*
                 * POSIX 3.3.1.3:
                 *  "Setting a signal action to SIG_IGN for a signal that is
@@ -2479,8 +2481,6 @@ do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact)
                        read_lock(&tasklist_lock);
                        spin_lock_irq(&t->sighand->siglock);
                        *k = *act;
-                       sigdelsetmask(&k->sa.sa_mask,
-                                     sigmask(SIGKILL) | sigmask(SIGSTOP));
                        sigemptyset(&mask);
                        sigaddset(&mask, sig);
                        rm_from_queue_full(&mask, &t->signal->shared_pending);
@@ -2495,8 +2495,6 @@ do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact)
                }
 
                *k = *act;
-               sigdelsetmask(&k->sa.sa_mask,
-                             sigmask(SIGKILL) | sigmask(SIGSTOP));
        }
 
        spin_unlock_irq(&current->sighand->siglock);
@@ -2702,6 +2700,7 @@ sys_signal(int sig, __sighandler_t handler)
 
        new_sa.sa.sa_handler = handler;
        new_sa.sa.sa_flags = SA_ONESHOT | SA_NOMASK;
+       sigemptyset(&new_sa.sa.sa_mask);
 
        ret = do_sigaction(sig, &new_sa, &old_sa);
 
index c0bd4a91480387e0c22d43b65d7f75fc2a522188..1e5b17dc7e3d5c6da19bdb2376e7a0a120cbc722 100644 (file)
@@ -752,12 +752,14 @@ void *radix_tree_delete(struct radix_tree_root *root, unsigned long index)
         */
        nr_cleared_tags = 0;
        for (tag = 0; tag < RADIX_TREE_TAGS; tag++) {
+               tags[tag] = 1;
                if (tag_get(pathp->node, tag, pathp->offset)) {
                        tag_clear(pathp->node, tag, pathp->offset);
-                       tags[tag] = 0;
-                       nr_cleared_tags++;
-               } else
-                       tags[tag] = 1;
+                       if (!any_tag_set(pathp->node, tag)) {
+                               tags[tag] = 0;
+                               nr_cleared_tags++;
+                       }
+               }
        }
 
        for (pathp--; nr_cleared_tags && pathp->node; pathp--) {
index 67f29516662a4b9d3c2291731a2259808646f54c..508707704d2cb714968a779e128084d640afc439 100644 (file)
@@ -85,7 +85,7 @@ void free_huge_page(struct page *page)
        BUG_ON(page_count(page));
 
        INIT_LIST_HEAD(&page->lru);
-       page[1].mapping = NULL;
+       page[1].lru.next = NULL;                        /* reset dtor */
 
        spin_lock(&hugetlb_lock);
        enqueue_huge_page(page);
@@ -105,7 +105,7 @@ struct page *alloc_huge_page(struct vm_area_struct *vma, unsigned long addr)
        }
        spin_unlock(&hugetlb_lock);
        set_page_count(page, 1);
-       page[1].mapping = (void *)free_huge_page;
+       page[1].lru.next = (void *)free_huge_page;      /* set dtor */
        for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); ++i)
                clear_user_highpage(&page[i], addr);
        return page;
index ae0ae3ea299a7a83b72939236ef4931eb5ac16d0..af3d573b014122f7fd2a99c3ee90c3826f70457f 100644 (file)
@@ -22,16 +22,23 @@ static long madvise_behavior(struct vm_area_struct * vma,
        struct mm_struct * mm = vma->vm_mm;
        int error = 0;
        pgoff_t pgoff;
-       int new_flags = vma->vm_flags & ~VM_READHINTMASK;
+       int new_flags = vma->vm_flags;
 
        switch (behavior) {
+       case MADV_NORMAL:
+               new_flags = new_flags & ~VM_RAND_READ & ~VM_SEQ_READ;
+               break;
        case MADV_SEQUENTIAL:
-               new_flags |= VM_SEQ_READ;
+               new_flags = (new_flags & ~VM_RAND_READ) | VM_SEQ_READ;
                break;
        case MADV_RANDOM:
-               new_flags |= VM_RAND_READ;
+               new_flags = (new_flags & ~VM_SEQ_READ) | VM_RAND_READ;
                break;
-       default:
+       case MADV_DONTFORK:
+               new_flags |= VM_DONTCOPY;
+               break;
+       case MADV_DOFORK:
+               new_flags &= ~VM_DONTCOPY;
                break;
        }
 
@@ -177,6 +184,12 @@ madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev,
        long error;
 
        switch (behavior) {
+       case MADV_DOFORK:
+               if (vma->vm_flags & VM_IO) {
+                       error = -EINVAL;
+                       break;
+               }
+       case MADV_DONTFORK:
        case MADV_NORMAL:
        case MADV_SEQUENTIAL:
        case MADV_RANDOM:
index dde04ff4be31873b88c38efbf94d30fd06ca5329..62c122528587d47063b7185917c9b61d27e6383e 100644 (file)
@@ -56,6 +56,7 @@ long nr_swap_pages;
 int percpu_pagelist_fraction;
 
 static void fastcall free_hot_cold_page(struct page *page, int cold);
+static void __free_pages_ok(struct page *page, unsigned int order);
 
 /*
  * results with 256, 32 in the lowmem_reserve sysctl:
@@ -169,20 +170,23 @@ static void bad_page(struct page *page)
  * All pages have PG_compound set.  All pages have their ->private pointing at
  * the head page (even the head page has this).
  *
- * The first tail page's ->mapping, if non-zero, holds the address of the
- * compound page's put_page() function.
- *
- * The order of the allocation is stored in the first tail page's ->index
- * This is only for debug at present.  This usage means that zero-order pages
- * may not be compound.
+ * The first tail page's ->lru.next holds the address of the compound page's
+ * put_page() function.  Its ->lru.prev holds the order of allocation.
+ * This usage means that zero-order pages may not be compound.
  */
+
+static void free_compound_page(struct page *page)
+{
+       __free_pages_ok(page, (unsigned long)page[1].lru.prev);
+}
+
 static void prep_compound_page(struct page *page, unsigned long order)
 {
        int i;
        int nr_pages = 1 << order;
 
-       page[1].mapping = NULL;
-       page[1].index = order;
+       page[1].lru.next = (void *)free_compound_page;  /* set dtor */
+       page[1].lru.prev = (void *)order;
        for (i = 0; i < nr_pages; i++) {
                struct page *p = page + i;
 
@@ -196,7 +200,7 @@ static void destroy_compound_page(struct page *page, unsigned long order)
        int i;
        int nr_pages = 1 << order;
 
-       if (unlikely(page[1].index != order))
+       if (unlikely((unsigned long)page[1].lru.prev != order))
                bad_page(page);
 
        for (i = 0; i < nr_pages; i++) {
index d66c2b0d9715abea6d68336bb7291bd81e23753a..add05d808a4a6fe96823cf3a5899d1c9a5a3f95b 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1717,6 +1717,12 @@ kmem_cache_create (const char *name, size_t size, size_t align,
                BUG();
        }
 
+       /*
+        * Prevent CPUs from coming and going.
+        * lock_cpu_hotplug() nests outside cache_chain_mutex
+        */
+       lock_cpu_hotplug();
+
        mutex_lock(&cache_chain_mutex);
 
        list_for_each(p, &cache_chain) {
@@ -1918,8 +1924,6 @@ kmem_cache_create (const char *name, size_t size, size_t align,
        cachep->dtor = dtor;
        cachep->name = name;
 
-       /* Don't let CPUs to come and go */
-       lock_cpu_hotplug();
 
        if (g_cpucache_up == FULL) {
                enable_cpucache(cachep);
@@ -1978,12 +1982,12 @@ kmem_cache_create (const char *name, size_t size, size_t align,
 
        /* cache setup completed, link it into the list */
        list_add(&cachep->next, &cache_chain);
-       unlock_cpu_hotplug();
       oops:
        if (!cachep && (flags & SLAB_PANIC))
                panic("kmem_cache_create(): failed to create slab `%s'\n",
                      name);
        mutex_unlock(&cache_chain_mutex);
+       unlock_cpu_hotplug();
        return cachep;
 }
 EXPORT_SYMBOL(kmem_cache_create);
index 76247424dea185d92997032d7c848dc5a550482a..cce3dda59c595560dc90ede2bf6f12e193e4312f 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -40,7 +40,7 @@ static void put_compound_page(struct page *page)
        if (put_page_testzero(page)) {
                void (*dtor)(struct page *page);
 
-               dtor = (void (*)(struct page *))page[1].mapping;
+               dtor = (void (*)(struct page *))page[1].lru.next;
                (*dtor)(page);
        }
 }
index 5a610804cd06a938b902006d2780a540d66be704..1838c15ca4fd8b3eb0ee70739ea63f765fb4689e 100644 (file)
@@ -443,6 +443,10 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc)
                BUG_ON(PageActive(page));
 
                sc->nr_scanned++;
+
+               if (!sc->may_swap && page_mapped(page))
+                       goto keep_locked;
+
                /* Double the slab pressure for mapped and swapcache pages */
                if (page_mapped(page) || PageSwapCache(page))
                        sc->nr_scanned++;
@@ -632,7 +636,7 @@ static int swap_page(struct page *page)
        struct address_space *mapping = page_mapping(page);
 
        if (page_mapped(page) && mapping)
-               if (try_to_unmap(page, 0) != SWAP_SUCCESS)
+               if (try_to_unmap(page, 1) != SWAP_SUCCESS)
                        goto unlock_retry;
 
        if (PageDirty(page)) {
@@ -839,7 +843,7 @@ EXPORT_SYMBOL(migrate_page);
  * pages are swapped out.
  *
  * The function returns after 10 attempts or if no pages
- * are movable anymore because t has become empty
+ * are movable anymore because to has become empty
  * or no retryable pages exist anymore.
  *
  * Return: Number of pages not migrated when "to" ran empty.
@@ -928,12 +932,21 @@ redo:
                        goto unlock_both;
 
                if (mapping->a_ops->migratepage) {
+                       /*
+                        * Most pages have a mapping and most filesystems
+                        * should provide a migration function. Anonymous
+                        * pages are part of swap space which also has its
+                        * own migration function. This is the most common
+                        * path for page migration.
+                        */
                        rc = mapping->a_ops->migratepage(newpage, page);
                        goto unlock_both;
                 }
 
                /*
-                * Trigger writeout if page is dirty
+                * Default handling if a filesystem does not provide
+                * a migration function. We can only migrate clean
+                * pages so try to write out any dirty pages first.
                 */
                if (PageDirty(page)) {
                        switch (pageout(page, mapping)) {
@@ -949,9 +962,10 @@ redo:
                                ; /* try to migrate the page below */
                        }
                 }
+
                /*
-                * If we have no buffer or can release the buffer
-                * then do a simple migration.
+                * Buffers are managed in a filesystem specific way.
+                * We must have no buffers or drop them.
                 */
                if (!page_has_buffers(page) ||
                    try_to_release_page(page, GFP_KERNEL)) {
@@ -966,6 +980,11 @@ redo:
                 * swap them out.
                 */
                if (pass > 4) {
+                       /*
+                        * Persistently unable to drop buffers..... As a
+                        * measure of last resort we fall back to
+                        * swap_page().
+                        */
                        unlock_page(newpage);
                        newpage = NULL;
                        rc = swap_page(page);
@@ -1176,9 +1195,47 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
        struct page *page;
        struct pagevec pvec;
        int reclaim_mapped = 0;
-       long mapped_ratio;
-       long distress;
-       long swap_tendency;
+
+       if (unlikely(sc->may_swap)) {
+               long mapped_ratio;
+               long distress;
+               long swap_tendency;
+
+               /*
+                * `distress' is a measure of how much trouble we're having
+                * reclaiming pages.  0 -> no problems.  100 -> great trouble.
+                */
+               distress = 100 >> zone->prev_priority;
+
+               /*
+                * The point of this algorithm is to decide when to start
+                * reclaiming mapped memory instead of just pagecache.  Work out
+                * how much memory
+                * is mapped.
+                */
+               mapped_ratio = (sc->nr_mapped * 100) / total_memory;
+
+               /*
+                * Now decide how much we really want to unmap some pages.  The
+                * mapped ratio is downgraded - just because there's a lot of
+                * mapped memory doesn't necessarily mean that page reclaim
+                * isn't succeeding.
+                *
+                * The distress ratio is important - we don't want to start
+                * going oom.
+                *
+                * A 100% value of vm_swappiness overrides this algorithm
+                * altogether.
+                */
+               swap_tendency = mapped_ratio / 2 + distress + vm_swappiness;
+
+               /*
+                * Now use this metric to decide whether to start moving mapped
+                * memory onto the inactive list.
+                */
+               if (swap_tendency >= 100)
+                       reclaim_mapped = 1;
+       }
 
        lru_add_drain();
        spin_lock_irq(&zone->lru_lock);
@@ -1188,37 +1245,6 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
        zone->nr_active -= pgmoved;
        spin_unlock_irq(&zone->lru_lock);
 
-       /*
-        * `distress' is a measure of how much trouble we're having reclaiming
-        * pages.  0 -> no problems.  100 -> great trouble.
-        */
-       distress = 100 >> zone->prev_priority;
-
-       /*
-        * The point of this algorithm is to decide when to start reclaiming
-        * mapped memory instead of just pagecache.  Work out how much memory
-        * is mapped.
-        */
-       mapped_ratio = (sc->nr_mapped * 100) / total_memory;
-
-       /*
-        * Now decide how much we really want to unmap some pages.  The mapped
-        * ratio is downgraded - just because there's a lot of mapped memory
-        * doesn't necessarily mean that page reclaim isn't succeeding.
-        *
-        * The distress ratio is important - we don't want to start going oom.
-        *
-        * A 100% value of vm_swappiness overrides this algorithm altogether.
-        */
-       swap_tendency = mapped_ratio / 2 + distress + vm_swappiness;
-
-       /*
-        * Now use this metric to decide whether to start moving mapped memory
-        * onto the inactive list.
-        */
-       if (swap_tendency >= 100)
-               reclaim_mapped = 1;
-
        while (!list_empty(&l_hold)) {
                cond_resched();
                page = lru_to_page(&l_hold);
@@ -1595,9 +1621,7 @@ scan:
                        sc.nr_reclaimed = 0;
                        sc.priority = priority;
                        sc.swap_cluster_max = nr_pages? nr_pages : SWAP_CLUSTER_MAX;
-                       atomic_inc(&zone->reclaim_in_progress);
                        shrink_zone(zone, &sc);
-                       atomic_dec(&zone->reclaim_in_progress);
                        reclaim_state->reclaimed_slab = 0;
                        nr_slab = shrink_slab(sc.nr_scanned, GFP_KERNEL,
                                                lru_pages);
index d23e906456eb373ccbbd5ead89270ff198ceaf2e..53cf05709283662f16578fab5cd06972c07eec16 100644 (file)
@@ -59,3 +59,5 @@ void destroy_8023_client(struct datalink_proto *dl)
 
 EXPORT_SYMBOL(destroy_8023_client);
 EXPORT_SYMBOL(make_8023_client);
+
+MODULE_LICENSE("GPL");
index e7211a7f382c5b35ea059bd36feabfa5f8a32cfd..93ad59a28ef56c50f1d3dd190fdde489ab60d117 100644 (file)
@@ -56,7 +56,8 @@ static void sigd_put_skb(struct sk_buff *skb)
        remove_wait_queue(&sigd_sleep,&wait);
 #else
        if (!sigd) {
-               printk(KERN_WARNING "atmsvc: no signaling demon\n");
+               if (net_ratelimit())
+                       printk(KERN_WARNING "atmsvc: no signaling demon\n");
                kfree_skb(skb);
                return;
        }
index bdb6458c6bd53e049a37041ec46dcdd46a08e545..97bdec73d17e9fcbc4ffdfcb75c5613c3b9e9c44 100644 (file)
@@ -143,13 +143,15 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
 static int hci_sock_release(struct socket *sock)
 {
        struct sock *sk = sock->sk;
-       struct hci_dev *hdev = hci_pi(sk)->hdev;
+       struct hci_dev *hdev;
 
        BT_DBG("sock %p sk %p", sock, sk);
 
        if (!sk)
                return 0;
 
+       hdev = hci_pi(sk)->hdev;
+
        bt_sock_unlink(&hci_sk_list, sk);
 
        if (hdev) {
@@ -311,14 +313,18 @@ static int hci_sock_getname(struct socket *sock, struct sockaddr *addr, int *add
 {
        struct sockaddr_hci *haddr = (struct sockaddr_hci *) addr;
        struct sock *sk = sock->sk;
+       struct hci_dev *hdev = hci_pi(sk)->hdev;
 
        BT_DBG("sock %p sk %p", sock, sk);
 
+       if (!hdev)
+               return -EBADFD;
+
        lock_sock(sk);
 
        *addr_len = sizeof(*haddr);
        haddr->hci_family = AF_BLUETOOTH;
-       haddr->hci_dev    = hci_pi(sk)->hdev->id;
+       haddr->hci_dev    = hdev->id;
 
        release_sock(sk);
        return 0;
index 0d89d64341364fcf9e6eb4214568c24795ea6a51..5b4253c61f628d2c7256f5ac5f196bd20b40f5ce 100644 (file)
 #include <net/bluetooth/l2cap.h>
 #include <net/bluetooth/rfcomm.h>
 
-#define VERSION "1.6"
-
 #ifndef CONFIG_BT_RFCOMM_DEBUG
 #undef  BT_DBG
 #define BT_DBG(D...)
 #endif
 
+#define VERSION "1.7"
+
+static unsigned int l2cap_mtu = RFCOMM_MAX_L2CAP_MTU;
+
 static struct task_struct *rfcomm_thread;
 
 static DECLARE_MUTEX(rfcomm_sem);
@@ -623,7 +625,7 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst
        /* Set L2CAP options */
        sk = sock->sk;
        lock_sock(sk);
-       l2cap_pi(sk)->imtu = RFCOMM_MAX_L2CAP_MTU;
+       l2cap_pi(sk)->imtu = l2cap_mtu;
        release_sock(sk);
 
        s = rfcomm_session_add(sock, BT_BOUND);
@@ -1868,7 +1870,7 @@ static int rfcomm_add_listener(bdaddr_t *ba)
        /* Set L2CAP options */
        sk = sock->sk;
        lock_sock(sk);
-       l2cap_pi(sk)->imtu = RFCOMM_MAX_L2CAP_MTU;
+       l2cap_pi(sk)->imtu = l2cap_mtu;
        release_sock(sk);
 
        /* Start listening on the socket */
@@ -2070,6 +2072,9 @@ static void __exit rfcomm_exit(void)
 module_init(rfcomm_init);
 module_exit(rfcomm_exit);
 
+module_param(l2cap_mtu, uint, 0644);
+MODULE_PARM_DESC(l2cap_mtu, "Default MTU for the L2CAP connection");
+
 MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("Bluetooth RFCOMM ver " VERSION);
 MODULE_VERSION(VERSION);
index da687c8dc6ff013e62f04b535f2a26483e4db284..7fa3a5a9971f29ecf1ff422f1b29fddae87a4f97 100644 (file)
@@ -79,9 +79,14 @@ static int port_cost(struct net_device *dev)
  */
 static void port_carrier_check(void *arg)
 {
-       struct net_bridge_port *p = arg;
+       struct net_device *dev = arg;
+       struct net_bridge_port *p;
 
        rtnl_lock();
+       p = dev->br_port;
+       if (!p)
+               goto done;
+
        if (netif_carrier_ok(p->dev)) {
                u32 cost = port_cost(p->dev);
 
@@ -97,19 +102,33 @@ static void port_carrier_check(void *arg)
                        br_stp_disable_port(p);
                spin_unlock_bh(&p->br->lock);
        }
+done:
        rtnl_unlock();
 }
 
+static void release_nbp(struct kobject *kobj)
+{
+       struct net_bridge_port *p
+               = container_of(kobj, struct net_bridge_port, kobj);
+       kfree(p);
+}
+
+static struct kobj_type brport_ktype = {
+#ifdef CONFIG_SYSFS
+       .sysfs_ops = &brport_sysfs_ops,
+#endif
+       .release = release_nbp,
+};
+
 static void destroy_nbp(struct net_bridge_port *p)
 {
        struct net_device *dev = p->dev;
 
-       dev->br_port = NULL;
        p->br = NULL;
        p->dev = NULL;
        dev_put(dev);
 
-       br_sysfs_freeif(p);
+       kobject_put(&p->kobj);
 }
 
 static void destroy_nbp_rcu(struct rcu_head *head)
@@ -133,24 +152,24 @@ static void del_nbp(struct net_bridge_port *p)
        struct net_bridge *br = p->br;
        struct net_device *dev = p->dev;
 
-       /* Race between RTNL notify and RCU callback */
-       if (p->deleted)
-               return;
+       sysfs_remove_link(&br->ifobj, dev->name);
 
        dev_set_promiscuity(dev, -1);
 
        cancel_delayed_work(&p->carrier_check);
-       flush_scheduled_work();
 
        spin_lock_bh(&br->lock);
        br_stp_disable_port(p);
-       p->deleted = 1;
        spin_unlock_bh(&br->lock);
 
        br_fdb_delete_by_port(br, p);
 
        list_del_rcu(&p->list);
 
+       rcu_assign_pointer(dev->br_port, NULL);
+
+       kobject_del(&p->kobj);
+
        call_rcu(&p->rcu, destroy_nbp_rcu);
 }
 
@@ -160,7 +179,6 @@ static void del_br(struct net_bridge *br)
        struct net_bridge_port *p, *n;
 
        list_for_each_entry_safe(p, n, &br->port_list, list) {
-               br_sysfs_removeif(p);
                del_nbp(p);
        }
 
@@ -254,13 +272,17 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br,
        p->dev = dev;
        p->path_cost = port_cost(dev);
        p->priority = 0x8000 >> BR_PORT_BITS;
-       dev->br_port = p;
        p->port_no = index;
        br_init_port(p);
        p->state = BR_STATE_DISABLED;
-       INIT_WORK(&p->carrier_check, port_carrier_check, p);
+       INIT_WORK(&p->carrier_check, port_carrier_check, dev);
        kobject_init(&p->kobj);
 
+       kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR);
+       p->kobj.ktype = &brport_ktype;
+       p->kobj.parent = &(dev->class_dev.kobj);
+       p->kobj.kset = NULL;
+
        return p;
 }
 
@@ -388,30 +410,43 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
        if (dev->br_port != NULL)
                return -EBUSY;
 
-       if (IS_ERR(p = new_nbp(br, dev)))
+       p = new_nbp(br, dev);
+       if (IS_ERR(p))
                return PTR_ERR(p);
 
-       if ((err = br_fdb_insert(br, p, dev->dev_addr)))
-               destroy_nbp(p);
-       else if ((err = br_sysfs_addif(p)))
-               del_nbp(p);
-       else {
-               dev_set_promiscuity(dev, 1);
+       err = kobject_add(&p->kobj);
+       if (err)
+               goto err0;
 
-               list_add_rcu(&p->list, &br->port_list);
+       err = br_fdb_insert(br, p, dev->dev_addr);
+       if (err)
+               goto err1;
 
-               spin_lock_bh(&br->lock);
-               br_stp_recalculate_bridge_id(br);
-               br_features_recompute(br);
-               if ((br->dev->flags & IFF_UP) 
-                   && (dev->flags & IFF_UP) && netif_carrier_ok(dev))
-                       br_stp_enable_port(p);
-               spin_unlock_bh(&br->lock);
+       err = br_sysfs_addif(p);
+       if (err)
+               goto err2;
 
-               dev_set_mtu(br->dev, br_min_mtu(br));
-       }
+       rcu_assign_pointer(dev->br_port, p);
+       dev_set_promiscuity(dev, 1);
+
+       list_add_rcu(&p->list, &br->port_list);
 
+       spin_lock_bh(&br->lock);
+       br_stp_recalculate_bridge_id(br);
+       br_features_recompute(br);
+       schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE);
+       spin_unlock_bh(&br->lock);
+
+       dev_set_mtu(br->dev, br_min_mtu(br));
+       kobject_uevent(&p->kobj, KOBJ_ADD);
+
+       return 0;
+err2:
+       br_fdb_delete_by_port(br, p);
+err1:
+       kobject_del(&p->kobj);
+err0:
+       kobject_put(&p->kobj);
        return err;
 }
 
@@ -423,7 +458,6 @@ int br_del_if(struct net_bridge *br, struct net_device *dev)
        if (!p || p->br != br) 
                return -EINVAL;
 
-       br_sysfs_removeif(p);
        del_nbp(p);
 
        spin_lock_bh(&br->lock);
index e3a73cead6b61f069bb9b0352ffa1ef47b0a858c..4eef837553153df523fc1053d04ac07e55cfd4e3 100644 (file)
@@ -45,18 +45,20 @@ static void br_pass_frame_up(struct net_bridge *br, struct sk_buff *skb)
 int br_handle_frame_finish(struct sk_buff *skb)
 {
        const unsigned char *dest = eth_hdr(skb)->h_dest;
-       struct net_bridge_port *p = skb->dev->br_port;
-       struct net_bridge *br = p->br;
+       struct net_bridge_port *p = rcu_dereference(skb->dev->br_port);
+       struct net_bridge *br;
        struct net_bridge_fdb_entry *dst;
        int passedup = 0;
 
+       if (!p || p->state == BR_STATE_DISABLED)
+               goto drop;
+
        /* insert into forwarding database after filtering to avoid spoofing */
-       br_fdb_update(p->br, p, eth_hdr(skb)->h_source);
+       br = p->br;
+       br_fdb_update(br, p, eth_hdr(skb)->h_source);
 
-       if (p->state == BR_STATE_LEARNING) {
-               kfree_skb(skb);
-               goto out;
-       }
+       if (p->state == BR_STATE_LEARNING)
+               goto drop;
 
        if (br->dev->flags & IFF_PROMISC) {
                struct sk_buff *skb2;
@@ -93,6 +95,9 @@ int br_handle_frame_finish(struct sk_buff *skb)
 
 out:
        return 0;
+drop:
+       kfree_skb(skb);
+       goto out;
 }
 
 /*
index 7cac3fb9f8099151abcc63e561dab42f714d4340..6bb0c7eb1ef0300d827d755be0d4eab7f73d600a 100644 (file)
@@ -51,9 +51,6 @@
 #define store_orig_dstaddr(skb)         (skb_origaddr(skb) = (skb)->nh.iph->daddr)
 #define dnat_took_place(skb)    (skb_origaddr(skb) != (skb)->nh.iph->daddr)
 
-#define has_bridge_parent(device)      ((device)->br_port != NULL)
-#define bridge_parent(device)          ((device)->br_port->br->dev)
-
 #ifdef CONFIG_SYSCTL
 static struct ctl_table_header *brnf_sysctl_header;
 static int brnf_call_iptables = 1;
@@ -98,6 +95,12 @@ static struct rtable __fake_rtable = {
        .rt_flags       = 0,
 };
 
+static inline struct net_device *bridge_parent(const struct net_device *dev)
+{
+       struct net_bridge_port *port = rcu_dereference(dev->br_port);
+
+       return port ? port->br->dev : NULL;
+}
 
 /* PF_BRIDGE/PRE_ROUTING *********************************************/
 /* Undo the changes made for ip6tables PREROUTING and continue the
@@ -189,11 +192,15 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)
        skb->nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
 
        skb->dev = bridge_parent(skb->dev);
-       if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-               skb_pull(skb, VLAN_HLEN);
-               skb->nh.raw += VLAN_HLEN;
+       if (!skb->dev)
+               kfree_skb(skb);
+       else {
+               if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
+                       skb_pull(skb, VLAN_HLEN);
+                       skb->nh.raw += VLAN_HLEN;
+               }
+               skb->dst->output(skb);
        }
-       skb->dst->output(skb);
        return 0;
 }
 
@@ -270,7 +277,7 @@ bridged_dnat:
 }
 
 /* Some common code for IPv4/IPv6 */
-static void setup_pre_routing(struct sk_buff *skb)
+static struct net_device *setup_pre_routing(struct sk_buff *skb)
 {
        struct nf_bridge_info *nf_bridge = skb->nf_bridge;
 
@@ -282,6 +289,8 @@ static void setup_pre_routing(struct sk_buff *skb)
        nf_bridge->mask |= BRNF_NF_BRIDGE_PREROUTING;
        nf_bridge->physindev = skb->dev;
        skb->dev = bridge_parent(skb->dev);
+
+       return skb->dev;
 }
 
 /* We only check the length. A bridge shouldn't do any hop-by-hop stuff anyway */
@@ -376,7 +385,8 @@ static unsigned int br_nf_pre_routing_ipv6(unsigned int hook,
        nf_bridge_put(skb->nf_bridge);
        if ((nf_bridge = nf_bridge_alloc(skb)) == NULL)
                return NF_DROP;
-       setup_pre_routing(skb);
+       if (!setup_pre_routing(skb))
+               return NF_DROP;
 
        NF_HOOK(PF_INET6, NF_IP6_PRE_ROUTING, skb, skb->dev, NULL,
                br_nf_pre_routing_finish_ipv6);
@@ -465,7 +475,8 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb,
        nf_bridge_put(skb->nf_bridge);
        if ((nf_bridge = nf_bridge_alloc(skb)) == NULL)
                return NF_DROP;
-       setup_pre_routing(skb);
+       if (!setup_pre_routing(skb))
+               return NF_DROP;
        store_orig_dstaddr(skb);
 
        NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, skb->dev, NULL,
@@ -539,11 +550,16 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff **pskb,
        struct sk_buff *skb = *pskb;
        struct nf_bridge_info *nf_bridge;
        struct vlan_ethhdr *hdr = vlan_eth_hdr(skb);
+       struct net_device *parent;
        int pf;
 
        if (!skb->nf_bridge)
                return NF_ACCEPT;
 
+       parent = bridge_parent(out);
+       if (!parent)
+               return NF_DROP;
+
        if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP)
                pf = PF_INET;
        else
@@ -564,8 +580,8 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff **pskb,
        nf_bridge->mask |= BRNF_BRIDGED;
        nf_bridge->physoutdev = skb->dev;
 
-       NF_HOOK(pf, NF_IP_FORWARD, skb, bridge_parent(in),
-               bridge_parent(out), br_nf_forward_finish);
+       NF_HOOK(pf, NF_IP_FORWARD, skb, bridge_parent(in), parent,
+               br_nf_forward_finish);
 
        return NF_STOLEN;
 }
@@ -688,6 +704,8 @@ static unsigned int br_nf_local_out(unsigned int hook, struct sk_buff **pskb,
                goto out;
        }
        realoutdev = bridge_parent(skb->dev);
+       if (!realoutdev)
+               return NF_DROP;
 
 #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
        /* iptables should match -o br0.x */
@@ -701,9 +719,11 @@ static unsigned int br_nf_local_out(unsigned int hook, struct sk_buff **pskb,
        /* IP forwarded traffic has a physindev, locally
         * generated traffic hasn't. */
        if (realindev != NULL) {
-               if (!(nf_bridge->mask & BRNF_DONT_TAKE_PARENT) &&
-                   has_bridge_parent(realindev))
-                       realindev = bridge_parent(realindev);
+               if (!(nf_bridge->mask & BRNF_DONT_TAKE_PARENT) ) {
+                       struct net_device *parent = bridge_parent(realindev);
+                       if (parent)
+                               realindev = parent;
+               }
 
                NF_HOOK_THRESH(pf, NF_IP_FORWARD, skb, realindev,
                               realoutdev, br_nf_local_out_finish,
@@ -743,6 +763,9 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff **pskb,
        if (!nf_bridge)
                return NF_ACCEPT;
 
+       if (!realoutdev)
+               return NF_DROP;
+
        if (skb->protocol == __constant_htons(ETH_P_IP) || IS_VLAN_IP)
                pf = PF_INET;
        else
@@ -782,8 +805,8 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff **pskb,
 print_error:
        if (skb->dev != NULL) {
                printk("[%s]", skb->dev->name);
-               if (has_bridge_parent(skb->dev))
-                       printk("[%s]", bridge_parent(skb->dev)->name);
+               if (realoutdev)
+                       printk("[%s]", realoutdev->name);
        }
        printk(" head:%p, raw:%p, data:%p\n", skb->head, skb->mac.raw,
                                              skb->data);
index e330b17b6d816620f2706fc4eab15c1f4ef21481..8f10e09f251bd9169dfc347413de37e83d28c16a 100644 (file)
@@ -68,7 +68,6 @@ struct net_bridge_port
        /* STP */
        u8                              priority;
        u8                              state;
-       u8                              deleted;
        u16                             port_no;
        unsigned char                   topology_change_ack;
        unsigned char                   config_pending;
@@ -233,9 +232,8 @@ extern void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent);
 
 #ifdef CONFIG_SYSFS
 /* br_sysfs_if.c */
+extern struct sysfs_ops brport_sysfs_ops;
 extern int br_sysfs_addif(struct net_bridge_port *p);
-extern void br_sysfs_removeif(struct net_bridge_port *p);
-extern void br_sysfs_freeif(struct net_bridge_port *p);
 
 /* br_sysfs_br.c */
 extern int br_sysfs_addbr(struct net_device *dev);
@@ -244,8 +242,6 @@ extern void br_sysfs_delbr(struct net_device *dev);
 #else
 
 #define br_sysfs_addif(p)      (0)
-#define br_sysfs_removeif(p)   do { } while(0)
-#define br_sysfs_freeif(p)     kfree(p)
 #define br_sysfs_addbr(dev)    (0)
 #define br_sysfs_delbr(dev)    do { } while(0)
 #endif /* CONFIG_SYSFS */
index d071f1c9ad0b00076c18ce677ed1ccba0bc300ec..296f6a487c52eacc65b61127f63784fb5b796b1a 100644 (file)
@@ -133,29 +133,35 @@ void br_send_tcn_bpdu(struct net_bridge_port *p)
 
 static const unsigned char header[6] = {0x42, 0x42, 0x03, 0x00, 0x00, 0x00};
 
-/* NO locks */
+/* NO locks, but rcu_read_lock (preempt_disabled)  */
 int br_stp_handle_bpdu(struct sk_buff *skb)
 {
-       struct net_bridge_port *p = skb->dev->br_port;
-       struct net_bridge *br = p->br;
+       struct net_bridge_port *p = rcu_dereference(skb->dev->br_port);
+       struct net_bridge *br;
        unsigned char *buf;
 
+       if (!p)
+               goto err;
+
+       br = p->br;
+       spin_lock(&br->lock);
+
+       if (p->state == BR_STATE_DISABLED || !(br->dev->flags & IFF_UP))
+               goto out;
+
        /* insert into forwarding database after filtering to avoid spoofing */
-       br_fdb_update(p->br, p, eth_hdr(skb)->h_source);
+       br_fdb_update(br, p, eth_hdr(skb)->h_source);
+
+       if (!br->stp_enabled)
+               goto out;
 
        /* need at least the 802 and STP headers */
        if (!pskb_may_pull(skb, sizeof(header)+1) ||
            memcmp(skb->data, header, sizeof(header)))
-               goto err;
+               goto out;
 
        buf = skb_pull(skb, sizeof(header));
 
-       spin_lock_bh(&br->lock);
-       if (p->state == BR_STATE_DISABLED 
-           || !(br->dev->flags & IFF_UP)
-           || !br->stp_enabled)
-               goto out;
-
        if (buf[0] == BPDU_TYPE_CONFIG) {
                struct br_config_bpdu bpdu;
 
@@ -201,7 +207,7 @@ int br_stp_handle_bpdu(struct sk_buff *skb)
                br_received_tcn_bpdu(p);
        }
  out:
-       spin_unlock_bh(&br->lock);
+       spin_unlock(&br->lock);
  err:
        kfree_skb(skb);
        return 0;
index cc047f7fb6efc9c4deb42d6aab17f48a778d0474..35cf3a07408725608f368ccfe97e338b3ab9e678 100644 (file)
@@ -67,7 +67,7 @@ void br_stp_disable_bridge(struct net_bridge *br)
 {
        struct net_bridge_port *p;
 
-       spin_lock(&br->lock);
+       spin_lock_bh(&br->lock);
        list_for_each_entry(p, &br->port_list, list) {
                if (p->state != BR_STATE_DISABLED)
                        br_stp_disable_port(p);
@@ -76,7 +76,7 @@ void br_stp_disable_bridge(struct net_bridge *br)
 
        br->topology_change = 0;
        br->topology_change_detected = 0;
-       spin_unlock(&br->lock);
+       spin_unlock_bh(&br->lock);
 
        del_timer_sync(&br->hello_timer);
        del_timer_sync(&br->topology_change_timer);
index 0ac0355d16dd2dea98866ceb0c69841f5a73a400..c51c9e42aeb3d0b6709edf35841699770725c5d5 100644 (file)
@@ -195,23 +195,11 @@ static ssize_t brport_store(struct kobject * kobj,
        return ret;
 }
 
-/* called from kobject_put when port ref count goes to zero. */
-static void brport_release(struct kobject *kobj)
-{
-       kfree(container_of(kobj, struct net_bridge_port, kobj));
-}
-
-static struct sysfs_ops brport_sysfs_ops = {
+struct sysfs_ops brport_sysfs_ops = {
        .show = brport_show,
        .store = brport_store,
 };
 
-static struct kobj_type brport_ktype = {
-       .sysfs_ops = &brport_sysfs_ops,
-       .release = brport_release,
-};
-
-
 /*
  * Add sysfs entries to ethernet device added to a bridge.
  * Creates a brport subdirectory with bridge attributes.
@@ -223,17 +211,6 @@ int br_sysfs_addif(struct net_bridge_port *p)
        struct brport_attribute **a;
        int err;
 
-       ASSERT_RTNL();
-
-       kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR);
-       p->kobj.ktype = &brport_ktype;
-       p->kobj.parent = &(p->dev->class_dev.kobj);
-       p->kobj.kset = NULL;
-
-       err = kobject_add(&p->kobj);
-       if(err)
-               goto out1;
-
        err = sysfs_create_link(&p->kobj, &br->dev->class_dev.kobj, 
                                SYSFS_BRIDGE_PORT_LINK);
        if (err)
@@ -245,28 +222,7 @@ int br_sysfs_addif(struct net_bridge_port *p)
                        goto out2;
        }
 
-       err = sysfs_create_link(&br->ifobj, &p->kobj, p->dev->name);
-       if (err)
-               goto out2;
-
-       kobject_uevent(&p->kobj, KOBJ_ADD);
-       return 0;
- out2:
-       kobject_del(&p->kobj);
- out1:
+       err= sysfs_create_link(&br->ifobj, &p->kobj, p->dev->name);
+out2:
        return err;
 }
-
-void br_sysfs_removeif(struct net_bridge_port *p)
-{
-       pr_debug("br_sysfs_removeif\n");
-       sysfs_remove_link(&p->br->ifobj, p->dev->name);
-       kobject_uevent(&p->kobj, KOBJ_REMOVE);
-       kobject_del(&p->kobj);
-}
-
-void br_sysfs_freeif(struct net_bridge_port *p)
-{
-       pr_debug("br_sysfs_freeif\n");
-       kobject_put(&p->kobj);
-}
index f8d322e1ea9276c3f581fbda2393c829b6fd17f0..b8ce6bf81188943a1ac91f3b80b361d03ce3c955 100644 (file)
@@ -247,49 +247,74 @@ EXPORT_SYMBOL(skb_kill_datagram);
 int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset,
                            struct iovec *to, int len)
 {
-       int i, err, fraglen, end = 0;
-       struct sk_buff *next = skb_shinfo(skb)->frag_list;
+       int start = skb_headlen(skb);
+       int i, copy = start - offset;
 
-       if (!len)
-               return 0;
+       /* Copy header. */
+       if (copy > 0) {
+               if (copy > len)
+                       copy = len;
+               if (memcpy_toiovec(to, skb->data + offset, copy))
+                       goto fault;
+               if ((len -= copy) == 0)
+                       return 0;
+               offset += copy;
+       }
 
-next_skb:
-       fraglen = skb_headlen(skb);
-       i = -1;
+       /* Copy paged appendix. Hmm... why does this look so complicated? */
+       for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
+               int end;
 
-       while (1) {
-               int start = end;
+               BUG_TRAP(start <= offset + len);
 
-               if ((end += fraglen) > offset) {
-                       int copy = end - offset, o = offset - start;
+               end = start + skb_shinfo(skb)->frags[i].size;
+               if ((copy = end - offset) > 0) {
+                       int err;
+                       u8  *vaddr;
+                       skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
+                       struct page *page = frag->page;
 
                        if (copy > len)
                                copy = len;
-                       if (i == -1)
-                               err = memcpy_toiovec(to, skb->data + o, copy);
-                       else {
-                               skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
-                               struct page *page = frag->page;
-                               void *p = kmap(page) + frag->page_offset + o;
-                               err = memcpy_toiovec(to, p, copy);
-                               kunmap(page);
-                       }
+                       vaddr = kmap(page);
+                       err = memcpy_toiovec(to, vaddr + frag->page_offset +
+                                            offset - start, copy);
+                       kunmap(page);
                        if (err)
                                goto fault;
                        if (!(len -= copy))
                                return 0;
                        offset += copy;
                }
-               if (++i >= skb_shinfo(skb)->nr_frags)
-                       break;
-               fraglen = skb_shinfo(skb)->frags[i].size;
+               start = end;
        }
-       if (next) {
-               skb = next;
-               BUG_ON(skb_shinfo(skb)->frag_list);
-               next = skb->next;
-               goto next_skb;
+
+       if (skb_shinfo(skb)->frag_list) {
+               struct sk_buff *list = skb_shinfo(skb)->frag_list;
+
+               for (; list; list = list->next) {
+                       int end;
+
+                       BUG_TRAP(start <= offset + len);
+
+                       end = start + list->len;
+                       if ((copy = end - offset) > 0) {
+                               if (copy > len)
+                                       copy = len;
+                               if (skb_copy_datagram_iovec(list,
+                                                           offset - start,
+                                                           to, copy))
+                                       goto fault;
+                               if ((len -= copy) == 0)
+                                       return 0;
+                               offset += copy;
+                       }
+                       start = end;
+               }
        }
+       if (!len)
+               return 0;
+
 fault:
        return -EFAULT;
 }
index 8700379685e0d7b1b7c74d6d6e5a5e46f7faed85..eca2976abb25b5c2b727191b72c8f5dc861c8285 100644 (file)
@@ -455,7 +455,7 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
        if (!skb)
                return;
 
-       if (rtnetlink_fill_ifinfo(skb, dev, type, current->pid, 0, change, 0) < 0) {
+       if (rtnetlink_fill_ifinfo(skb, dev, type, 0, 0, change, 0) < 0) {
                kfree_skb(skb);
                return;
        }
index 95b9d81ac488659808a93d289ddea362294a170c..3ffa60dadc0c6b7360ce91c2b58404785d6d1be3 100644 (file)
@@ -1135,7 +1135,7 @@ static void rtmsg_ifa(int event, struct in_ifaddr* ifa)
 
        if (!skb)
                netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, ENOBUFS);
-       else if (inet_fill_ifaddr(skb, ifa, current->pid, 0, event, 0) < 0) {
+       else if (inet_fill_ifaddr(skb, ifa, 0, 0, event, 0) < 0) {
                kfree_skb(skb);
                netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, EINVAL);
        } else {
index ef4724de7350ad3ccf613b19a55afe4c662b0ab7..0f4145babb14cf78c324d83b6f99801eaf12d95a 100644 (file)
@@ -1045,7 +1045,7 @@ fib_convert_rtentry(int cmd, struct nlmsghdr *nl, struct rtmsg *rtm,
        }
 
        nl->nlmsg_flags = NLM_F_REQUEST;
-       nl->nlmsg_pid = current->pid;
+       nl->nlmsg_pid = 0;
        nl->nlmsg_seq = 0;
        nl->nlmsg_len = NLMSG_LENGTH(sizeof(*rtm));
        if (cmd == SIOCDELRT) {
index 4d1c40972a4bcb7b2d32e08b0c21fa79eb69c02c..e7bbff4340bb6c2d73c956b15c40a4b596296ecb 100644 (file)
@@ -192,7 +192,7 @@ int sysctl_icmp_echo_ignore_all;
 int sysctl_icmp_echo_ignore_broadcasts = 1;
 
 /* Control parameter - ignore bogus broadcast responses? */
-int sysctl_icmp_ignore_bogus_error_responses;
+int sysctl_icmp_ignore_bogus_error_responses = 1;
 
 /*
  *     Configurable global rate limit.
index abe23923e4e73975bd6ae486a7ef1c8ce89fb2a9..9981dcd68f11e76dc5213832ac20323a6b6dd3d1 100644 (file)
@@ -830,7 +830,8 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
        skb->h.raw = skb->nh.raw;
        skb->nh.raw = skb_push(skb, gre_hlen);
        memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
-       IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE|IPSKB_XFRM_TRANSFORMED);
+       IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
+                             IPSKB_REROUTED);
        dst_release(skb->dst);
        skb->dst = &rt->u.dst;
 
index 3324fbfe528a048b279c7b7f44e25810a750dbca..57d290d89ec2b06741105c1f5eca2e103190f69f 100644 (file)
@@ -207,8 +207,10 @@ static inline int ip_finish_output(struct sk_buff *skb)
 {
 #if defined(CONFIG_NETFILTER) && defined(CONFIG_XFRM)
        /* Policy lookup after SNAT yielded a new policy */
-       if (skb->dst->xfrm != NULL)
-               return xfrm4_output_finish(skb);
+       if (skb->dst->xfrm != NULL) {
+               IPCB(skb)->flags |= IPSKB_REROUTED;
+               return dst_output(skb);
+       }
 #endif
        if (skb->len > dst_mtu(skb->dst) &&
            !(skb_shinfo(skb)->ufo_size || skb_shinfo(skb)->tso_size))
@@ -271,8 +273,9 @@ int ip_mc_output(struct sk_buff *skb)
                                newskb->dev, ip_dev_loopback_xmit);
        }
 
-       return NF_HOOK(PF_INET, NF_IP_POST_ROUTING, skb, NULL, skb->dev,
-                      ip_finish_output);
+       return NF_HOOK_COND(PF_INET, NF_IP_POST_ROUTING, skb, NULL, skb->dev,
+                           ip_finish_output,
+                           !(IPCB(skb)->flags & IPSKB_REROUTED));
 }
 
 int ip_output(struct sk_buff *skb)
@@ -284,8 +287,9 @@ int ip_output(struct sk_buff *skb)
        skb->dev = dev;
        skb->protocol = htons(ETH_P_IP);
 
-       return NF_HOOK(PF_INET, NF_IP_POST_ROUTING, skb, NULL, dev,
-                      ip_finish_output);
+       return NF_HOOK_COND(PF_INET, NF_IP_POST_ROUTING, skb, NULL, dev,
+                           ip_finish_output,
+                           !(IPCB(skb)->flags & IPSKB_REROUTED));
 }
 
 int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
index e5cbe72c6b80bd0e858fb3af17a674e315e3a517..03d13742a4b8484573b23b4a5c2c7995cc776a49 100644 (file)
@@ -622,7 +622,8 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
        skb->h.raw = skb->nh.raw;
        skb->nh.raw = skb_push(skb, sizeof(struct iphdr));
        memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
-       IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE|IPSKB_XFRM_TRANSFORMED);
+       IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
+                             IPSKB_REROUTED);
        dst_release(skb->dst);
        skb->dst = &rt->u.dst;
 
index 52a3d7c579076e8bc7e260534ab4876032cf04af..ed42cdc57cd95c42614d1dc70d60a2b820dc1ed9 100644 (file)
@@ -78,6 +78,47 @@ int ip_route_me_harder(struct sk_buff **pskb)
 }
 EXPORT_SYMBOL(ip_route_me_harder);
 
+#ifdef CONFIG_XFRM
+int ip_xfrm_me_harder(struct sk_buff **pskb)
+{
+       struct flowi fl;
+       unsigned int hh_len;
+       struct dst_entry *dst;
+
+       if (IPCB(*pskb)->flags & IPSKB_XFRM_TRANSFORMED)
+               return 0;
+       if (xfrm_decode_session(*pskb, &fl, AF_INET) < 0)
+               return -1;
+
+       dst = (*pskb)->dst;
+       if (dst->xfrm)
+               dst = ((struct xfrm_dst *)dst)->route;
+       dst_hold(dst);
+
+       if (xfrm_lookup(&dst, &fl, (*pskb)->sk, 0) < 0)
+               return -1;
+
+       dst_release((*pskb)->dst);
+       (*pskb)->dst = dst;
+
+       /* Change in oif may mean change in hh_len. */
+       hh_len = (*pskb)->dst->dev->hard_header_len;
+       if (skb_headroom(*pskb) < hh_len) {
+               struct sk_buff *nskb;
+
+               nskb = skb_realloc_headroom(*pskb, hh_len);
+               if (!nskb)
+                       return -1;
+               if ((*pskb)->sk)
+                       skb_set_owner_w(nskb, (*pskb)->sk);
+               kfree_skb(*pskb);
+               *pskb = nskb;
+       }
+       return 0;
+}
+EXPORT_SYMBOL(ip_xfrm_me_harder);
+#endif
+
 void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *);
 EXPORT_SYMBOL(ip_nat_decode_session);
 
index 92c54999a19d023d049af354123b096839757aad..7c3f7d380240b6fd1b00f90f9dfd87cea0b7b9b3 100644 (file)
@@ -235,19 +235,19 @@ ip_nat_out(unsigned int hooknum,
                return NF_ACCEPT;
 
        ret = ip_nat_fn(hooknum, pskb, in, out, okfn);
+#ifdef CONFIG_XFRM
        if (ret != NF_DROP && ret != NF_STOLEN
            && (ct = ip_conntrack_get(*pskb, &ctinfo)) != NULL) {
                enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo);
 
                if (ct->tuplehash[dir].tuple.src.ip !=
                    ct->tuplehash[!dir].tuple.dst.ip
-#ifdef CONFIG_XFRM
                    || ct->tuplehash[dir].tuple.src.u.all !=
                       ct->tuplehash[!dir].tuple.dst.u.all
-#endif
                    )
-                       return ip_route_me_harder(pskb) == 0 ? ret : NF_DROP;
+                       return ip_xfrm_me_harder(pskb) == 0 ? ret : NF_DROP;
        }
+#endif
        return ret;
 }
 
index 167619f638c6543aa50cc76fb1e94fefb2638ebc..6c8624a549334fc098d7987a60964a771dfb9b8f 100644 (file)
@@ -529,15 +529,10 @@ static int init_or_cleanup(int init)
                goto cleanup_localinops;
        }
 #endif
-
-       /* For use by REJECT target */
-       ip_ct_attach = __nf_conntrack_attach;
-
        return ret;
 
  cleanup:
        synchronize_net();
-       ip_ct_attach = NULL;
 #ifdef CONFIG_SYSCTL
        unregister_sysctl_table(nf_ct_ipv4_sysctl_header);
  cleanup_localinops:
index a97ed5416c28ee14ecab0ac4483c079a0c3e4c1d..e9a54ae7d6903845598db14a8e1cba54026faf1b 100644 (file)
@@ -456,7 +456,8 @@ void tcp_rcv_space_adjust(struct sock *sk)
 
                tp->rcvq_space.space = space;
 
-               if (sysctl_tcp_moderate_rcvbuf) {
+               if (sysctl_tcp_moderate_rcvbuf &&
+                   !(sk->sk_userlocks & SOCK_RCVBUF_LOCK)) {
                        int new_clamp = space;
 
                        /* Receive space grows, normalize in order to
index d4df0ddd424b2e9500d27a518c053cf0af3c4b7e..32ad229b4fedaf051746f6facb2936a2abd73af3 100644 (file)
@@ -152,10 +152,16 @@ error_nolock:
        goto out_exit;
 }
 
-int xfrm4_output_finish(struct sk_buff *skb)
+static int xfrm4_output_finish(struct sk_buff *skb)
 {
        int err;
 
+#ifdef CONFIG_NETFILTER
+       if (!skb->dst->xfrm) {
+               IPCB(skb)->flags |= IPSKB_REROUTED;
+               return dst_output(skb);
+       }
+#endif
        while (likely((err = xfrm4_output_one(skb)) == 0)) {
                nf_reset(skb);
 
@@ -178,6 +184,7 @@ int xfrm4_output_finish(struct sk_buff *skb)
 
 int xfrm4_output(struct sk_buff *skb)
 {
-       return NF_HOOK(PF_INET, NF_IP_POST_ROUTING, skb, NULL, skb->dst->dev,
-                      xfrm4_output_finish);
+       return NF_HOOK_COND(PF_INET, NF_IP_POST_ROUTING, skb, NULL, skb->dst->dev,
+                           xfrm4_output_finish,
+                           !(IPCB(skb)->flags & IPSKB_REROUTED));
 }
index fcf883183cefef002c56cdf1e4565b5382ec3ba5..21eb725e885ffe85bfa72d1f35ad9993911cd68f 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/net.h>
 #include <linux/skbuff.h>
 #include <linux/init.h>
+#include <linux/netfilter.h>
 
 #ifdef CONFIG_SYSCTL
 #include <linux/sysctl.h>
@@ -255,6 +256,7 @@ out:
 struct icmpv6_msg {
        struct sk_buff  *skb;
        int             offset;
+       uint8_t         type;
 };
 
 static int icmpv6_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb)
@@ -266,6 +268,8 @@ static int icmpv6_getfrag(void *from, char *to, int offset, int len, int odd, st
        csum = skb_copy_and_csum_bits(org_skb, msg->offset + offset,
                                      to, len, csum);
        skb->csum = csum_block_add(skb->csum, csum, odd);
+       if (!(msg->type & ICMPV6_INFOMSG_MASK))
+               nf_ct_attach(skb, org_skb);
        return 0;
 }
 
@@ -403,6 +407,7 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
 
        msg.skb = skb;
        msg.offset = skb->nh.raw - skb->data;
+       msg.type = type;
 
        len = skb->len - msg.offset;
        len = min_t(unsigned int, len, IPV6_MIN_MTU - sizeof(struct ipv6hdr) -sizeof(struct icmp6hdr));
@@ -500,6 +505,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
 
        msg.skb = skb;
        msg.offset = 0;
+       msg.type = ICMPV6_ECHO_REPLY;
 
        err = ip6_append_data(sk, icmpv6_getfrag, &msg, skb->len + sizeof(struct icmp6hdr),
                                sizeof(struct icmp6hdr), hlimit, tclass, NULL, &fl,
index c745717b4ce2165d0d8b73a415c4cf229b88df00..0e6d1d4bbd5c406e6db2a5558f10f6dd1818f82d 100644 (file)
@@ -160,6 +160,8 @@ static void send_reset(struct sk_buff *oldskb)
                                      csum_partial((char *)tcph,
                                                   sizeof(struct tcphdr), 0));
 
+       nf_ct_attach(nskb, oldskb);
+
        NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, nskb, NULL, nskb->dst->dev,
                dst_output);
 }
index 738376cf0c519cdcd3d5fbb832b525fe9a2d122d..ae20a0ec9bd8254f2e85d43fad57ac7ebafdd30a 100644 (file)
@@ -803,10 +803,7 @@ back_from_confirm:
                        err = rawv6_push_pending_frames(sk, &fl, rp);
        }
 done:
-       ip6_dst_store(sk, dst,
-                     ipv6_addr_equal(&fl.fl6_dst, &np->daddr) ?
-                     &np->daddr : NULL);
-
+       dst_release(dst);
        release_sock(sk);
 out:   
        fl6_sock_release(flowlabel);
index 890bac0d4a56a310d530156aaf89501fee7c8b4a..e3debbdb67f5a0272db139cda75eef326e0db71b 100644 (file)
@@ -343,12 +343,12 @@ static void irda_task_timer_expired(void *data)
 static void irda_device_setup(struct net_device *dev)
 {
         dev->hard_header_len = 0;
-        dev->addr_len        = 0;
+        dev->addr_len        = LAP_ALEN;
 
         dev->type            = ARPHRD_IRDA;
         dev->tx_queue_len    = 8; /* Window size + 1 s-frame */
 
-       memset(dev->broadcast, 0xff, 4);
+       memset(dev->broadcast, 0xff, LAP_ALEN);
 
        dev->mtu = 2048;
        dev->flags = IFF_NOARP;
index 07ec326c71f5b28b4eb6540d858823a6eff07fe8..f65c7a83bc5cf95d3f5884ec9391a888b59e590f 100644 (file)
@@ -696,7 +696,7 @@ irnet_daddr_to_dname(irnet_socket * self)
        {
          /* Yes !!! Get it.. */
          strlcpy(self->rname, discoveries[i].info, sizeof(self->rname));
-         self->rname[NICKNAME_MAX_LEN + 1] = '\0';
+         self->rname[sizeof(self->rname) - 1] = '\0';
          DEBUG(IRDA_SERV_INFO, "Device 0x%08x is in fact ``%s''.\n",
                self->daddr, self->rname);
          kfree(discoveries);
index 99c0a0fa4a978744258a221321c1d4fa2f6ef39c..a8e5544da93e62a7991ce75c51329543da5fd4bb 100644 (file)
@@ -102,8 +102,6 @@ config NF_CT_NETLINK
        help
          This option enables support for a netlink-based userspace interface
 
-endmenu
-
 config NETFILTER_XTABLES
        tristate "Netfilter Xtables support (required for ip_tables)"
        help
@@ -128,7 +126,7 @@ config NETFILTER_XT_TARGET_CONNMARK
        tristate  '"CONNMARK" target support'
        depends on NETFILTER_XTABLES
        depends on IP_NF_MANGLE || IP6_NF_MANGLE
-       depends on (IP_NF_CONNTRACK && IP_NF_CONNTRACK_MARK) || (NF_CONNTRACK_MARK && NF_CONNTRACK_IPV4)
+       depends on (IP_NF_CONNTRACK && IP_NF_CONNTRACK_MARK) || (NF_CONNTRACK_MARK && NF_CONNTRACK)
        help
          This option adds a `CONNMARK' target, which allows one to manipulate
          the connection mark value.  Similar to the MARK target, but
@@ -189,7 +187,7 @@ config NETFILTER_XT_MATCH_COMMENT
 config NETFILTER_XT_MATCH_CONNBYTES
        tristate  '"connbytes" per-connection counter match support'
        depends on NETFILTER_XTABLES
-       depends on (IP_NF_CONNTRACK && IP_NF_CT_ACCT) || NF_CT_ACCT
+       depends on (IP_NF_CONNTRACK && IP_NF_CT_ACCT) || (NF_CT_ACCT && NF_CONNTRACK)
        help
          This option adds a `connbytes' match, which allows you to match the
          number of bytes and/or packets for each direction within a connection.
@@ -200,7 +198,7 @@ config NETFILTER_XT_MATCH_CONNBYTES
 config NETFILTER_XT_MATCH_CONNMARK
        tristate  '"connmark" connection mark match support'
        depends on NETFILTER_XTABLES
-       depends on (IP_NF_CONNTRACK && IP_NF_CONNTRACK_MARK) || NF_CONNTRACK_MARK
+       depends on (IP_NF_CONNTRACK && IP_NF_CONNTRACK_MARK) || (NF_CONNTRACK_MARK && NF_CONNTRACK)
        help
          This option adds a `connmark' match, which allows you to match the
          connection mark value previously set for the session by `CONNMARK'. 
@@ -361,3 +359,5 @@ config NETFILTER_XT_MATCH_TCPMSS
 
          To compile it as a module, choose M here.  If unsure, say N.
 
+endmenu
+
index 0ce337a1d974da68634b351c84b09e815a968244..d622ddf08bb05d2cc23a2f6c5672d66edadb23aa 100644 (file)
@@ -1556,6 +1556,8 @@ void nf_conntrack_cleanup(void)
 {
        int i;
 
+       ip_ct_attach = NULL;
+
        /* This makes sure all current packets have passed through
           netfilter framework.  Roll on, two-stage module
           delete... */
@@ -1715,6 +1717,9 @@ int __init nf_conntrack_init(void)
                nf_ct_l3protos[i] = &nf_conntrack_generic_l3proto;
         write_unlock_bh(&nf_conntrack_lock);
 
+       /* For use by REJECT target */
+       ip_ct_attach = __nf_conntrack_attach;
+
        /* Set up fake conntrack:
            - to never be deleted, not in any hashes */
        atomic_set(&nf_conntrack_untracked.ct_general.use, 1);
index df99138c3b3b6bfcd1176b7ae3633eb0b7c396cc..6492ed66fb3c6cb033d9db835cc0eac006ce8fa3 100644 (file)
@@ -864,7 +864,9 @@ static int csum6(const struct sk_buff *skb, unsigned int dataoff)
 {
        return csum_ipv6_magic(&skb->nh.ipv6h->saddr, &skb->nh.ipv6h->daddr,
                               skb->len - dataoff, IPPROTO_TCP,
-                              skb->ip_summed == CHECKSUM_HW ? skb->csum
+                              skb->ip_summed == CHECKSUM_HW
+                              ? csum_sub(skb->csum,
+                                         skb_checksum(skb, 0, dataoff, 0))
                               : skb_checksum(skb, dataoff, skb->len - dataoff,
                                              0));
 }
index 4264dd079a16522c6673f279b91c6a8635f54a9e..831d206344e0176bf3987fc9d613cd8913dd4621 100644 (file)
@@ -161,7 +161,9 @@ static int csum6(const struct sk_buff *skb, unsigned int dataoff)
 {
        return csum_ipv6_magic(&skb->nh.ipv6h->saddr, &skb->nh.ipv6h->daddr,
                               skb->len - dataoff, IPPROTO_UDP,
-                              skb->ip_summed == CHECKSUM_HW ? skb->csum
+                              skb->ip_summed == CHECKSUM_HW
+                              ? csum_sub(skb->csum,
+                                         skb_checksum(skb, 0, dataoff, 0))
                               : skb_checksum(skb, dataoff, skb->len - dataoff,
                                              0));
 }
index 2101b45d2ec6bc2be9d4f6f46c563ccf9f58a156..6b9772d95872245b71cd305eda34f57335ac406c 100644 (file)
@@ -702,7 +702,8 @@ struct sock *netlink_getsockbyfilp(struct file *filp)
  * 0: continue
  * 1: repeat lookup - reference dropped while waiting for socket memory.
  */
-int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo)
+int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
+               long timeo, struct sock *ssk)
 {
        struct netlink_sock *nlk;
 
@@ -712,7 +713,7 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long t
            test_bit(0, &nlk->state)) {
                DECLARE_WAITQUEUE(wait, current);
                if (!timeo) {
-                       if (!nlk->pid)
+                       if (!ssk || nlk_sk(ssk)->pid == 0)
                                netlink_overrun(sk);
                        sock_put(sk);
                        kfree_skb(skb);
@@ -797,7 +798,7 @@ retry:
                kfree_skb(skb);
                return PTR_ERR(sk);
        }
-       err = netlink_attachskb(sk, skb, nonblock, timeo);
+       err = netlink_attachskb(sk, skb, nonblock, timeo, ssk);
        if (err == 1)
                goto retry;
        if (err)
index 4ae1538c54a9397505d8ae3e74eb19eba6c50337..43e72419c868b38d660fef2a89519bd9898f2a64 100644 (file)
@@ -238,7 +238,7 @@ int genl_register_family(struct genl_family *family)
                                        sizeof(struct nlattr *), GFP_KERNEL);
                if (family->attrbuf == NULL) {
                        err = -ENOMEM;
-                       goto errout;
+                       goto errout_locked;
                }
        } else
                family->attrbuf = NULL;
@@ -288,7 +288,7 @@ int genl_unregister_family(struct genl_family *family)
        return -ENOENT;
 }
 
-static inline int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
+static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
                               int *errp)
 {
        struct genl_ops *ops;
@@ -375,7 +375,7 @@ static void genl_rcv(struct sock *sk, int len)
        do {
                if (genl_trylock())
                        return;
-               netlink_run_queue(sk, &qlen, &genl_rcv_msg);
+               netlink_run_queue(sk, &qlen, genl_rcv_msg);
                genl_unlock();
        } while (qlen && genl_sock && genl_sock->sk_receive_queue.qlen);
 }
@@ -549,10 +549,8 @@ static int __init genl_init(void)
        netlink_set_nonroot(NETLINK_GENERIC, NL_NONROOT_RECV);
        genl_sock = netlink_kernel_create(NETLINK_GENERIC, GENL_MAX_ID,
                                          genl_rcv, THIS_MODULE);
-       if (genl_sock == NULL) {
+       if (genl_sock == NULL)
                panic("GENL: Cannot initialize generic netlink\n");
-               return -ENOMEM;
-       }
 
        return 0;
 
@@ -560,7 +558,6 @@ errout_register:
        genl_unregister_family(&genl_ctrl);
 errout:
        panic("GENL: Cannot register controller: %d\n", err);
-       return err;
 }
 
 subsys_initcall(genl_init);
index dbf4620768d61ee267f07fc0f0df7e47d2746c81..98ec53bd3ac7d3680d1dc682a2e0d2a04ea57b13 100644 (file)
@@ -889,7 +889,9 @@ restart:
                        xfrm_pol_put(policy);
                        if (dst)
                                dst_free(dst);
-                       goto restart;
+
+                       err = -EHOSTUNREACH;
+                       goto error;
                }
                dst->next = policy->bundles;
                policy->bundles = dst;
index d64aae85c3788e10036b772baed84217d08d1bd2..5760e057ecbac174679bedfe60de520645ec659a 100644 (file)
@@ -123,17 +123,7 @@ KBUILD_HAVE_NLS := $(shell \
      then echo yes ; \
      else echo no ; fi)
 ifeq ($(KBUILD_HAVE_NLS),no)
-  HOSTCFLAGS   += -DKBUILD_NO_NLS
-else
-  KBUILD_NEED_LINTL := $(shell \
-    if echo -e "\#include <libintl.h>\nint main(int a, char** b) { gettext(\"\"); return 0; }\n" | \
-      $(HOSTCC) $(HOSTCFLAGS) -x c - -o /dev/null> /dev/null 2>&1 ; \
-    then echo no ; \
-    else echo yes ; fi)
-  ifeq ($(KBUILD_NEED_LINTL),yes)
-    HOSTLOADLIBES_conf += -lintl
-    HOSTLOADLIBES_mconf        += -lintl
-  endif
+HOSTCFLAGS     += -DKBUILD_NO_NLS
 endif
 
 # generated files seem to need this to find local include files