]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jk/spufs into...
authorPaul Mackerras <paulus@samba.org>
Wed, 12 Mar 2008 06:13:57 +0000 (17:13 +1100)
committerPaul Mackerras <paulus@samba.org>
Wed, 12 Mar 2008 06:13:57 +0000 (17:13 +1100)
446 files changed:
.gitignore
Documentation/DocBook/kernel-api.tmpl
Documentation/controllers/memory.txt
Documentation/gpio.txt
Documentation/kprobes.txt
Documentation/pci.txt
Documentation/scsi/ChangeLog.arcmsr
MAINTAINERS
Makefile
arch/Kconfig
arch/alpha/kernel/pci_iommu.c
arch/arm/Kconfig
arch/arm/mm/pgd.c
arch/blackfin/kernel/fixed_code.S
arch/blackfin/mach-bf548/boards/ezkit.c
arch/blackfin/mach-common/entry.S
arch/cris/arch-v10/kernel/time.c
arch/cris/arch-v10/lib/string.c
arch/cris/arch-v10/lib/usercopy.c
arch/cris/arch-v32/lib/string.c
arch/cris/arch-v32/lib/usercopy.c
arch/ia64/Kconfig
arch/ia64/Makefile
arch/ia64/configs/generic_defconfig [moved from arch/ia64/defconfig with 100% similarity]
arch/ia64/hp/common/hwsw_iommu.c
arch/ia64/hp/common/sba_iommu.c
arch/ia64/hp/sim/simeth.c
arch/ia64/hp/sim/simserial.c
arch/ia64/ia32/ia32_signal.c
arch/ia64/ia32/sys_ia32.c
arch/ia64/kernel/crash.c
arch/ia64/kernel/efi.c
arch/ia64/kernel/iosapic.c
arch/ia64/kernel/irq_ia64.c
arch/ia64/kernel/kprobes.c
arch/ia64/kernel/mca.c
arch/ia64/kernel/module.c
arch/ia64/kernel/msi_ia64.c
arch/ia64/kernel/perfmon.c
arch/ia64/kernel/perfmon_default_smpl.c
arch/ia64/kernel/ptrace.c
arch/ia64/kernel/sal.c
arch/ia64/kernel/setup.c
arch/ia64/kernel/signal.c
arch/ia64/kernel/unaligned.c
arch/ia64/kernel/unwind.c
arch/ia64/mm/fault.c
arch/ia64/mm/init.c
arch/ia64/pci/fixup.c
arch/ia64/pci/pci.c
arch/ia64/sn/kernel/huberror.c
arch/ia64/sn/kernel/io_acpi_init.c
arch/ia64/sn/kernel/io_common.c
arch/ia64/sn/kernel/io_init.c
arch/ia64/sn/kernel/mca.c
arch/ia64/sn/pci/pci_dma.c
arch/ia64/sn/pci/tioca_provider.c
arch/ia64/sn/pci/tioce_provider.c
arch/m68k/kernel/entry.S
arch/m68knommu/defconfig
arch/m68knommu/kernel/syscalltable.S
arch/m68knommu/platform/68328/timers.c
arch/powerpc/Kconfig
arch/powerpc/boot/dts/mpc8377_mds.dts
arch/powerpc/boot/dts/mpc8378_mds.dts
arch/powerpc/boot/dts/mpc8379_mds.dts
arch/powerpc/boot/dts/sbc8548.dts
arch/powerpc/boot/wrapper
arch/powerpc/configs/adder875-uboot_defconfig [deleted file]
arch/powerpc/configs/adder875_defconfig [moved from arch/powerpc/configs/adder875-redboot_defconfig with 95% similarity]
arch/powerpc/kernel/head_8xx.S
arch/powerpc/platforms/83xx/mpc837x_mds.c
arch/powerpc/platforms/Kconfig
arch/powerpc/platforms/Kconfig.cputype
arch/powerpc/sysdev/qe_lib/qe.c
arch/ppc/kernel/head_8xx.S
arch/s390/Kconfig
arch/s390/defconfig
arch/s390/kernel/Makefile
arch/s390/kernel/early.c
arch/s390/kernel/ipl.c
arch/s390/kernel/process.c
arch/s390/kernel/smp.c
arch/s390/kernel/time.c
arch/sh/Kconfig
arch/sh/Makefile
arch/sh/boards/hp6xx/hp6xx_apm.c
arch/sh/boards/renesas/sh7710voipgw/Makefile [deleted file]
arch/sh/boards/renesas/sh7710voipgw/setup.c [deleted file]
arch/sh/boards/renesas/x3proto/ilsel.c
arch/sh/boards/superh/microdev/io.c
arch/sh/configs/r7780mp_defconfig
arch/sh/configs/se7780_defconfig
arch/sh/configs/sh7710voipgw_defconfig
arch/sh/kernel/cpu/init.c
arch/sh/kernel/cpu/sh4/sq.c
arch/sh/kernel/cpu/sh5/unwind.c
arch/sh/kernel/io_trapped.c
arch/sh/kernel/sh_ksyms_32.c
arch/sh/kernel/sh_ksyms_64.c
arch/sh/kernel/timers/timer-cmt.c
arch/sh/kernel/timers/timer-mtu2.c
arch/sh/kernel/topology.c
arch/sh/kernel/traps_64.c
arch/sh/lib64/c-checksum.c
arch/sh/lib64/udelay.c
arch/sh/mm/Kconfig
arch/sh/mm/init.c
arch/sh/mm/ioremap_32.c
arch/sh/mm/ioremap_64.c
arch/sh/mm/pg-sh7705.c
arch/sh/mm/tlbflush_64.c
arch/sh/tools/mach-types
arch/sparc/kernel/Makefile
arch/sparc/kernel/cpu.c
arch/sparc/kernel/ebus.c
arch/sparc/kernel/process.c
arch/sparc/kernel/una_asm.S [new file with mode: 0644]
arch/sparc/kernel/unaligned.c
arch/sparc64/Kconfig
arch/sparc64/kernel/cpu.c
arch/sparc64/kernel/process.c
arch/sparc64/solaris/conv.h
arch/sparc64/solaris/timod.c
arch/x86/Kconfig
arch/x86/Kconfig.cpu
arch/x86/kernel/cpu/cpufreq/e_powersaver.c
arch/x86/kernel/i387.c
arch/x86/kvm/lapic.c
arch/x86/kvm/mmu.c
arch/x86/kvm/paging_tmpl.h
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c
arch/x86/mm/numa_64.c
arch/x86/mm/pageattr.c
arch/x86/xen/setup.c
block/blk-barrier.c
block/blk-core.c
block/blk-map.c
block/blk-merge.c
block/blk-settings.c
block/blk-tag.c
block/blk.h
block/bsg.c
block/genhd.c
block/scsi_ioctl.c
crypto/Kconfig
crypto/Makefile
crypto/ablkcipher.c
crypto/blkcipher.c
crypto/chainiv.c
crypto/digest.c
crypto/eseqiv.c
crypto/xcbc.c
crypto/xts.c
drivers/acorn/char/defkeymap-l7200.c
drivers/ata/ahci.c
drivers/ata/libata-scsi.c
drivers/ata/pata_hpt366.c
drivers/ata/pata_hpt37x.c
drivers/ata/pata_serverworks.c
drivers/base/core.c
drivers/base/power/main.c
drivers/base/transport_class.c
drivers/block/cciss.c
drivers/block/cciss_scsi.c
drivers/block/pktcdvd.c
drivers/cdrom/cdrom.c
drivers/char/defkeymap.c_shipped
drivers/char/isicom.c
drivers/char/pcmcia/ipwireless/network.c
drivers/char/specialix.c
drivers/char/vt.c
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq_stats.c
drivers/dma/Kconfig
drivers/dma/Makefile
drivers/dma/fsldma.c [new file with mode: 0644]
drivers/dma/fsldma.h [new file with mode: 0644]
drivers/dma/ioat_dma.c
drivers/input/misc/Kconfig
drivers/isdn/hisax/hisax_fcpcipnp.c
drivers/isdn/i4l/isdn_ttyfax.c
drivers/isdn/isdnloop/isdnloop.c
drivers/md/bitmap.c
drivers/md/md.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/message/fusion/mptbase.c
drivers/message/fusion/mptsas.c
drivers/message/fusion/mptscsih.c
drivers/mfd/sm501.c
drivers/misc/thinkpad_acpi.c
drivers/mtd/ubi/build.c
drivers/mtd/ubi/ubi.h
drivers/mtd/ubi/vmt.c
drivers/mtd/ubi/vtbl.c
drivers/net/fec.c
drivers/net/pppol2tp.c
drivers/net/tun.c
drivers/net/wireless/b43legacy/main.c
drivers/net/wireless/libertas/cmdresp.c
drivers/net/wireless/p54common.c
drivers/net/wireless/p54common.h
drivers/net/wireless/rndis_wlan.c
drivers/parisc/Kconfig
drivers/parisc/ccio-dma.c
drivers/parisc/iommu-helpers.h
drivers/parisc/sba_iommu.c
drivers/pci/bus.c
drivers/pci/hotplug-pci.c
drivers/pci/hotplug/acpiphp_glue.c
drivers/pci/hotplug/cpci_hotplug_pci.c
drivers/pci/hotplug/pciehp_hpc.c
drivers/pci/hotplug/pciehp_pci.c
drivers/pci/hotplug/shpchp_pci.c
drivers/pci/probe.c
drivers/pci/quirks.c
drivers/pci/rom.c
drivers/rapidio/rio-driver.c
drivers/rtc/Kconfig
drivers/rtc/Makefile
drivers/rtc/rtc-s35390a.c [new file with mode: 0644]
drivers/s390/block/dasd_3990_erp.c
drivers/s390/block/dasd_proc.c
drivers/s390/char/defkeymap.c
drivers/s390/char/sclp_vt220.c
drivers/s390/crypto/ap_bus.c
drivers/scsi/aic94xx/aic94xx.h
drivers/scsi/aic94xx/aic94xx_hwi.h
drivers/scsi/aic94xx/aic94xx_init.c
drivers/scsi/aic94xx/aic94xx_task.c
drivers/scsi/aic94xx/aic94xx_tmf.c
drivers/scsi/arcmsr/arcmsr.h
drivers/scsi/gdth.c
drivers/scsi/gdth.h
drivers/scsi/ibmvscsi/ibmvstgt.c
drivers/scsi/libiscsi.c
drivers/scsi/libsas/sas_ata.c
drivers/scsi/libsas/sas_port.c
drivers/scsi/libsas/sas_scsi_host.c
drivers/scsi/mvsas.c
drivers/scsi/ps3rom.c
drivers/scsi/qla2xxx/qla_gs.c
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_version.h
drivers/scsi/qla4xxx/ql4_init.c
drivers/scsi/qla4xxx/ql4_os.c
drivers/scsi/scsi.c
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_tgt_lib.c
drivers/scsi/scsi_transport_iscsi.c
drivers/serial/8250_pnp.c
drivers/serial/m32r_sio.c
drivers/spi/mpc52xx_psc_spi.c
drivers/ssb/driver_pcicore.c
drivers/usb/core/Kconfig
drivers/usb/core/quirks.c
drivers/usb/core/usb.c
drivers/usb/gadget/printer.c
drivers/usb/gadget/pxa2xx_udc.c
drivers/usb/gadget/pxa2xx_udc.h
drivers/usb/host/ehci-q.c
drivers/usb/host/isp116x-hcd.c
drivers/usb/host/isp116x.h
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.h
drivers/usb/serial/mos7840.c
drivers/usb/serial/option.c
drivers/usb/storage/protocol.c
drivers/video/hitfb.c
drivers/video/pvr2fb.c
drivers/video/sm501fb.c
drivers/video/tridentfb.c
drivers/w1/masters/ds1wm.c
fs/binfmt_elf.c
fs/buffer.c
fs/cifs/CHANGES
fs/cifs/README
fs/cifs/cifs_debug.c
fs/cifs/cifs_debug.h
fs/cifs/cifs_dfs_ref.c
fs/cifs/cifs_spnego.c
fs/cifs/cifs_unicode.c
fs/cifs/cifs_unicode.h
fs/cifs/cifsacl.c
fs/cifs/cifsfs.c
fs/cifs/cifsglob.h
fs/cifs/cifsproto.h
fs/cifs/cifssmb.c
fs/cifs/connect.c
fs/cifs/dir.c
fs/cifs/dns_resolve.h
fs/cifs/fcntl.c
fs/cifs/file.c
fs/cifs/inode.c
fs/cifs/ioctl.c
fs/cifs/md4.c
fs/cifs/md5.c
fs/cifs/misc.c
fs/cifs/netmisc.c
fs/cifs/readdir.c
fs/cifs/sess.c
fs/cifs/smbdes.c
fs/cifs/transport.c
fs/cifs/xattr.c
fs/debugfs/inode.c
fs/ecryptfs/mmap.c
fs/exec.c
fs/ext3/super.c
fs/jbd/transaction.c
fs/mpage.c
fs/nfs/internal.h
fs/nfs/super.c
fs/ocfs2/aops.c
fs/ocfs2/dir.c
fs/ocfs2/dlm/dlmmaster.c
fs/ocfs2/dlmglue.c
fs/ocfs2/dlmglue.h
fs/ocfs2/heartbeat.c
fs/ocfs2/heartbeat.h
fs/ocfs2/localalloc.c
fs/proc/proc_misc.c
fs/reiserfs/super.c
fs/splice.c
fs/super.c
fs/xfs/xfs_iget.c
fs/xfs/xfs_trans_ail.c
include/asm-arm/kprobes.h
include/asm-blackfin/mmu_context.h
include/asm-blackfin/unistd.h
include/asm-cris/uaccess.h
include/asm-cris/unistd.h
include/asm-ia64/Kbuild
include/asm-ia64/hw_irq.h
include/asm-ia64/kprobes.h
include/asm-ia64/ptrace.h
include/asm-ia64/sal.h
include/asm-m68k/unistd.h
include/asm-m68knommu/machdep.h
include/asm-m68knommu/unistd.h
include/asm-mn10300/Kbuild
include/asm-powerpc/kprobes.h
include/asm-powerpc/pgtable-ppc32.h
include/asm-ppc/pgtable.h
include/asm-s390/kprobes.h
include/asm-sh/delay.h
include/asm-sparc/system.h
include/asm-sparc64/kprobes.h
include/asm-sparc64/system.h
include/asm-x86/Kbuild
include/asm-x86/kprobes.h
include/asm-x86/pgtable_32.h
include/asm-x86/pgtable_64.h
include/crypto/internal/skcipher.h
include/linux/Kbuild
include/linux/blkdev.h
include/linux/cgroup_subsys.h
include/linux/compiler.h
include/linux/debugfs.h
include/linux/delay.h
include/linux/dmaengine.h
include/linux/genhd.h
include/linux/gpio.h [new file with mode: 0644]
include/linux/iommu-helper.h
include/linux/kprobes.h
include/linux/kvm.h
include/linux/kvm_host.h
include/linux/marker.h
include/linux/memcontrol.h
include/linux/mm_types.h
include/linux/netpoll.h
include/linux/pci.h
include/linux/raid/bitmap.h
include/linux/raid/md_k.h
include/linux/sched.h
include/linux/security.h
include/linux/slub_def.h
include/linux/sm501-regs.h
include/linux/sm501.h
include/linux/usb.h
include/net/inet_sock.h
include/scsi/libsas.h
include/scsi/scsi_transport_iscsi.h
init/Kconfig
init/main.c
kernel/cgroup.c
kernel/cpuset.c
kernel/exit.c
kernel/kprobes.c
kernel/marker.c
kernel/module.c
kernel/power/process.c
kernel/res_counter.c
kernel/sched.c
kernel/sched_fair.c
kernel/sched_rt.c
kernel/signal.c
kernel/sysctl.c
lib/iommu-helper.c
lib/kobject.c
mm/Makefile
mm/allocpercpu.c
mm/hugetlb.c
mm/memcontrol.c
mm/memory.c
mm/migrate.c
mm/oom_kill.c
mm/page_alloc.c
mm/rmap.c
mm/shmem.c
mm/slub.c
mm/swap.c
mm/truncate.c
mm/vmscan.c
net/bluetooth/l2cap.c
net/core/neighbour.c
net/core/netpoll.c
net/ipv4/Kconfig
net/ipv4/ipconfig.c
net/ipv4/tcp_bic.c
net/ipv4/tcp_input.c
net/ipv6/Kconfig
net/irda/ircomm/ircomm_core.c
net/irda/irlan/irlan_common.c
net/irda/irproc.c
net/iucv/iucv.c
net/mac80211/rc80211_pid_algo.c
net/sctp/proc.c
samples/Kconfig
samples/Makefile
samples/kprobes/Makefile [new file with mode: 0644]
samples/kprobes/jprobe_example.c [new file with mode: 0644]
samples/kprobes/kprobe_example.c [new file with mode: 0644]
samples/kprobes/kretprobe_example.c [new file with mode: 0644]
scripts/checkpatch.pl
security/dummy.c
security/security.c
security/selinux/hooks.c
security/selinux/include/security.h
security/smack/smack_lsm.c
virt/kvm/ioapic.c
virt/kvm/kvm_main.c

index 8363e48cdcdc67bad8834a08ec8dd57b8cb41635..fdcce40226d7d4273a08cc4ef84bb25755a710a4 100644 (file)
@@ -53,3 +53,5 @@ cscope.*
 
 *.orig
 *.rej
+*~
+\#*#
index f31601e8bd89acba6eaef4d27c5bd45eb2928edf..dc0f30c3e5715d6801e482dc51988fe992d7bf82 100644 (file)
@@ -361,12 +361,14 @@ X!Edrivers/pnp/system.c
   <chapter id="blkdev">
      <title>Block Devices</title>
 !Eblock/blk-core.c
+!Iblock/blk-core.c
 !Eblock/blk-map.c
 !Iblock/blk-sysfs.c
 !Eblock/blk-settings.c
 !Eblock/blk-exec.c
 !Eblock/blk-barrier.c
 !Eblock/blk-tag.c
+!Iblock/blk-tag.c
   </chapter>
 
   <chapter id="chrdev">
index 6015347b41e2676378be5fc029444b35a2ae3664..866b9cd9a9590d6b6b8c3d577038e8d51234082b 100644 (file)
@@ -1,4 +1,8 @@
-Memory Controller
+Memory Resource Controller
+
+NOTE: The Memory Resource Controller has been generically been referred
+to as the memory controller in this document. Do not confuse memory controller
+used here with the memory controller that is used in hardware.
 
 Salient features
 
@@ -152,7 +156,7 @@ The memory controller uses the following hierarchy
 
 a. Enable CONFIG_CGROUPS
 b. Enable CONFIG_RESOURCE_COUNTERS
-c. Enable CONFIG_CGROUP_MEM_CONT
+c. Enable CONFIG_CGROUP_MEM_RES_CTLR
 
 1. Prepare the cgroups
 # mkdir -p /cgroups
@@ -164,7 +168,7 @@ c. Enable CONFIG_CGROUP_MEM_CONT
 
 Since now we're in the 0 cgroup,
 We can alter the memory limit:
-# echo -n 4M > /cgroups/0/memory.limit_in_bytes
+# echo 4M > /cgroups/0/memory.limit_in_bytes
 
 NOTE: We can use a suffix (k, K, m, M, g or G) to indicate values in kilo,
 mega or gigabytes.
@@ -185,7 +189,7 @@ number of factors, such as rounding up to page boundaries or the total
 availability of memory on the system.  The user is required to re-read
 this file after a write to guarantee the value committed by the kernel.
 
-# echo -n 1 > memory.limit_in_bytes
+# echo 1 > memory.limit_in_bytes
 # cat memory.limit_in_bytes
 4096
 
@@ -197,7 +201,7 @@ caches, RSS and Active pages/Inactive pages are shown.
 
 The memory.force_empty gives an interface to drop *all* charges by force.
 
-# echo -n 1 > memory.force_empty
+# echo 1 > memory.force_empty
 
 will drop all charges in cgroup. Currently, this is maintained for test.
 
index 8da724e2a0ff795d450e8b0b7b61118d7bf604a6..54630095aa3c8f841c097e723eef518f660a30a7 100644 (file)
@@ -2,6 +2,9 @@ GPIO Interfaces
 
 This provides an overview of GPIO access conventions on Linux.
 
+These calls use the gpio_* naming prefix.  No other calls should use that
+prefix, or the related __gpio_* prefix.
+
 
 What is a GPIO?
 ===============
@@ -69,11 +72,13 @@ in this document, but drivers acting as clients to the GPIO interface must
 not care how it's implemented.)
 
 That said, if the convention is supported on their platform, drivers should
-use it when possible.  Platforms should declare GENERIC_GPIO support in
-Kconfig (boolean true), which multi-platform drivers can depend on when
-using the include file:
+use it when possible.  Platforms must declare GENERIC_GPIO support in their
+Kconfig (boolean true), and provide an <asm/gpio.h> file.  Drivers that can't
+work without standard GPIO calls should have Kconfig entries which depend
+on GENERIC_GPIO.  The GPIO calls are available, either as "real code" or as
+optimized-away stubs, when drivers use the include file:
 
-       #include <asm/gpio.h>
+       #include <linux/gpio.h>
 
 If you stick to this convention then it'll be easier for other developers to
 see what your code is doing, and help maintain it.
@@ -316,6 +321,9 @@ pulldowns integrated on some platforms.  Not all platforms support them,
 or support them in the same way; and any given board might use external
 pullups (or pulldowns) so that the on-chip ones should not be used.
 (When a circuit needs 5 kOhm, on-chip 100 kOhm resistors won't do.)
+Likewise drive strength (2 mA vs 20 mA) and voltage (1.8V vs 3.3V) is a
+platform-specific issue, as are models like (not) having a one-to-one
+correspondence between configurable pins and GPIOs.
 
 There are other system-specific mechanisms that are not specified here,
 like the aforementioned options for input de-glitching and wire-OR output.
index 83f515c2905a806d88276ea587da5d9ef5196c52..be89f393274fbd086a4f14b4e56bb82c0a29c76d 100644 (file)
@@ -192,7 +192,8 @@ code mapping.
 The Kprobes API includes a "register" function and an "unregister"
 function for each type of probe.  Here are terse, mini-man-page
 specifications for these functions and the associated probe handlers
-that you'll write.  See the latter half of this document for examples.
+that you'll write.  See the files in the samples/kprobes/ sub-directory
+for examples.
 
 4.1 register_kprobe
 
@@ -420,249 +421,15 @@ e. Watchpoint probes (which fire on data references).
 
 8. Kprobes Example
 
-Here's a sample kernel module showing the use of kprobes to dump a
-stack trace and selected i386 registers when do_fork() is called.
------ cut here -----
-/*kprobe_example.c*/
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/kprobes.h>
-#include <linux/sched.h>
-
-/*For each probe you need to allocate a kprobe structure*/
-static struct kprobe kp;
-
-/*kprobe pre_handler: called just before the probed instruction is executed*/
-int handler_pre(struct kprobe *p, struct pt_regs *regs)
-{
-       printk("pre_handler: p->addr=0x%p, eip=%lx, eflags=0x%lx\n",
-               p->addr, regs->eip, regs->eflags);
-       dump_stack();
-       return 0;
-}
-
-/*kprobe post_handler: called after the probed instruction is executed*/
-void handler_post(struct kprobe *p, struct pt_regs *regs, unsigned long flags)
-{
-       printk("post_handler: p->addr=0x%p, eflags=0x%lx\n",
-               p->addr, regs->eflags);
-}
-
-/* fault_handler: this is called if an exception is generated for any
- * instruction within the pre- or post-handler, or when Kprobes
- * single-steps the probed instruction.
- */
-int handler_fault(struct kprobe *p, struct pt_regs *regs, int trapnr)
-{
-       printk("fault_handler: p->addr=0x%p, trap #%dn",
-               p->addr, trapnr);
-       /* Return 0 because we don't handle the fault. */
-       return 0;
-}
-
-static int __init kprobe_init(void)
-{
-       int ret;
-       kp.pre_handler = handler_pre;
-       kp.post_handler = handler_post;
-       kp.fault_handler = handler_fault;
-       kp.symbol_name = "do_fork";
-
-       ret = register_kprobe(&kp);
-       if (ret < 0) {
-               printk("register_kprobe failed, returned %d\n", ret);
-               return ret;
-       }
-       printk("kprobe registered\n");
-       return 0;
-}
-
-static void __exit kprobe_exit(void)
-{
-       unregister_kprobe(&kp);
-       printk("kprobe unregistered\n");
-}
-
-module_init(kprobe_init)
-module_exit(kprobe_exit)
-MODULE_LICENSE("GPL");
------ cut here -----
-
-You can build the kernel module, kprobe-example.ko, using the following
-Makefile:
------ cut here -----
-obj-m := kprobe-example.o
-KDIR := /lib/modules/$(shell uname -r)/build
-PWD := $(shell pwd)
-default:
-       $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
-clean:
-       rm -f *.mod.c *.ko *.o
------ cut here -----
-
-$ make
-$ su -
-...
-# insmod kprobe-example.ko
-
-You will see the trace data in /var/log/messages and on the console
-whenever do_fork() is invoked to create a new process.
+See samples/kprobes/kprobe_example.c
 
 9. Jprobes Example
 
-Here's a sample kernel module showing the use of jprobes to dump
-the arguments of do_fork().
------ cut here -----
-/*jprobe-example.c */
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/uio.h>
-#include <linux/kprobes.h>
-
-/*
- * Jumper probe for do_fork.
- * Mirror principle enables access to arguments of the probed routine
- * from the probe handler.
- */
-
-/* Proxy routine having the same arguments as actual do_fork() routine */
-long jdo_fork(unsigned long clone_flags, unsigned long stack_start,
-             struct pt_regs *regs, unsigned long stack_size,
-             int __user * parent_tidptr, int __user * child_tidptr)
-{
-       printk("jprobe: clone_flags=0x%lx, stack_size=0x%lx, regs=0x%p\n",
-              clone_flags, stack_size, regs);
-       /* Always end with a call to jprobe_return(). */
-       jprobe_return();
-       /*NOTREACHED*/
-       return 0;
-}
-
-static struct jprobe my_jprobe = {
-       .entry = jdo_fork
-};
-
-static int __init jprobe_init(void)
-{
-       int ret;
-       my_jprobe.kp.symbol_name = "do_fork";
-
-       if ((ret = register_jprobe(&my_jprobe)) <0) {
-               printk("register_jprobe failed, returned %d\n", ret);
-               return -1;
-       }
-       printk("Planted jprobe at %p, handler addr %p\n",
-              my_jprobe.kp.addr, my_jprobe.entry);
-       return 0;
-}
-
-static void __exit jprobe_exit(void)
-{
-       unregister_jprobe(&my_jprobe);
-       printk("jprobe unregistered\n");
-}
-
-module_init(jprobe_init)
-module_exit(jprobe_exit)
-MODULE_LICENSE("GPL");
------ cut here -----
-
-Build and insert the kernel module as shown in the above kprobe
-example.  You will see the trace data in /var/log/messages and on
-the console whenever do_fork() is invoked to create a new process.
-(Some messages may be suppressed if syslogd is configured to
-eliminate duplicate messages.)
+See samples/kprobes/jprobe_example.c
 
 10. Kretprobes Example
 
-Here's a sample kernel module showing the use of return probes to
-report failed calls to sys_open().
------ cut here -----
-/*kretprobe-example.c*/
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/kprobes.h>
-#include <linux/ktime.h>
-
-/* per-instance private data */
-struct my_data {
-       ktime_t entry_stamp;
-};
-
-static const char *probed_func = "sys_open";
-
-/* Timestamp function entry. */
-static int entry_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
-{
-       struct my_data *data;
-
-       if(!current->mm)
-               return 1; /* skip kernel threads */
-
-       data = (struct my_data *)ri->data;
-       data->entry_stamp = ktime_get();
-       return 0;
-}
-
-/* If the probed function failed, log the return value and duration.
- * Duration may turn out to be zero consistently, depending upon the
- * granularity of time accounting on the platform. */
-static int return_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
-{
-       int retval = regs_return_value(regs);
-       struct my_data *data = (struct my_data *)ri->data;
-       s64 delta;
-       ktime_t now;
-
-       if (retval < 0) {
-               now = ktime_get();
-               delta = ktime_to_ns(ktime_sub(now, data->entry_stamp));
-               printk("%s: return val = %d (duration = %lld ns)\n",
-                      probed_func, retval, delta);
-       }
-       return 0;
-}
-
-static struct kretprobe my_kretprobe = {
-       .handler = return_handler,
-       .entry_handler = entry_handler,
-       .data_size = sizeof(struct my_data),
-       .maxactive = 20, /* probe up to 20 instances concurrently */
-};
-
-static int __init kretprobe_init(void)
-{
-       int ret;
-       my_kretprobe.kp.symbol_name = (char *)probed_func;
-
-       if ((ret = register_kretprobe(&my_kretprobe)) < 0) {
-               printk("register_kretprobe failed, returned %d\n", ret);
-               return -1;
-       }
-       printk("Kretprobe active on %s\n", my_kretprobe.kp.symbol_name);
-       return 0;
-}
-
-static void __exit kretprobe_exit(void)
-{
-       unregister_kretprobe(&my_kretprobe);
-       printk("kretprobe unregistered\n");
-       /* nmissed > 0 suggests that maxactive was set too low. */
-       printk("Missed probing %d instances of %s\n",
-              my_kretprobe.nmissed, probed_func);
-}
-
-module_init(kretprobe_init)
-module_exit(kretprobe_exit)
-MODULE_LICENSE("GPL");
------ cut here -----
-
-Build and insert the kernel module as shown in the above kprobe
-example.  You will see the trace data in /var/log/messages and on the
-console whenever sys_open() returns a negative value.  (Some messages
-may be suppressed if syslogd is configured to eliminate duplicate
-messages.)
+See samples/kprobes/kretprobe_example.c
 
 For additional information on Kprobes, refer to the following URLs:
 http://www-106.ibm.com/developerworks/library/l-kprobes.html?ca=dgr-lnxw42Kprobe
index 72b20c63959651ce7be7dad2f2e854c983f660e0..bb7bd27d468215826dbd616713f0d130f30be420 100644 (file)
@@ -123,7 +123,8 @@ initialization with a pointer to a structure describing the driver
 
 
 The ID table is an array of struct pci_device_id entries ending with an
-all-zero entry.  Each entry consists of:
+all-zero entry; use of the macro DECLARE_PCI_DEVICE_TABLE is the preferred
+method of declaring the table.  Each entry consists of:
 
        vendor,device   Vendor and device ID to match (or PCI_ANY_ID)
 
@@ -191,7 +192,8 @@ Tips on when/where to use the above attributes:
 
        o Do not mark the struct pci_driver.
 
-       o The ID table array should be marked __devinitdata.
+       o The ID table array should be marked __devinitconst; this is done
+         automatically if the table is declared with DECLARE_PCI_DEVICE_TABLE().
 
        o The probe() and remove() functions should be marked __devinit
          and __devexit respectively.  All initialization functions
index de2bcacfa870a6f1e3bc94369fda343db1e8b4a7..038a3e6ecaa43d5c064061734ea7e893675893e9 100644 (file)
 **                                             8.replace pci_alloc_consistent()/pci_free_consistent() with kmalloc()/kfree() in arcmsr_iop_message_xfer()
 **                                             9. fix the release of dma memory for type B in arcmsr_free_ccb_pool()
 **                                             10.fix the arcmsr_polling_hbb_ccbdone()
+** 1.20.00.15  02/27/2008      Erich Chen & Nick Cheng
+**                                             1.arcmsr_iop_message_xfer() is called from atomic context under the
+**                                             queuecommand scsi_host_template handler. James Bottomley pointed out
+**                                             that the current GFP_KERNEL|GFP_DMA flags are wrong: firstly we are in
+**                                             atomic context, secondly this memory is not used for DMA.
+**                                             Also removed some unneeded casts. Thanks to Daniel Drake <dsd@gentoo.org>
 **************************************************************************
index fed09b547336d8f86ebd033a79a6b0822b33023b..558636e3a954efc69bb6e8dfe3e5557b0a626ef9 100644 (file)
@@ -1138,6 +1138,12 @@ L:       accessrunner-general@lists.sourceforge.net
 W:     http://accessrunner.sourceforge.net/
 S:     Maintained
 
+CONTROL GROUPS (CGROUPS)
+P:     Paul Menage
+M:     menage@google.com
+L:     containers@lists.linux-foundation.org
+S:     Maintained
+
 CORETEMP HARDWARE MONITORING DRIVER
 P:     Rudolf Marek
 M:     r.marek@assembler.cz
@@ -1589,6 +1595,13 @@ L:       linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers)
 W:     http://linux-fbdev.sourceforge.net/
 S:     Maintained
 
+FREESCALE DMA DRIVER
+P;     Zhang Wei
+M:     wei.zhang@freescale.com
+L:     linuxppc-embedded@ozlabs.org
+L:     linux-kernel@vger.kernel.org
+S:     Maintained
+
 FREESCALE SOC FS_ENET DRIVER
 P:     Pantelis Antoniou
 M:     pantelis.antoniou@gmail.com
@@ -2626,6 +2639,17 @@ L:       linux-kernel@vger.kernel.org
 W:     http://www.linux-mm.org
 S:     Maintained
 
+MEMORY RESOURCE CONTROLLER
+P:     Balbir Singh
+M:     balbir@linux.vnet.ibm.com
+P:     Pavel Emelyanov
+M:     xemul@openvz.org
+P:     KAMEZAWA Hiroyuki
+M:     kamezawa.hiroyu@jp.fujitsu.com
+L:     linux-mm@kvack.org
+L:     linux-kernel@vger.kernel.org
+S:     Maintained
+
 MEI MN10300/AM33 PORT
 P:     David Howells
 M:     dhowells@redhat.com
index a22978413b6558793a9d605abf95cd65dd672699..ae78a31a9de217c31fa56023276f14c5efba852d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 25
-EXTRAVERSION = -rc3
+EXTRAVERSION = -rc4
 NAME = Funky Weasel is Jiggy wit it
 
 # *DOCUMENTATION*
index 3d72dc3fc8f52f5d822cc6c256e21fb21e2b4f61..694c9af520bbed3e9a36a6c16aa693f541b192b8 100644 (file)
@@ -27,5 +27,12 @@ config KPROBES
          for kernel debugging, non-intrusive instrumentation and testing.
          If in doubt, say "N".
 
+config KRETPROBES
+       def_bool y
+       depends on KPROBES && HAVE_KRETPROBES
+
 config HAVE_KPROBES
        def_bool n
+
+config HAVE_KRETPROBES
+       def_bool n
index 26d3789dfdd0420bc4e7ce496995138b1decda14..be6fa105cd34214d11c8b5bbf11dbc305f7ddae3 100644 (file)
@@ -31,7 +31,6 @@
 #endif
 
 #define DEBUG_NODIRECT 0
-#define DEBUG_FORCEDAC 0
 
 #define ISA_DMA_MASK           0x00ffffff
 
@@ -126,39 +125,67 @@ iommu_arena_new(struct pci_controller *hose, dma_addr_t base,
        return iommu_arena_new_node(0, hose, base, window_size, align);
 }
 
+static inline int is_span_boundary(unsigned int index, unsigned int nr,
+                                  unsigned long shift,
+                                  unsigned long boundary_size)
+{
+       shift = (shift + index) & (boundary_size - 1);
+       return shift + nr > boundary_size;
+}
+
 /* Must be called with the arena lock held */
 static long
-iommu_arena_find_pages(struct pci_iommu_arena *arena, long n, long mask)
+iommu_arena_find_pages(struct device *dev, struct pci_iommu_arena *arena,
+                      long n, long mask)
 {
        unsigned long *ptes;
        long i, p, nent;
+       int pass = 0;
+       unsigned long base;
+       unsigned long boundary_size;
+
+       BUG_ON(arena->dma_base & ~PAGE_MASK);
+       base = arena->dma_base >> PAGE_SHIFT;
+       if (dev)
+               boundary_size = ALIGN(dma_get_max_seg_size(dev) + 1, PAGE_SIZE)
+                       >> PAGE_SHIFT;
+       else
+               boundary_size = ALIGN(1UL << 32, PAGE_SIZE) >> PAGE_SHIFT;
+
+       BUG_ON(!is_power_of_2(boundary_size));
 
        /* Search forward for the first mask-aligned sequence of N free ptes */
        ptes = arena->ptes;
        nent = arena->size >> PAGE_SHIFT;
-       p = (arena->next_entry + mask) & ~mask;
+       p = ALIGN(arena->next_entry, mask + 1);
        i = 0;
+
+again:
        while (i < n && p+i < nent) {
+               if (!i && is_span_boundary(p, n, base, boundary_size)) {
+                       p = ALIGN(p + 1, mask + 1);
+                       goto again;
+               }
+
                if (ptes[p+i])
-                       p = (p + i + 1 + mask) & ~mask, i = 0;
+                       p = ALIGN(p + i + 1, mask + 1), i = 0;
                else
                        i = i + 1;
        }
 
        if (i < n) {
-                /* Reached the end.  Flush the TLB and restart the
-                   search from the beginning.  */
-               alpha_mv.mv_pci_tbi(arena->hose, 0, -1);
-
-               p = 0, i = 0;
-               while (i < n && p+i < nent) {
-                       if (ptes[p+i])
-                               p = (p + i + 1 + mask) & ~mask, i = 0;
-                       else
-                               i = i + 1;
-               }
-
-               if (i < n)
+               if (pass < 1) {
+                       /*
+                        * Reached the end.  Flush the TLB and restart
+                        * the search from the beginning.
+                       */
+                       alpha_mv.mv_pci_tbi(arena->hose, 0, -1);
+
+                       pass++;
+                       p = 0;
+                       i = 0;
+                       goto again;
+               } else
                        return -1;
        }
 
@@ -168,7 +195,8 @@ iommu_arena_find_pages(struct pci_iommu_arena *arena, long n, long mask)
 }
 
 static long
-iommu_arena_alloc(struct pci_iommu_arena *arena, long n, unsigned int align)
+iommu_arena_alloc(struct device *dev, struct pci_iommu_arena *arena, long n,
+                 unsigned int align)
 {
        unsigned long flags;
        unsigned long *ptes;
@@ -179,7 +207,7 @@ iommu_arena_alloc(struct pci_iommu_arena *arena, long n, unsigned int align)
        /* Search for N empty ptes */
        ptes = arena->ptes;
        mask = max(align, arena->align_entry) - 1;
-       p = iommu_arena_find_pages(arena, n, mask);
+       p = iommu_arena_find_pages(dev, arena, n, mask);
        if (p < 0) {
                spin_unlock_irqrestore(&arena->lock, flags);
                return -1;
@@ -229,6 +257,7 @@ pci_map_single_1(struct pci_dev *pdev, void *cpu_addr, size_t size,
        unsigned long paddr;
        dma_addr_t ret;
        unsigned int align = 0;
+       struct device *dev = pdev ? &pdev->dev : NULL;
 
        paddr = __pa(cpu_addr);
 
@@ -276,7 +305,7 @@ pci_map_single_1(struct pci_dev *pdev, void *cpu_addr, size_t size,
        /* Force allocation to 64KB boundary for ISA bridges. */
        if (pdev && pdev == isa_bridge)
                align = 8;
-       dma_ofs = iommu_arena_alloc(arena, npages, align);
+       dma_ofs = iommu_arena_alloc(dev, arena, npages, align);
        if (dma_ofs < 0) {
                printk(KERN_WARNING "pci_map_single failed: "
                       "could not allocate dma page tables\n");
@@ -563,7 +592,7 @@ sg_fill(struct device *dev, struct scatterlist *leader, struct scatterlist *end,
 
        paddr &= ~PAGE_MASK;
        npages = calc_npages(paddr + size);
-       dma_ofs = iommu_arena_alloc(arena, npages, 0);
+       dma_ofs = iommu_arena_alloc(dev, arena, npages, 0);
        if (dma_ofs < 0) {
                /* If we attempted a direct map above but failed, die.  */
                if (leader->dma_address == 0)
@@ -830,7 +859,7 @@ iommu_reserve(struct pci_iommu_arena *arena, long pg_count, long align_mask)
 
        /* Search for N empty ptes.  */
        ptes = arena->ptes;
-       p = iommu_arena_find_pages(arena, pg_count, align_mask);
+       p = iommu_arena_find_pages(NULL, arena, pg_count, align_mask);
        if (p < 0) {
                spin_unlock_irqrestore(&arena->lock, flags);
                return -1;
index 16b82e1272b03ec5bede2db88eb18f2967c8bc4d..955fc53c1c019e1c47acf52251bdb30fa36cceb1 100644 (file)
@@ -12,6 +12,7 @@ config ARM
        select SYS_SUPPORTS_APM_EMULATION
        select HAVE_OPROFILE
        select HAVE_KPROBES if (!XIP_KERNEL)
+       select HAVE_KRETPROBES if (HAVE_KPROBES)
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
index 500c9610ab3085094ec48d012610b4f557136ec1..e0f19ab91163e589562d7b070f29d673fc9ef33f 100644 (file)
@@ -75,7 +75,7 @@ no_pgd:
 void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd)
 {
        pmd_t *pmd;
-       struct page *pte;
+       pgtable_t pte;
 
        if (!pgd)
                return;
@@ -90,10 +90,8 @@ void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd)
                goto free;
        }
 
-       pte = pmd_page(*pmd);
+       pte = pmd_pgtable(*pmd);
        pmd_clear(pmd);
-       dec_zone_page_state(virt_to_page((unsigned long *)pgd), NR_PAGETABLE);
-       pte_lock_deinit(pte);
        pte_free(mm, pte);
        pmd_free(mm, pmd);
 free:
index 90262691b11a299993108608e0ad63d19feb0a63..5ed47228a39075a284e99801d7c79165f6b7367f 100644 (file)
@@ -101,9 +101,9 @@ ENDPROC (_atomic_ior32)
 
 .align 16
        /*
-        * Atomic ior, 32 bit.
+        * Atomic and, 32 bit.
         * Inputs:      P0: memory address to use
-        *              R0: value to ior
+        *              R0: value to and
         * Outputs:     R0: new contents of the memory address.
         *              R1: previous contents of the memory address.
         */
@@ -112,13 +112,13 @@ ENTRY(_atomic_and32)
        R0 = R1 & R0;
        [P0] = R0;
        rts;
-ENDPROC (_atomic_ior32)
+ENDPROC (_atomic_and32)
 
 .align 16
        /*
-        * Atomic ior, 32 bit.
+        * Atomic xor, 32 bit.
         * Inputs:      P0: memory address to use
-        *              R0: value to ior
+        *              R0: value to xor
         * Outputs:     R0: new contents of the memory address.
         *              R1: previous contents of the memory address.
         */
@@ -127,7 +127,7 @@ ENTRY(_atomic_xor32)
        R0 = R1 ^ R0;
        [P0] = R0;
        rts;
-ENDPROC (_atomic_ior32)
+ENDPROC (_atomic_xor32)
 
 .align 16
        /*
index a0950c1fd80027a0917336be24b35d202dbbdcb4..40846aa034c4a7d6bb659c47b92dc3d19d3590f1 100644 (file)
@@ -323,7 +323,7 @@ static struct platform_device bf5xx_nand_device = {
 };
 #endif
 
-#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN)
+#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
 static struct platform_device bf54x_sdh_device = {
        .name = "bfin-sdh",
        .id = 0,
@@ -636,7 +636,7 @@ static struct platform_device *ezkit_devices[] __initdata = {
        &bf5xx_nand_device,
 #endif
 
-#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN)
+#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
        &bf54x_sdh_device,
 #endif
 
index 2cbb7a0bc38efe28ca027876cb9ccd24c32950ed..cee54cebbc6592505e0ff2046a7cc94d2b792c15 100644 (file)
@@ -1369,7 +1369,7 @@ ENTRY(_sys_call_table)
        .long _sys_epoll_pwait
        .long _sys_utimensat
        .long _sys_signalfd
-       .long _sys_ni_syscall
+       .long _sys_timerfd_create
        .long _sys_eventfd      /* 350 */
        .long _sys_pread64
        .long _sys_pwrite64
@@ -1378,6 +1378,9 @@ ENTRY(_sys_call_table)
        .long _sys_get_robust_list      /* 355 */
        .long _sys_fallocate
        .long _sys_semtimedop
+       .long _sys_timerfd_settime
+       .long _sys_timerfd_gettime
+
        .rept NR_syscalls-(.-_sys_call_table)/4
        .long _sys_ni_syscall
        .endr
index 9310a7b476e95cf6353180de4e88bc8ba4f9f592..525483f0ddf89f3ec0fe0d14136710f86bbd9d6c 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/swap.h>
 #include <linux/sched.h>
 #include <linux/init.h>
-#include <linux/vmstat.h>
+#include <linux/mm.h>
 #include <asm/arch/svinto.h>
 #include <asm/types.h>
 #include <asm/signal.h>
index 7161a2bef4fe341e694780106ced3cccac5421c3..c7bd6ebdc93c0b18aa6d2e9efe213f02d01ad98c 100644 (file)
@@ -1,55 +1,59 @@
-/*#************************************************************************#*/
-/*#-------------------------------------------------------------------------*/
-/*#                                                                         */
-/*# FUNCTION NAME: memcpy()                                                 */
-/*#                                                                         */
-/*# PARAMETERS:  void* dst;   Destination address.                          */
-/*#              void* src;   Source address.                               */
-/*#              int   len;   Number of bytes to copy.                      */
-/*#                                                                         */
-/*# RETURNS:     dst.                                                       */
-/*#                                                                         */
-/*# DESCRIPTION: Copies len bytes of memory from src to dst.  No guarantees */
-/*#              about copying of overlapping memory areas. This routine is */
-/*#              very sensitive to compiler changes in register allocation. */
-/*#              Should really be rewritten to avoid this problem.          */
-/*#                                                                         */
-/*#-------------------------------------------------------------------------*/
-/*#                                                                         */
-/*# HISTORY                                                                 */
-/*#                                                                         */
-/*# DATE      NAME            CHANGES                                       */
-/*# ----      ----            -------                                       */
-/*# 941007    Kenny R         Creation                                      */
-/*# 941011    Kenny R         Lots of optimizations and inlining.           */
-/*# 941129    Ulf A           Adapted for use in libc.                      */
-/*# 950216    HP              N==0 forgotten if non-aligned src/dst.        */
-/*#                           Added some optimizations.                     */
-/*# 001025    HP              Make src and dst char *.  Align dst to       */
-/*#                          dword, not just word-if-both-src-and-dst-     */
-/*#                          are-misaligned.                               */
-/*#                                                                         */
-/*#-------------------------------------------------------------------------*/
-
-#include <linux/types.h>
-
-void *memcpy(void *pdst,
-             const void *psrc,
-             size_t pn)
+/* A memcpy for CRIS.
+   Copyright (C) 1994-2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+/* FIXME: This file should really only be used for reference, as the
+   result is somewhat depending on gcc generating what we expect rather
+   than what we describe.  An assembly file should be used instead.  */
+
+#include <stddef.h>
+
+/* Break even between movem and move16 is really at 38.7 * 2, but
+   modulo 44, so up to the next multiple of 44, we use ordinary code.  */
+#define MEMCPY_BY_BLOCK_THRESHOLD (44 * 2)
+
+/* No name ambiguities in this file.  */
+__asm__ (".syntax no_register_prefix");
+
+void *
+memcpy(void *pdst, const void *psrc, size_t pn)
 {
-  /* Ok.  Now we want the parameters put in special registers.
+  /* Now we want the parameters put in special registers.
      Make sure the compiler is able to make something useful of this.
-      As it is now: r10 -> r13; r11 -> r11 (nop); r12 -> r12 (nop).
+     As it is now: r10 -> r13; r11 -> r11 (nop); r12 -> r12 (nop).
 
-     If gcc was alright, it really would need no temporaries, and no
-     stack space to save stuff on. */
+     If gcc was allright, it really would need no temporaries, and no
+     stack space to save stuff on.  */
 
   register void *return_dst __asm__ ("r10") = pdst;
-  register char *dst __asm__ ("r13") = pdst;
-  register const char *src __asm__ ("r11") = psrc;
+  register unsigned char *dst __asm__ ("r13") = pdst;
+  register unsigned const char *src __asm__ ("r11") = psrc;
   register int n __asm__ ("r12") = pn;
-  
+
   /* When src is aligned but not dst, this makes a few extra needless
      cycles.  I believe it would take as many to check that the
      re-alignment was unnecessary.  */
@@ -59,167 +63,174 @@ void *memcpy(void *pdst,
       && n >= 3)
   {
     if ((unsigned long) dst & 1)
-    {
-      n--;
-      *(char*)dst = *(char*)src;
-      src++;
-      dst++;
-    }
+      {
+       n--;
+       *dst = *src;
+       src++;
+       dst++;
+      }
 
     if ((unsigned long) dst & 2)
-    {
-      n -= 2;
-      *(short*)dst = *(short*)src;
-      src += 2;
-      dst += 2;
-    }
+      {
+       n -= 2;
+       *(short *) dst = *(short *) src;
+       src += 2;
+       dst += 2;
+      }
   }
 
-  /* Decide which copying method to use. */
-  if (n >= 44*2)                /* Break even between movem and
-                                   move16 is at 38.7*2, but modulo 44. */
-  {
-    /* For large copies we use 'movem' */
-
-  /* It is not optimal to tell the compiler about clobbering any
-     registers; that will move the saving/restoring of those registers
-     to the function prologue/epilogue, and make non-movem sizes
-     suboptimal.
-
-      This method is not foolproof; it assumes that the "asm reg"
-     declarations at the beginning of the function really are used
-     here (beware: they may be moved to temporary registers).
-      This way, we do not have to save/move the registers around into
-     temporaries; we can safely use them straight away.
-
-      If you want to check that the allocation was right; then
-      check the equalities in the first comment.  It should say
-      "r13=r13, r11=r11, r12=r12" */
-    __asm__ volatile ("\n\
-       ;; Check that the following is true (same register names on     \n\
-       ;; both sides of equal sign, as in r8=r8):                      \n\
-       ;; %0=r13, %1=r11, %2=r12                                       \n\
-       ;;                                                              \n\
-       ;; Save the registers we'll use in the movem process            \n\
-       ;; on the stack.                                                \n\
-       subq    11*4,$sp                                                \n\
-       movem   $r10,[$sp]                                              \n\
+  /* Decide which copying method to use.  */
+  if (n >= MEMCPY_BY_BLOCK_THRESHOLD)
+    {
+      /* It is not optimal to tell the compiler about clobbering any
+        registers; that will move the saving/restoring of those registers
+        to the function prologue/epilogue, and make non-movem sizes
+        suboptimal.  */
+      __asm__ volatile
+       ("\
+        ;; GCC does promise correct register allocations, but let's    \n\
+        ;; make sure it keeps its promises.                            \n\
+        .ifnc %0-%1-%2,$r13-$r11-$r12                                  \n\
+        .error \"GCC reg alloc bug: %0-%1-%4 != $r13-$r12-$r11\"       \n\
+        .endif                                                         \n\
+                                                                       \n\
+        ;; Save the registers we'll use in the movem process           \n\
+        ;; on the stack.                                               \n\
+        subq   11*4,sp                                                 \n\
+        movem  r10,[sp]                                                \n\
                                                                        \n\
-       ;; Now we've got this:                                          \n\
-       ;; r11 - src                                                    \n\
-       ;; r13 - dst                                                    \n\
-       ;; r12 - n                                                      \n\
+        ;; Now we've got this:                                         \n\
+        ;; r11 - src                                                   \n\
+        ;; r13 - dst                                                   \n\
+        ;; r12 - n                                                     \n\
                                                                        \n\
-       ;; Update n for the first loop                                  \n\
-       subq    44,$r12                                                 \n\
+        ;; Update n for the first loop.                                \n\
+        subq    44,r12                                                 \n\
 0:                                                                     \n\
-       movem   [$r11+],$r10                                            \n\
-       subq    44,$r12                                                 \n\
-       bge     0b                                                      \n\
-       movem   $r10,[$r13+]                                            \n\
+"
+#ifdef __arch_common_v10_v32
+        /* Cater to branch offset difference between v32 and v10.  We
+           assume the branch below has an 8-bit offset.  */
+"       setf\n"
+#endif
+"       movem  [r11+],r10                                              \n\
+        subq   44,r12                                                  \n\
+        bge     0b                                                     \n\
+        movem  r10,[r13+]                                              \n\
                                                                        \n\
-       addq    44,$r12 ;; compensate for last loop underflowing n      \n\
+        ;; Compensate for last loop underflowing n.                    \n\
+        addq   44,r12                                                  \n\
                                                                        \n\
-       ;; Restore registers from stack                                 \n\
-       movem   [$sp+],$r10"
+        ;; Restore registers from stack.                               \n\
+        movem [sp+],r10"
 
-     /* Outputs */ : "=r" (dst), "=r" (src), "=r" (n) 
-     /* Inputs */ : "0" (dst), "1" (src), "2" (n));
-    
-  }
+        /* Outputs.  */
+        : "=r" (dst), "=r" (src), "=r" (n)
 
-  /* Either we directly starts copying, using dword copying
-     in a loop, or we copy as much as possible with 'movem' 
-     and then the last block (<44 bytes) is copied here.
-     This will work since 'movem' will have updated src,dst,n. */
+        /* Inputs.  */
+        : "0" (dst), "1" (src), "2" (n));
+    }
 
-  while ( n >= 16 )
-  {
-    *((long*)dst)++ = *((long*)src)++;
-    *((long*)dst)++ = *((long*)src)++;
-    *((long*)dst)++ = *((long*)src)++;
-    *((long*)dst)++ = *((long*)src)++;
-    n -= 16;
-  }
+  while (n >= 16)
+    {
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+
+      n -= 16;
+    }
 
-  /* A switch() is definitely the fastest although it takes a LOT of code.
-   * Particularly if you inline code this.
-   */
   switch (n)
-  {
+    {
     case 0:
       break;
+
     case 1:
-      *(char*)dst = *(char*)src;
+      *dst = *src;
       break;
+
     case 2:
-      *(short*)dst = *(short*)src;
+      *(short *) dst = *(short *) src;
       break;
+
     case 3:
-      *((short*)dst)++ = *((short*)src)++;
-      *(char*)dst = *(char*)src;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
       break;
+
     case 4:
-      *((long*)dst)++ = *((long*)src)++;
+      *(long *) dst = *(long *) src;
       break;
+
     case 5:
-      *((long*)dst)++ = *((long*)src)++;
-      *(char*)dst = *(char*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *dst = *src;
       break;
+
     case 6:
-      *((long*)dst)++ = *((long*)src)++;
-      *(short*)dst = *(short*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src;
       break;
+
     case 7:
-      *((long*)dst)++ = *((long*)src)++;
-      *((short*)dst)++ = *((short*)src)++;
-      *(char*)dst = *(char*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
       break;
+
     case 8:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src;
       break;
+
     case 9:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *(char*)dst = *(char*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *dst = *src;
       break;
+
     case 10:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *(short*)dst = *(short*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src;
       break;
+
     case 11:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *((short*)dst)++ = *((short*)src)++;
-      *(char*)dst = *(char*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
       break;
+
     case 12:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src;
       break;
+
     case 13:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *(char*)dst = *(char*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *dst = *src;
       break;
+
     case 14:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *(short*)dst = *(short*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src;
       break;
+
     case 15:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *((short*)dst)++ = *((short*)src)++;
-      *(char*)dst = *(char*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
       break;
-  }
+    }
 
-  return return_dst; /* destination pointer. */
-} /* memcpy() */
+  return return_dst;
+}
index b8e6c0430e5b8832b6c9a5314c4f21a371405e57..b0a608da7bd13d5eff6f2e925153dbd7c47eadb0 100644 (file)
@@ -193,7 +193,7 @@ __copy_user (void __user *pdst, const void *psrc, unsigned long pn)
    inaccessible.  */
 
 unsigned long
-__copy_user_zeroing (void __user *pdst, const void *psrc, unsigned long pn)
+__copy_user_zeroing(void *pdst, const void __user *psrc, unsigned long pn)
 {
   /* We want the parameters put in special registers.
      Make sure the compiler is able to make something useful of this.
index 6740b2cebae5169d05a09d69ad5f99851394d8bc..c7bd6ebdc93c0b18aa6d2e9efe213f02d01ad98c 100644 (file)
@@ -1,55 +1,59 @@
-/*#************************************************************************#*/
-/*#-------------------------------------------------------------------------*/
-/*#                                                                         */
-/*# FUNCTION NAME: memcpy()                                                 */
-/*#                                                                         */
-/*# PARAMETERS:  void* dst;   Destination address.                          */
-/*#              void* src;   Source address.                               */
-/*#              int   len;   Number of bytes to copy.                      */
-/*#                                                                         */
-/*# RETURNS:     dst.                                                       */
-/*#                                                                         */
-/*# DESCRIPTION: Copies len bytes of memory from src to dst.  No guarantees */
-/*#              about copying of overlapping memory areas. This routine is */
-/*#              very sensitive to compiler changes in register allocation. */
-/*#              Should really be rewritten to avoid this problem.          */
-/*#                                                                         */
-/*#-------------------------------------------------------------------------*/
-/*#                                                                         */
-/*# HISTORY                                                                 */
-/*#                                                                         */
-/*# DATE      NAME            CHANGES                                       */
-/*# ----      ----            -------                                       */
-/*# 941007    Kenny R         Creation                                      */
-/*# 941011    Kenny R         Lots of optimizations and inlining.           */
-/*# 941129    Ulf A           Adapted for use in libc.                      */
-/*# 950216    HP              N==0 forgotten if non-aligned src/dst.        */
-/*#                           Added some optimizations.                     */
-/*# 001025    HP              Make src and dst char *.  Align dst to       */
-/*#                          dword, not just word-if-both-src-and-dst-     */
-/*#                          are-misaligned.                               */
-/*#                                                                         */
-/*#-------------------------------------------------------------------------*/
-
-#include <linux/types.h>
-
-void *memcpy(void *pdst,
-             const void *psrc,
-             size_t pn)
+/* A memcpy for CRIS.
+   Copyright (C) 1994-2005 Axis Communications.
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. Neither the name of Axis Communications nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+/* FIXME: This file should really only be used for reference, as the
+   result is somewhat depending on gcc generating what we expect rather
+   than what we describe.  An assembly file should be used instead.  */
+
+#include <stddef.h>
+
+/* Break even between movem and move16 is really at 38.7 * 2, but
+   modulo 44, so up to the next multiple of 44, we use ordinary code.  */
+#define MEMCPY_BY_BLOCK_THRESHOLD (44 * 2)
+
+/* No name ambiguities in this file.  */
+__asm__ (".syntax no_register_prefix");
+
+void *
+memcpy(void *pdst, const void *psrc, size_t pn)
 {
-  /* Ok.  Now we want the parameters put in special registers.
+  /* Now we want the parameters put in special registers.
      Make sure the compiler is able to make something useful of this.
-      As it is now: r10 -> r13; r11 -> r11 (nop); r12 -> r12 (nop).
+     As it is now: r10 -> r13; r11 -> r11 (nop); r12 -> r12 (nop).
 
-     If gcc was alright, it really would need no temporaries, and no
-     stack space to save stuff on. */
+     If gcc was allright, it really would need no temporaries, and no
+     stack space to save stuff on.  */
 
   register void *return_dst __asm__ ("r10") = pdst;
-  register char *dst __asm__ ("r13") = pdst;
-  register const char *src __asm__ ("r11") = psrc;
+  register unsigned char *dst __asm__ ("r13") = pdst;
+  register unsigned const char *src __asm__ ("r11") = psrc;
   register int n __asm__ ("r12") = pn;
 
-
   /* When src is aligned but not dst, this makes a few extra needless
      cycles.  I believe it would take as many to check that the
      re-alignment was unnecessary.  */
@@ -59,161 +63,174 @@ void *memcpy(void *pdst,
       && n >= 3)
   {
     if ((unsigned long) dst & 1)
-    {
-      n--;
-      *(char*)dst = *(char*)src;
-      src++;
-      dst++;
-    }
+      {
+       n--;
+       *dst = *src;
+       src++;
+       dst++;
+      }
 
     if ((unsigned long) dst & 2)
-    {
-      n -= 2;
-      *(short*)dst = *(short*)src;
-      src += 2;
-      dst += 2;
-    }
+      {
+       n -= 2;
+       *(short *) dst = *(short *) src;
+       src += 2;
+       dst += 2;
+      }
   }
 
-  /* Decide which copying method to use.  Movem is dirt cheap, so the
-     overheap is low enough to always use the minimum block size as the
-     threshold.  */
-  if (n >= 44)
-  {
-    /* For large copies we use 'movem' */
-
-  /* It is not optimal to tell the compiler about clobbering any
-     registers; that will move the saving/restoring of those registers
-     to the function prologue/epilogue, and make non-movem sizes
-     suboptimal.  */
-    __asm__ volatile ("                                                        \n\
-        ;; Check that the register asm declaration got right.          \n\
-        ;; The GCC manual explicitly says TRT will happen.             \n\
-       .ifnc %0-%1-%2,$r13-$r11-$r12                                   \n\
-       .err                                                            \n\
-       .endif                                                          \n\
-                                                                       \n\
-       ;; Save the registers we'll use in the movem process            \n\
+  /* Decide which copying method to use.  */
+  if (n >= MEMCPY_BY_BLOCK_THRESHOLD)
+    {
+      /* It is not optimal to tell the compiler about clobbering any
+        registers; that will move the saving/restoring of those registers
+        to the function prologue/epilogue, and make non-movem sizes
+        suboptimal.  */
+      __asm__ volatile
+       ("\
+        ;; GCC does promise correct register allocations, but let's    \n\
+        ;; make sure it keeps its promises.                            \n\
+        .ifnc %0-%1-%2,$r13-$r11-$r12                                  \n\
+        .error \"GCC reg alloc bug: %0-%1-%4 != $r13-$r12-$r11\"       \n\
+        .endif                                                         \n\
                                                                        \n\
-       ;; on the stack.                                                \n\
-       subq    11*4,$sp                                                \n\
-       movem   $r10,[$sp]                                              \n\
+        ;; Save the registers we'll use in the movem process           \n\
+        ;; on the stack.                                               \n\
+        subq   11*4,sp                                                 \n\
+        movem  r10,[sp]                                                \n\
                                                                        \n\
-        ;; Now we've got this:                                         \n\
-       ;; r11 - src                                                    \n\
-       ;; r13 - dst                                                    \n\
-       ;; r12 - n                                                      \n\
+        ;; Now we've got this:                                         \n\
+        ;; r11 - src                                                   \n\
+        ;; r13 - dst                                                   \n\
+        ;; r12 - n                                                     \n\
                                                                        \n\
-        ;; Update n for the first loop                                 \n\
-        subq    44,$r12                                                        \n\
+        ;; Update n for the first loop.                                \n\
+        subq    44,r12                                                 \n\
 0:                                                                     \n\
-       movem   [$r11+],$r10                                            \n\
-        subq   44,$r12                                                 \n\
-        bge     0b                                                     \n\
-       movem   $r10,[$r13+]                                            \n\
+"
+#ifdef __arch_common_v10_v32
+        /* Cater to branch offset difference between v32 and v10.  We
+           assume the branch below has an 8-bit offset.  */
+"       setf\n"
+#endif
+"       movem  [r11+],r10                                              \n\
+        subq   44,r12                                                  \n\
+        bge     0b                                                     \n\
+        movem  r10,[r13+]                                              \n\
                                                                        \n\
-        addq   44,$r12  ;; compensate for last loop underflowing n     \n\
+        ;; Compensate for last loop underflowing n.                    \n\
+        addq   44,r12                                                  \n\
                                                                        \n\
-       ;; Restore registers from stack                                 \n\
-        movem [$sp+],$r10"
+        ;; Restore registers from stack.                               \n\
+        movem [sp+],r10"
 
-     /* Outputs */ : "=r" (dst), "=r" (src), "=r" (n)
-     /* Inputs */ : "0" (dst), "1" (src), "2" (n));
+        /* Outputs.  */
+        : "=r" (dst), "=r" (src), "=r" (n)
 
-  }
+        /* Inputs.  */
+        : "0" (dst), "1" (src), "2" (n));
+    }
 
-  /* Either we directly starts copying, using dword copying
-     in a loop, or we copy as much as possible with 'movem'
-     and then the last block (<44 bytes) is copied here.
-     This will work since 'movem' will have updated src,dst,n. */
+  while (n >= 16)
+    {
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
 
-  while ( n >= 16 )
-  {
-    *((long*)dst)++ = *((long*)src)++;
-    *((long*)dst)++ = *((long*)src)++;
-    *((long*)dst)++ = *((long*)src)++;
-    *((long*)dst)++ = *((long*)src)++;
-    n -= 16;
-  }
+      n -= 16;
+    }
 
-  /* A switch() is definitely the fastest although it takes a LOT of code.
-   * Particularly if you inline code this.
-   */
   switch (n)
-  {
+    {
     case 0:
       break;
+
     case 1:
-      *(char*)dst = *(char*)src;
+      *dst = *src;
       break;
+
     case 2:
-      *(short*)dst = *(short*)src;
+      *(short *) dst = *(short *) src;
       break;
+
     case 3:
-      *((short*)dst)++ = *((short*)src)++;
-      *(char*)dst = *(char*)src;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
       break;
+
     case 4:
-      *((long*)dst)++ = *((long*)src)++;
+      *(long *) dst = *(long *) src;
       break;
+
     case 5:
-      *((long*)dst)++ = *((long*)src)++;
-      *(char*)dst = *(char*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *dst = *src;
       break;
+
     case 6:
-      *((long*)dst)++ = *((long*)src)++;
-      *(short*)dst = *(short*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src;
       break;
+
     case 7:
-      *((long*)dst)++ = *((long*)src)++;
-      *((short*)dst)++ = *((short*)src)++;
-      *(char*)dst = *(char*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
       break;
+
     case 8:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src;
       break;
+
     case 9:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *(char*)dst = *(char*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *dst = *src;
       break;
+
     case 10:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *(short*)dst = *(short*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src;
       break;
+
     case 11:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *((short*)dst)++ = *((short*)src)++;
-      *(char*)dst = *(char*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
       break;
+
     case 12:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src;
       break;
+
     case 13:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *(char*)dst = *(char*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *dst = *src;
       break;
+
     case 14:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *(short*)dst = *(short*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src;
       break;
+
     case 15:
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *((long*)dst)++ = *((long*)src)++;
-      *((short*)dst)++ = *((short*)src)++;
-      *(char*)dst = *(char*)src;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(long *) dst = *(long *) src; dst += 4; src += 4;
+      *(short *) dst = *(short *) src; dst += 2; src += 2;
+      *dst = *src;
       break;
-  }
+    }
 
-  return return_dst; /* destination pointer. */
-} /* memcpy() */
+  return return_dst;
+}
index 04d0cf35a2761b531c1350c58ecf36e081961fb7..0b5b70d5f58a45ca2554daf64ccb4625c1ff725f 100644 (file)
@@ -161,7 +161,7 @@ __copy_user (void __user *pdst, const void *psrc, unsigned long pn)
    inaccessible.  */
 
 unsigned long
-__copy_user_zeroing (void __user *pdst, const void *psrc, unsigned long pn)
+__copy_user_zeroing(void *pdst, const void __user *psrc, unsigned long pn)
 {
   /* We want the parameters put in special registers.
      Make sure the compiler is able to make something useful of this.
index dff9edfc7465e9954bc5b16749eaa0068e88671a..8fa3faf5ef1bb0e91c32b54c6c5b7d197c920b79 100644 (file)
@@ -18,6 +18,7 @@ config IA64
        select HAVE_IDE
        select HAVE_OPROFILE
        select HAVE_KPROBES
+       select HAVE_KRETPROBES
        default y
        help
          The Itanium Processor Family is Intel's 64-bit successor to
@@ -155,6 +156,8 @@ config IA64_HP_ZX1_SWIOTLB
 
 config IA64_SGI_SN2
        bool "SGI-SN2"
+       select NUMA
+       select ACPI_NUMA
        help
          Selecting this option will optimize the kernel for use on sn2 based
          systems, but the resulting kernel binary will not run on other
index b916ccfdef843f158f1814cc74d278d389dcec70..f1645c4f70393c5294ecc9148300c8368178d5f5 100644 (file)
@@ -11,6 +11,8 @@
 # Copyright (C) 1998-2004 by David Mosberger-Tang <davidm@hpl.hp.com>
 #
 
+KBUILD_DEFCONFIG := generic_defconfig
+
 NM := $(CROSS_COMPILE)nm -B
 READELF := $(CROSS_COMPILE)readelf
 
index 94e57109fad658d060542aea2ed9f51bd1d230db..8f6bcfe1dadaa0fab0ec16fd2734ddf87d916450 100644 (file)
@@ -71,7 +71,7 @@ hwsw_init (void)
 #ifdef CONFIG_IA64_GENERIC
                /* Better to have normal DMA than panic */
                printk(KERN_WARNING "%s: Failed to initialize software I/O TLB,"
-                      " reverting to hpzx1 platform vector\n", __FUNCTION__);
+                      " reverting to hpzx1 platform vector\n", __func__);
                machvec_init("hpzx1");
 #else
                panic("Unable to initialize software I/O TLB services");
index a94445422cc65d895eb76e4a417897bf067556d9..523eae6d3e49f1177a20c0d72ad8d3d8d4461a14 100644 (file)
@@ -529,7 +529,7 @@ sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted, int use_hint)
                base_mask = RESMAP_MASK(bits_wanted);
                mask = base_mask << bitshiftcnt;
 
-               DBG_RES("%s() o %ld %p", __FUNCTION__, o, res_ptr);
+               DBG_RES("%s() o %ld %p", __func__, o, res_ptr);
                for(; res_ptr < res_end ; res_ptr++)
                { 
                        DBG_RES("    %p %lx %lx\n", res_ptr, mask, *res_ptr);
@@ -679,7 +679,7 @@ sba_alloc_range(struct ioc *ioc, size_t size)
 #endif
 
        DBG_RES("%s(%x) %d -> %lx hint %x/%x\n",
-               __FUNCTION__, size, pages_needed, pide,
+               __func__, size, pages_needed, pide,
                (uint) ((unsigned long) ioc->res_hint - (unsigned long) ioc->res_map),
                ioc->res_bitshift );
 
@@ -722,8 +722,8 @@ sba_free_range(struct ioc *ioc, dma_addr_t iova, size_t size)
                        m = RESMAP_MASK(bits_not_wanted) << (pide & (BITS_PER_LONG - 1));
                        bits_not_wanted = 0;
 
-                       DBG_RES("%s( ,%x,%x) %x/%lx %x %p %lx\n", __FUNCTION__, (uint) iova, size,
-                               bits_not_wanted, m, pide, res_ptr, *res_ptr);
+                       DBG_RES("%s( ,%x,%x) %x/%lx %x %p %lx\n", __func__, (uint) iova, size,
+                               bits_not_wanted, m, pide, res_ptr, *res_ptr);
 
                        ASSERT(m != 0);
                        ASSERT(bits_not_wanted);
@@ -940,8 +940,7 @@ sba_map_single(struct device *dev, void *addr, size_t size, int dir)
 
        iovp = (dma_addr_t) pide << iovp_shift;
 
-       DBG_RUN("%s() 0x%p -> 0x%lx\n",
-               __FUNCTION__, addr, (long) iovp | offset);
+       DBG_RUN("%s() 0x%p -> 0x%lx\n", __func__, addr, (long) iovp | offset);
 
        pdir_start = &(ioc->pdir_base[pide]);
 
@@ -1029,8 +1028,7 @@ void sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size, int dir)
 #endif
        offset = iova & ~iovp_mask;
 
-       DBG_RUN("%s() iovp 0x%lx/%x\n",
-               __FUNCTION__, (long) iova, size);
+       DBG_RUN("%s() iovp 0x%lx/%x\n", __func__, (long) iova, size);
 
        iova ^= offset;        /* clear offset bits */
        size += offset;
@@ -1404,7 +1402,7 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di
        struct scatterlist *sg;
 #endif
 
-       DBG_RUN_SG("%s() START %d entries\n", __FUNCTION__, nents);
+       DBG_RUN_SG("%s() START %d entries\n", __func__, nents);
        ioc = GET_IOC(dev);
        ASSERT(ioc);
 
@@ -1468,7 +1466,7 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di
 #endif
 
        ASSERT(coalesced == filled);
-       DBG_RUN_SG("%s() DONE %d mappings\n", __FUNCTION__, filled);
+       DBG_RUN_SG("%s() DONE %d mappings\n", __func__, filled);
 
        return filled;
 }
@@ -1491,7 +1489,7 @@ void sba_unmap_sg (struct device *dev, struct scatterlist *sglist, int nents, in
 #endif
 
        DBG_RUN_SG("%s() START %d entries,  %p,%x\n",
-               __FUNCTION__, nents, sba_sg_address(sglist), sglist->length);
+                  __func__, nents, sba_sg_address(sglist), sglist->length);
 
 #ifdef ASSERT_PDIR_SANITY
        ioc = GET_IOC(dev);
@@ -1509,7 +1507,7 @@ void sba_unmap_sg (struct device *dev, struct scatterlist *sglist, int nents, in
                nents--;
        }
 
-       DBG_RUN_SG("%s() DONE (nents %d)\n", __FUNCTION__,  nents);
+       DBG_RUN_SG("%s() DONE (nents %d)\n", __func__,  nents);
 
 #ifdef ASSERT_PDIR_SANITY
        spin_lock_irqsave(&ioc->res_lock, flags);
@@ -1546,7 +1544,7 @@ ioc_iova_init(struct ioc *ioc)
        ioc->iov_size = ~ioc->imask + 1;
 
        DBG_INIT("%s() hpa %p IOV base 0x%lx mask 0x%lx (%dMB)\n",
-               __FUNCTION__, ioc->ioc_hpa, ioc->ibase, ioc->imask,
+               __func__, ioc->ioc_hpa, ioc->ibase, ioc->imask,
                ioc->iov_size >> 20);
 
        switch (iovp_size) {
@@ -1569,7 +1567,7 @@ ioc_iova_init(struct ioc *ioc)
 
        memset(ioc->pdir_base, 0, ioc->pdir_size);
 
-       DBG_INIT("%s() IOV page size %ldK pdir %p size %x\n", __FUNCTION__,
+       DBG_INIT("%s() IOV page size %ldK pdir %p size %x\n", __func__,
                iovp_size >> 10, ioc->pdir_base, ioc->pdir_size);
 
        ASSERT(ALIGN((unsigned long) ioc->pdir_base, 4*1024) == (unsigned long) ioc->pdir_base);
@@ -1612,7 +1610,7 @@ ioc_iova_init(struct ioc *ioc)
 
                prefetch_spill_page = virt_to_phys(addr);
 
-               DBG_INIT("%s() prefetch spill addr: 0x%lx\n", __FUNCTION__, prefetch_spill_page);
+               DBG_INIT("%s() prefetch spill addr: 0x%lx\n", __func__, prefetch_spill_page);
        }
        /*
        ** Set all the PDIR entries valid w/ the spill page as the target
@@ -1641,7 +1639,7 @@ ioc_resource_init(struct ioc *ioc)
        /* resource map size dictated by pdir_size */
        ioc->res_size = ioc->pdir_size / PDIR_ENTRY_SIZE; /* entries */
        ioc->res_size >>= 3;  /* convert bit count to byte count */
-       DBG_INIT("%s() res_size 0x%x\n", __FUNCTION__, ioc->res_size);
+       DBG_INIT("%s() res_size 0x%x\n", __func__, ioc->res_size);
 
        ioc->res_map = (char *) __get_free_pages(GFP_KERNEL,
                                                 get_order(ioc->res_size));
@@ -1664,7 +1662,7 @@ ioc_resource_init(struct ioc *ioc)
                                                              | prefetch_spill_page);
 #endif
 
-       DBG_INIT("%s() res_map %x %p\n", __FUNCTION__,
+       DBG_INIT("%s() res_map %x %p\n", __func__,
                 ioc->res_size, (void *) ioc->res_map);
 }
 
@@ -1767,7 +1765,7 @@ ioc_init(u64 hpa, void *handle)
        iovp_size = (1 << iovp_shift);
        iovp_mask = ~(iovp_size - 1);
 
-       DBG_INIT("%s: PAGE_SIZE %ldK, iovp_size %ldK\n", __FUNCTION__,
+       DBG_INIT("%s: PAGE_SIZE %ldK, iovp_size %ldK\n", __func__,
                PAGE_SIZE >> 10, iovp_size >> 10);
 
        if (!ioc->name) {
@@ -2137,7 +2135,7 @@ sba_page_override(char *str)
                        break;
                default:
                        printk("%s: unknown/unsupported iommu page size %ld\n",
-                              __FUNCTION__, page_size);
+                              __func__, page_size);
        }
 
        return 1;
index 9898febf609a34b8073f288295d1f24446931621..969fe9f443c4f69883949e6a3b64d74cb46da8ad 100644 (file)
@@ -222,7 +222,7 @@ simeth_probe1(void)
        }
 
        if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
-               panic("%s: out of interrupt vectors!\n", __FUNCTION__);
+               panic("%s: out of interrupt vectors!\n", __func__);
        dev->irq = rc;
 
        /*
index ef252df50e1e7a32097d881957e83b307cb167a2..eb0c32a85fd737c3154a016a609cd99b13216266 100644 (file)
@@ -1000,7 +1000,7 @@ simrs_init (void)
                if (!state->irq) {
                        if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
                                panic("%s: out of interrupt vectors!\n",
-                                     __FUNCTION__);
+                                     __func__);
                        state->irq = rc;
                        ia64_ssc_connect_irq(KEYBOARD_INTR, state->irq);
                }
index 85e82f32e480c4707de98d4fcdb73e801f2ebc95..256a7faeda0787fc7ba6df9f48d0899dc0add99a 100644 (file)
@@ -766,8 +766,19 @@ get_sigframe (struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 
        /* This is the X/Open sanctioned signal stack switching.  */
        if (ka->sa.sa_flags & SA_ONSTACK) {
-               if (!on_sig_stack(esp))
+               int onstack = sas_ss_flags(esp);
+
+               if (onstack == 0)
                        esp = current->sas_ss_sp + current->sas_ss_size;
+               else if (onstack == SS_ONSTACK) {
+                       /*
+                        * If we are on the alternate signal stack and would
+                        * overflow it, don't. Return an always-bogus address
+                        * instead so we will die with SIGSEGV.
+                        */
+                       if (!likely(on_sig_stack(esp - frame_size)))
+                               return (void __user *) -1L;
+               }
        }
        /* Legacy stack switching not supported */
 
index d025a22eb225f6bf455ec5a76b47434dc09a0977..b1bf51fe97b47cc66b32cd889431c5ae9af1b3b3 100644 (file)
 #include <linux/shm.h>
 #include <linux/slab.h>
 #include <linux/uio.h>
-#include <linux/nfs_fs.h>
+#include <linux/socket.h>
 #include <linux/quota.h>
-#include <linux/sunrpc/svc.h>
-#include <linux/nfsd/nfsd.h>
-#include <linux/nfsd/cache.h>
-#include <linux/nfsd/xdr.h>
-#include <linux/nfsd/syscall.h>
 #include <linux/poll.h>
 #include <linux/eventpoll.h>
 #include <linux/personality.h>
index f1cf2df97a2d3f2602e2da6432f3e348567fe5f7..fbe742ad2fdeb2e26b3598abf00ae580ccae1aff 100644 (file)
@@ -155,7 +155,7 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data)
                if (val == DIE_INIT_MONARCH_LEAVE)
                        ia64_mca_printk(KERN_NOTICE
                                        "%s: kdump not configured\n",
-                                       __FUNCTION__);
+                                       __func__);
                return NOTIFY_DONE;
        }
 
index 919070a9aed7184c87ea43d83855963bb170d40e..728d7247a1a69688da32f12386d8fcb2165a1439 100644 (file)
@@ -379,8 +379,8 @@ efi_get_pal_addr (void)
                 * a dedicated ITR for the PAL code.
                 */
                if ((vaddr & mask) == (KERNEL_START & mask)) {
-                       printk(KERN_INFO "%s: no need to install ITR for "
-                              "PAL code\n", __FUNCTION__);
+                       printk(KERN_INFO "%s: no need to install ITR for PAL code\n",
+                              __func__);
                        continue;
                }
 
@@ -399,7 +399,7 @@ efi_get_pal_addr (void)
                return __va(md->phys_addr);
        }
        printk(KERN_WARNING "%s: no PAL-code memory-descriptor found\n",
-              __FUNCTION__);
+              __func__);
        return NULL;
 }
 
@@ -543,12 +543,30 @@ efi_init (void)
                for (i = 0, p = efi_map_start; p < efi_map_end;
                     ++i, p += efi_desc_size)
                {
+                       const char *unit;
+                       unsigned long size;
+
                        md = p;
-                       printk("mem%02u: type=%u, attr=0x%lx, "
-                              "range=[0x%016lx-0x%016lx) (%luMB)\n",
+                       size = md->num_pages << EFI_PAGE_SHIFT;
+
+                       if ((size >> 40) > 0) {
+                               size >>= 40;
+                               unit = "TB";
+                       } else if ((size >> 30) > 0) {
+                               size >>= 30;
+                               unit = "GB";
+                       } else if ((size >> 20) > 0) {
+                               size >>= 20;
+                               unit = "MB";
+                       } else {
+                               size >>= 10;
+                               unit = "KB";
+                       }
+
+                       printk("mem%02d: type=%2u, attr=0x%016lx, "
+                              "range=[0x%016lx-0x%016lx) (%4lu%s)\n",
                               i, md->type, md->attribute, md->phys_addr,
-                              md->phys_addr + efi_md_size(md),
-                              md->num_pages >> (20 - EFI_PAGE_SHIFT));
+                              md->phys_addr + efi_md_size(md), size, unit);
                }
        }
 #endif
index 398e2fd1cd2519ef2d6a2186308cd992073b0ec5..082c31dcfd998d83448d52559161805ca240be49 100644 (file)
@@ -345,7 +345,7 @@ iosapic_set_affinity (unsigned int irq, cpumask_t mask)
        if (cpus_empty(mask))
                return;
 
-       if (reassign_irq_vector(irq, first_cpu(mask)))
+       if (irq_prepare_move(irq, first_cpu(mask)))
                return;
 
        dest = cpu_physical_id(first_cpu(mask));
@@ -397,6 +397,7 @@ iosapic_end_level_irq (unsigned int irq)
        struct iosapic_rte_info *rte;
        int do_unmask_irq = 0;
 
+       irq_complete_move(irq);
        if (unlikely(irq_desc[irq].status & IRQ_MOVE_PENDING)) {
                do_unmask_irq = 1;
                mask_irq(irq);
@@ -450,6 +451,7 @@ iosapic_ack_edge_irq (unsigned int irq)
 {
        irq_desc_t *idesc = irq_desc + irq;
 
+       irq_complete_move(irq);
        move_native_irq(irq);
        /*
         * Once we have recorded IRQ_PENDING already, we can mask the
@@ -532,7 +534,7 @@ iosapic_reassign_vector (int irq)
        if (iosapic_intr_info[irq].count) {
                new_irq = create_irq();
                if (new_irq < 0)
-                       panic("%s: out of interrupt vectors!\n", __FUNCTION__);
+                       panic("%s: out of interrupt vectors!\n", __func__);
                printk(KERN_INFO "Reassigning vector %d to %d\n",
                       irq_to_vector(irq), irq_to_vector(new_irq));
                memcpy(&iosapic_intr_info[new_irq], &iosapic_intr_info[irq],
@@ -597,7 +599,7 @@ register_intr (unsigned int gsi, int irq, unsigned char delivery,
        index = find_iosapic(gsi);
        if (index < 0) {
                printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n",
-                      __FUNCTION__, gsi);
+                      __func__, gsi);
                return -ENODEV;
        }
 
@@ -606,7 +608,7 @@ register_intr (unsigned int gsi, int irq, unsigned char delivery,
                rte = iosapic_alloc_rte();
                if (!rte) {
                        printk(KERN_WARNING "%s: cannot allocate memory\n",
-                              __FUNCTION__);
+                              __func__);
                        return -ENOMEM;
                }
 
@@ -623,7 +625,7 @@ register_intr (unsigned int gsi, int irq, unsigned char delivery,
                    (info->trigger != trigger || info->polarity != polarity)){
                        printk (KERN_WARNING
                                "%s: cannot override the interrupt\n",
-                               __FUNCTION__);
+                               __func__);
                        return -EINVAL;
                }
                rte->refcnt++;
@@ -645,7 +647,7 @@ register_intr (unsigned int gsi, int irq, unsigned char delivery,
                if (idesc->chip != &no_irq_type)
                        printk(KERN_WARNING
                               "%s: changing vector %d from %s to %s\n",
-                              __FUNCTION__, irq_to_vector(irq),
+                              __func__, irq_to_vector(irq),
                               idesc->chip->name, irq_type->name);
                idesc->chip = irq_type;
        }
@@ -918,7 +920,7 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
              case ACPI_INTERRUPT_INIT:
                irq = create_irq();
                if (irq < 0)
-                       panic("%s: out of interrupt vectors!\n", __FUNCTION__);
+                       panic("%s: out of interrupt vectors!\n", __func__);
                vector = irq_to_vector(irq);
                delivery = IOSAPIC_INIT;
                break;
@@ -929,7 +931,7 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
                mask = 1;
                break;
              default:
-               printk(KERN_ERR "%s: invalid int type 0x%x\n", __FUNCTION__,
+               printk(KERN_ERR "%s: invalid int type 0x%x\n", __func__,
                       int_type);
                return -1;
        }
@@ -994,7 +996,7 @@ iosapic_system_init (int system_pcat_compat)
                 */
                printk(KERN_INFO
                       "%s: Disabling PC-AT compatible 8259 interrupts\n",
-                      __FUNCTION__);
+                      __func__);
                outb(0xff, 0xA1);
                outb(0xff, 0x21);
        }
@@ -1009,7 +1011,7 @@ iosapic_alloc (void)
                if (!iosapic_lists[index].addr)
                        return index;
 
-       printk(KERN_WARNING "%s: failed to allocate iosapic\n", __FUNCTION__);
+       printk(KERN_WARNING "%s: failed to allocate iosapic\n", __func__);
        return -1;
 }
 
@@ -1107,14 +1109,14 @@ iosapic_remove (unsigned int gsi_base)
        index = find_iosapic(gsi_base);
        if (index < 0) {
                printk(KERN_WARNING "%s: No IOSAPIC for GSI base %u\n",
-                      __FUNCTION__, gsi_base);
+                      __func__, gsi_base);
                goto out;
        }
 
        if (iosapic_lists[index].rtes_inuse) {
                err = -EBUSY;
                printk(KERN_WARNING "%s: IOSAPIC for GSI base %u is busy\n",
-                      __FUNCTION__, gsi_base);
+                      __func__, gsi_base);
                goto out;
        }
 
@@ -1135,7 +1137,7 @@ map_iosapic_to_node(unsigned int gsi_base, int node)
        index = find_iosapic(gsi_base);
        if (index < 0) {
                printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n",
-                      __FUNCTION__, gsi_base);
+                      __func__, gsi_base);
                return;
        }
        iosapic_lists[index].node = node;
index 0b52f19ed04615b8f637e2ee496fa8c488b5546c..d8be23fbe6bc7bbf0668a01f55fe3dd7813a6f29 100644 (file)
@@ -260,6 +260,8 @@ void __setup_vector_irq(int cpu)
 }
 
 #if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG))
+#define IA64_IRQ_MOVE_VECTOR   IA64_DEF_FIRST_DEVICE_VECTOR
+
 static enum vector_domain_type {
        VECTOR_DOMAIN_NONE,
        VECTOR_DOMAIN_PERCPU
@@ -272,6 +274,101 @@ static cpumask_t vector_allocation_domain(int cpu)
        return CPU_MASK_ALL;
 }
 
+static int __irq_prepare_move(int irq, int cpu)
+{
+       struct irq_cfg *cfg = &irq_cfg[irq];
+       int vector;
+       cpumask_t domain;
+
+       if (cfg->move_in_progress || cfg->move_cleanup_count)
+               return -EBUSY;
+       if (cfg->vector == IRQ_VECTOR_UNASSIGNED || !cpu_online(cpu))
+               return -EINVAL;
+       if (cpu_isset(cpu, cfg->domain))
+               return 0;
+       domain = vector_allocation_domain(cpu);
+       vector = find_unassigned_vector(domain);
+       if (vector < 0)
+               return -ENOSPC;
+       cfg->move_in_progress = 1;
+       cfg->old_domain = cfg->domain;
+       cfg->vector = IRQ_VECTOR_UNASSIGNED;
+       cfg->domain = CPU_MASK_NONE;
+       BUG_ON(__bind_irq_vector(irq, vector, domain));
+       return 0;
+}
+
+int irq_prepare_move(int irq, int cpu)
+{
+       unsigned long flags;
+       int ret;
+
+       spin_lock_irqsave(&vector_lock, flags);
+       ret = __irq_prepare_move(irq, cpu);
+       spin_unlock_irqrestore(&vector_lock, flags);
+       return ret;
+}
+
+void irq_complete_move(unsigned irq)
+{
+       struct irq_cfg *cfg = &irq_cfg[irq];
+       cpumask_t cleanup_mask;
+       int i;
+
+       if (likely(!cfg->move_in_progress))
+               return;
+
+       if (unlikely(cpu_isset(smp_processor_id(), cfg->old_domain)))
+               return;
+
+       cpus_and(cleanup_mask, cfg->old_domain, cpu_online_map);
+       cfg->move_cleanup_count = cpus_weight(cleanup_mask);
+       for_each_cpu_mask(i, cleanup_mask)
+               platform_send_ipi(i, IA64_IRQ_MOVE_VECTOR, IA64_IPI_DM_INT, 0);
+       cfg->move_in_progress = 0;
+}
+
+static irqreturn_t smp_irq_move_cleanup_interrupt(int irq, void *dev_id)
+{
+       int me = smp_processor_id();
+       ia64_vector vector;
+       unsigned long flags;
+
+       for (vector = IA64_FIRST_DEVICE_VECTOR;
+            vector < IA64_LAST_DEVICE_VECTOR; vector++) {
+               int irq;
+               struct irq_desc *desc;
+               struct irq_cfg *cfg;
+               irq = __get_cpu_var(vector_irq)[vector];
+               if (irq < 0)
+                       continue;
+
+               desc = irq_desc + irq;
+               cfg = irq_cfg + irq;
+               spin_lock(&desc->lock);
+               if (!cfg->move_cleanup_count)
+                       goto unlock;
+
+               if (!cpu_isset(me, cfg->old_domain))
+                       goto unlock;
+
+               spin_lock_irqsave(&vector_lock, flags);
+               __get_cpu_var(vector_irq)[vector] = -1;
+               cpu_clear(me, vector_table[vector]);
+               spin_unlock_irqrestore(&vector_lock, flags);
+               cfg->move_cleanup_count--;
+       unlock:
+               spin_unlock(&desc->lock);
+       }
+       return IRQ_HANDLED;
+}
+
+static struct irqaction irq_move_irqaction = {
+       .handler =      smp_irq_move_cleanup_interrupt,
+       .flags =        IRQF_DISABLED,
+       .name =         "irq_move"
+};
+
 static int __init parse_vector_domain(char *arg)
 {
        if (!arg)
@@ -303,36 +400,6 @@ void destroy_and_reserve_irq(unsigned int irq)
        spin_unlock_irqrestore(&vector_lock, flags);
 }
 
-static int __reassign_irq_vector(int irq, int cpu)
-{
-       struct irq_cfg *cfg = &irq_cfg[irq];
-       int vector;
-       cpumask_t domain;
-
-       if (cfg->vector == IRQ_VECTOR_UNASSIGNED || !cpu_online(cpu))
-               return -EINVAL;
-       if (cpu_isset(cpu, cfg->domain))
-               return 0;
-       domain = vector_allocation_domain(cpu);
-       vector = find_unassigned_vector(domain);
-       if (vector < 0)
-               return -ENOSPC;
-       __clear_irq_vector(irq);
-       BUG_ON(__bind_irq_vector(irq, vector, domain));
-       return 0;
-}
-
-int reassign_irq_vector(int irq, int cpu)
-{
-       unsigned long flags;
-       int ret;
-
-       spin_lock_irqsave(&vector_lock, flags);
-       ret = __reassign_irq_vector(irq, cpu);
-       spin_unlock_irqrestore(&vector_lock, flags);
-       return ret;
-}
-
 /*
  * Dynamic irq allocate and deallocation for MSI
  */
@@ -440,7 +507,7 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
                        if (unlikely(irq < 0)) {
                                printk(KERN_ERR "%s: Unexpected interrupt "
                                       "vector %d on CPU %d is not mapped "
-                                      "to any IRQ!\n", __FUNCTION__, vector,
+                                      "to any IRQ!\n", __func__, vector,
                                       smp_processor_id());
                        } else
                                generic_handle_irq(irq);
@@ -505,7 +572,7 @@ void ia64_process_pending_intr(void)
                        if (unlikely(irq < 0)) {
                                printk(KERN_ERR "%s: Unexpected interrupt "
                                       "vector %d on CPU %d not being mapped "
-                                      "to any IRQ!!\n", __FUNCTION__, vector,
+                                      "to any IRQ!!\n", __func__, vector,
                                       smp_processor_id());
                        } else {
                                vectors_in_migration[irq]=0;
@@ -578,6 +645,13 @@ init_IRQ (void)
        register_percpu_irq(IA64_IPI_VECTOR, &ipi_irqaction);
        register_percpu_irq(IA64_IPI_RESCHEDULE, &resched_irqaction);
        register_percpu_irq(IA64_IPI_LOCAL_TLB_FLUSH, &tlb_irqaction);
+#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG)
+       if (vector_domain_type != VECTOR_DOMAIN_NONE) {
+               BUG_ON(IA64_FIRST_DEVICE_VECTOR != IA64_IRQ_MOVE_VECTOR);
+               IA64_FIRST_DEVICE_VECTOR++;
+               register_percpu_irq(IA64_IRQ_MOVE_VECTOR, &irq_move_irqaction);
+       }
+#endif
 #endif
 #ifdef CONFIG_PERFMON
        pfm_init_percpu();
@@ -592,11 +666,7 @@ ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect)
        unsigned long ipi_data;
        unsigned long phys_cpu_id;
 
-#ifdef CONFIG_SMP
        phys_cpu_id = cpu_physical_id(cpu);
-#else
-       phys_cpu_id = (ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff;
-#endif
 
        /*
         * cpu number is in 8bit ID and 8bit EID
index b618487cdc858b836cee4adb044579bb5cb716f4..8d9a446a0d178e47a8ffad9a47711ee564680da3 100644 (file)
@@ -838,7 +838,7 @@ out:
        return 1;
 }
 
-int __kprobes kprobes_fault_handler(struct pt_regs *regs, int trapnr)
+int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
 {
        struct kprobe *cur = kprobe_running();
        struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
@@ -1001,6 +1001,11 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
        return 1;
 }
 
+/* ia64 does not need this */
+void __kprobes jprobe_return(void)
+{
+}
+
 int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
 {
        struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
index 6e17aed5313521be82a8bf9f381f1b1a09307ea5..6c18221dba366776264d3f0251e14cd51a47d9dc 100644 (file)
@@ -413,8 +413,8 @@ ia64_log_get(int sal_info_type, u8 **buffer, int irq_safe)
                IA64_LOG_INDEX_INC(sal_info_type);
                IA64_LOG_UNLOCK(sal_info_type);
                if (irq_safe) {
-                       IA64_MCA_DEBUG("%s: SAL error record type %d retrieved. "
-                                      "Record length = %ld\n", __FUNCTION__, sal_info_type, total_len);
+                       IA64_MCA_DEBUG("%s: SAL error record type %d retrieved. Record length = %ld\n",
+                                      __func__, sal_info_type, total_len);
                }
                *buffer = (u8 *) log_buffer;
                return total_len;
@@ -518,7 +518,7 @@ ia64_mca_cpe_int_handler (int cpe_irq, void *arg)
        static DEFINE_SPINLOCK(cpe_history_lock);
 
        IA64_MCA_DEBUG("%s: received interrupt vector = %#x on CPU %d\n",
-                      __FUNCTION__, cpe_irq, smp_processor_id());
+                      __func__, cpe_irq, smp_processor_id());
 
        /* SAL spec states this should run w/ interrupts enabled */
        local_irq_enable();
@@ -594,7 +594,7 @@ ia64_mca_register_cpev (int cpev)
        }
 
        IA64_MCA_DEBUG("%s: corrected platform error "
-                      "vector %#x registered\n", __FUNCTION__, cpev);
+                      "vector %#x registered\n", __func__, cpev);
 }
 #endif /* CONFIG_ACPI */
 
@@ -621,12 +621,11 @@ ia64_mca_cmc_vector_setup (void)
        cmcv.cmcv_vector        = IA64_CMC_VECTOR;
        ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval);
 
-       IA64_MCA_DEBUG("%s: CPU %d corrected "
-                      "machine check vector %#x registered.\n",
-                      __FUNCTION__, smp_processor_id(), IA64_CMC_VECTOR);
+       IA64_MCA_DEBUG("%s: CPU %d corrected machine check vector %#x registered.\n",
+                      __func__, smp_processor_id(), IA64_CMC_VECTOR);
 
        IA64_MCA_DEBUG("%s: CPU %d CMCV = %#016lx\n",
-                      __FUNCTION__, smp_processor_id(), ia64_getreg(_IA64_REG_CR_CMCV));
+                      __func__, smp_processor_id(), ia64_getreg(_IA64_REG_CR_CMCV));
 }
 
 /*
@@ -651,9 +650,8 @@ ia64_mca_cmc_vector_disable (void *dummy)
        cmcv.cmcv_mask = 1; /* Mask/disable interrupt */
        ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval);
 
-       IA64_MCA_DEBUG("%s: CPU %d corrected "
-                      "machine check vector %#x disabled.\n",
-                      __FUNCTION__, smp_processor_id(), cmcv.cmcv_vector);
+       IA64_MCA_DEBUG("%s: CPU %d corrected machine check vector %#x disabled.\n",
+                      __func__, smp_processor_id(), cmcv.cmcv_vector);
 }
 
 /*
@@ -678,9 +676,8 @@ ia64_mca_cmc_vector_enable (void *dummy)
        cmcv.cmcv_mask = 0; /* Unmask/enable interrupt */
        ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval);
 
-       IA64_MCA_DEBUG("%s: CPU %d corrected "
-                      "machine check vector %#x enabled.\n",
-                      __FUNCTION__, smp_processor_id(), cmcv.cmcv_vector);
+       IA64_MCA_DEBUG("%s: CPU %d corrected machine check vector %#x enabled.\n",
+                      __func__, smp_processor_id(), cmcv.cmcv_vector);
 }
 
 /*
@@ -767,7 +764,7 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg)
        local_irq_save(flags);
        if (notify_die(DIE_MCA_RENDZVOUS_ENTER, "MCA", get_irq_regs(),
                       (long)&nd, 0, 0) == NOTIFY_STOP)
-               ia64_mca_spin(__FUNCTION__);
+               ia64_mca_spin(__func__);
 
        ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_DONE;
        /* Register with the SAL monarch that the slave has
@@ -777,7 +774,7 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg)
 
        if (notify_die(DIE_MCA_RENDZVOUS_PROCESS, "MCA", get_irq_regs(),
                       (long)&nd, 0, 0) == NOTIFY_STOP)
-               ia64_mca_spin(__FUNCTION__);
+               ia64_mca_spin(__func__);
 
        /* Wait for the monarch cpu to exit. */
        while (monarch_cpu != -1)
@@ -785,7 +782,7 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg)
 
        if (notify_die(DIE_MCA_RENDZVOUS_LEAVE, "MCA", get_irq_regs(),
                       (long)&nd, 0, 0) == NOTIFY_STOP)
-               ia64_mca_spin(__FUNCTION__);
+               ia64_mca_spin(__func__);
 
        ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_NOTDONE;
        /* Enable all interrupts */
@@ -1230,7 +1227,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
 
        if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, (long)&nd, 0, 0)
                        == NOTIFY_STOP)
-               ia64_mca_spin(__FUNCTION__);
+               ia64_mca_spin(__func__);
 
        ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_CONCURRENT_MCA;
        if (sos->monarch) {
@@ -1246,7 +1243,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
                ia64_mca_wakeup_all();
                if (notify_die(DIE_MCA_MONARCH_PROCESS, "MCA", regs, (long)&nd, 0, 0)
                                == NOTIFY_STOP)
-                       ia64_mca_spin(__FUNCTION__);
+                       ia64_mca_spin(__func__);
        } else {
                while (cpu_isset(cpu, mca_cpu))
                        cpu_relax();    /* spin until monarch wakes us */
@@ -1276,7 +1273,7 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
        }
        if (notify_die(DIE_MCA_MONARCH_LEAVE, "MCA", regs, (long)&nd, 0, recover)
                        == NOTIFY_STOP)
-               ia64_mca_spin(__FUNCTION__);
+               ia64_mca_spin(__func__);
 
 
        if (atomic_dec_return(&mca_count) > 0) {
@@ -1328,7 +1325,7 @@ ia64_mca_cmc_int_handler(int cmc_irq, void *arg)
        static DEFINE_SPINLOCK(cmc_history_lock);
 
        IA64_MCA_DEBUG("%s: received interrupt vector = %#x on CPU %d\n",
-                      __FUNCTION__, cmc_irq, smp_processor_id());
+                      __func__, cmc_irq, smp_processor_id());
 
        /* SAL spec states this should run w/ interrupts enabled */
        local_irq_enable();
@@ -1614,7 +1611,7 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw,
         */
        if (!sos->monarch && atomic_add_return(1, &slaves) == num_online_cpus()) {
                mprintk(KERN_WARNING "%s: Promoting cpu %d to monarch.\n",
-                      __FUNCTION__, cpu);
+                       __func__, cpu);
                atomic_dec(&slaves);
                sos->monarch = 1;
        }
@@ -1626,7 +1623,7 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw,
         */
        if (sos->monarch && atomic_add_return(1, &monarchs) > 1) {
                mprintk(KERN_WARNING "%s: Demoting cpu %d to slave.\n",
-                              __FUNCTION__, cpu);
+                              __func__, cpu);
                atomic_dec(&monarchs);
                sos->monarch = 0;
        }
@@ -1637,15 +1634,15 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw,
                       cpu_relax();     /* spin until monarch enters */
                if (notify_die(DIE_INIT_SLAVE_ENTER, "INIT", regs, (long)&nd, 0, 0)
                                == NOTIFY_STOP)
-                       ia64_mca_spin(__FUNCTION__);
+                       ia64_mca_spin(__func__);
                if (notify_die(DIE_INIT_SLAVE_PROCESS, "INIT", regs, (long)&nd, 0, 0)
                                == NOTIFY_STOP)
-                       ia64_mca_spin(__FUNCTION__);
+                       ia64_mca_spin(__func__);
                while (monarch_cpu != -1)
                       cpu_relax();     /* spin until monarch leaves */
                if (notify_die(DIE_INIT_SLAVE_LEAVE, "INIT", regs, (long)&nd, 0, 0)
                                == NOTIFY_STOP)
-                       ia64_mca_spin(__FUNCTION__);
+                       ia64_mca_spin(__func__);
                mprintk("Slave on cpu %d returning to normal service.\n", cpu);
                set_curr_task(cpu, previous_current);
                ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_NOTDONE;
@@ -1656,7 +1653,7 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw,
        monarch_cpu = cpu;
        if (notify_die(DIE_INIT_MONARCH_ENTER, "INIT", regs, (long)&nd, 0, 0)
                        == NOTIFY_STOP)
-               ia64_mca_spin(__FUNCTION__);
+               ia64_mca_spin(__func__);
 
        /*
         * Wait for a bit.  On some machines (e.g., HP's zx2000 and zx6000, INIT can be
@@ -1673,10 +1670,10 @@ ia64_init_handler(struct pt_regs *regs, struct switch_stack *sw,
         */
        if (notify_die(DIE_INIT_MONARCH_PROCESS, "INIT", regs, (long)&nd, 0, 0)
                        == NOTIFY_STOP)
-               ia64_mca_spin(__FUNCTION__);
+               ia64_mca_spin(__func__);
        if (notify_die(DIE_INIT_MONARCH_LEAVE, "INIT", regs, (long)&nd, 0, 0)
                        == NOTIFY_STOP)
-               ia64_mca_spin(__FUNCTION__);
+               ia64_mca_spin(__func__);
        mprintk("\nINIT dump complete.  Monarch on cpu %d returning to normal service.\n", cpu);
        atomic_dec(&monarchs);
        set_curr_task(cpu, previous_current);
@@ -1884,7 +1881,7 @@ ia64_mca_init(void)
                .priority = 0/* we need to notified last */
        };
 
-       IA64_MCA_DEBUG("%s: begin\n", __FUNCTION__);
+       IA64_MCA_DEBUG("%s: begin\n", __func__);
 
        /* Clear the Rendez checkin flag for all cpus */
        for(i = 0 ; i < NR_CPUS; i++)
@@ -1928,7 +1925,7 @@ ia64_mca_init(void)
                return;
        }
 
-       IA64_MCA_DEBUG("%s: registered MCA rendezvous spinloop and wakeup mech.\n", __FUNCTION__);
+       IA64_MCA_DEBUG("%s: registered MCA rendezvous spinloop and wakeup mech.\n", __func__);
 
        ia64_mc_info.imi_mca_handler        = ia64_tpa(mca_hldlr_ptr->fp);
        /*
@@ -1949,7 +1946,7 @@ ia64_mca_init(void)
                return;
        }
 
-       IA64_MCA_DEBUG("%s: registered OS MCA handler with SAL at 0x%lx, gp = 0x%lx\n", __FUNCTION__,
+       IA64_MCA_DEBUG("%s: registered OS MCA handler with SAL at 0x%lx, gp = 0x%lx\n", __func__,
                       ia64_mc_info.imi_mca_handler, ia64_tpa(mca_hldlr_ptr->gp));
 
        /*
@@ -1961,7 +1958,7 @@ ia64_mca_init(void)
        ia64_mc_info.imi_slave_init_handler             = ia64_tpa(init_hldlr_ptr_slave->fp);
        ia64_mc_info.imi_slave_init_handler_size        = 0;
 
-       IA64_MCA_DEBUG("%s: OS INIT handler at %lx\n", __FUNCTION__,
+       IA64_MCA_DEBUG("%s: OS INIT handler at %lx\n", __func__,
                       ia64_mc_info.imi_monarch_init_handler);
 
        /* Register the os init handler with SAL */
@@ -1982,7 +1979,7 @@ ia64_mca_init(void)
                return;
        }
 
-       IA64_MCA_DEBUG("%s: registered OS INIT handler with SAL\n", __FUNCTION__);
+       IA64_MCA_DEBUG("%s: registered OS INIT handler with SAL\n", __func__);
 
        /*
         *  Configure the CMCI/P vector and handler. Interrupts for CMC are
@@ -2042,7 +2039,7 @@ ia64_mca_late_init(void)
        cmc_polling_enabled = 0;
        schedule_work(&cmc_enable_work);
 
-       IA64_MCA_DEBUG("%s: CMCI/P setup and enabled.\n", __FUNCTION__);
+       IA64_MCA_DEBUG("%s: CMCI/P setup and enabled.\n", __func__);
 
 #ifdef CONFIG_ACPI
        /* Setup the CPEI/P vector and handler */
@@ -2065,17 +2062,17 @@ ia64_mca_late_init(void)
                                ia64_cpe_irq = irq;
                                ia64_mca_register_cpev(cpe_vector);
                                IA64_MCA_DEBUG("%s: CPEI/P setup and enabled.\n",
-                                       __FUNCTION__);
+                                       __func__);
                                return 0;
                        }
                        printk(KERN_ERR "%s: Failed to find irq for CPE "
                                        "interrupt handler, vector %d\n",
-                                       __FUNCTION__, cpe_vector);
+                                       __func__, cpe_vector);
                }
                /* If platform doesn't support CPEI, get the timer going. */
                if (cpe_poll_enabled) {
                        ia64_mca_cpe_poll(0UL);
-                       IA64_MCA_DEBUG("%s: CPEP setup and enabled.\n", __FUNCTION__);
+                       IA64_MCA_DEBUG("%s: CPEP setup and enabled.\n", __func__);
                }
        }
 #endif
index e58f4367cf11db4ad4cca80fed0785f7283d5b15..e83e2ea3b3e0787ea673ae7451ae2855196f1c38 100644 (file)
@@ -493,7 +493,7 @@ module_frob_arch_sections (Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings,
        mod->arch.opd->sh_addralign = 8;
        mod->arch.opd->sh_size = fdescs * sizeof(struct fdesc);
        DEBUGP("%s: core.plt=%lx, init.plt=%lx, got=%lx, fdesc=%lx\n",
-              __FUNCTION__, mod->arch.core_plt->sh_size, mod->arch.init_plt->sh_size,
+              __func__, mod->arch.core_plt->sh_size, mod->arch.init_plt->sh_size,
               mod->arch.got->sh_size, mod->arch.opd->sh_size);
        return 0;
 }
@@ -585,7 +585,7 @@ get_plt (struct module *mod, const struct insn *insn, uint64_t value, int *okp)
 #if ARCH_MODULE_DEBUG
        if (plt_target(plt) != target_ip) {
                printk("%s: mistargeted PLT: wanted %lx, got %lx\n",
-                      __FUNCTION__, target_ip, plt_target(plt));
+                      __func__, target_ip, plt_target(plt));
                *okp = 0;
                return 0;
        }
@@ -703,7 +703,7 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
                if (r_type == R_IA64_PCREL21BI) {
                        if (!is_internal(mod, val)) {
                                printk(KERN_ERR "%s: %s reloc against non-local symbol (%lx)\n",
-                                      __FUNCTION__, reloc_name[r_type], val);
+                                      __func__, reloc_name[r_type], val);
                                return -ENOEXEC;
                        }
                        format = RF_INSN21B;
@@ -737,7 +737,7 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
                      case R_IA64_LDXMOV:
                        if (gp_addressable(mod, val)) {
                                /* turn "ld8" into "mov": */
-                               DEBUGP("%s: patching ld8 at %p to mov\n", __FUNCTION__, location);
+                               DEBUGP("%s: patching ld8 at %p to mov\n", __func__, location);
                                ia64_patch((u64) location, 0x1fff80fe000UL, 0x10000000000UL);
                        }
                        return 0;
@@ -771,7 +771,7 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
        if (!ok)
                return -ENOEXEC;
 
-       DEBUGP("%s: [%p]<-%016lx = %s(%lx)\n", __FUNCTION__, location, val,
+       DEBUGP("%s: [%p]<-%016lx = %s(%lx)\n", __func__, location, val,
               reloc_name[r_type] ? reloc_name[r_type] : "?", sym->st_value + addend);
 
        switch (format) {
@@ -807,7 +807,7 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
        Elf64_Shdr *target_sec;
        int ret;
 
-       DEBUGP("%s: applying section %u (%u relocs) to %u\n", __FUNCTION__,
+       DEBUGP("%s: applying section %u (%u relocs) to %u\n", __func__,
               relsec, n, sechdrs[relsec].sh_info);
 
        target_sec = sechdrs + sechdrs[relsec].sh_info;
@@ -835,7 +835,7 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
                        gp = mod->core_size / 2;
                gp = (uint64_t) mod->module_core + ((gp + 7) & -8);
                mod->arch.gp = gp;
-               DEBUGP("%s: placing gp at 0x%lx\n", __FUNCTION__, gp);
+               DEBUGP("%s: placing gp at 0x%lx\n", __func__, gp);
        }
 
        for (i = 0; i < n; i++) {
@@ -903,7 +903,7 @@ register_unwind_table (struct module *mod)
                init = start + num_core;
        }
 
-       DEBUGP("%s: name=%s, gp=%lx, num_init=%lu, num_core=%lu\n", __FUNCTION__,
+       DEBUGP("%s: name=%s, gp=%lx, num_init=%lu, num_core=%lu\n", __func__,
               mod->name, mod->arch.gp, num_init, num_core);
 
        /*
@@ -912,13 +912,13 @@ register_unwind_table (struct module *mod)
        if (num_core > 0) {
                mod->arch.core_unw_table = unw_add_unwind_table(mod->name, 0, mod->arch.gp,
                                                                core, core + num_core);
-               DEBUGP("%s:  core: handle=%p [%p-%p)\n", __FUNCTION__,
+               DEBUGP("%s:  core: handle=%p [%p-%p)\n", __func__,
                       mod->arch.core_unw_table, core, core + num_core);
        }
        if (num_init > 0) {
                mod->arch.init_unw_table = unw_add_unwind_table(mod->name, 0, mod->arch.gp,
                                                                init, init + num_init);
-               DEBUGP("%s:  init: handle=%p [%p-%p)\n", __FUNCTION__,
+               DEBUGP("%s:  init: handle=%p [%p-%p)\n", __func__,
                       mod->arch.init_unw_table, init, init + num_init);
        }
 }
@@ -926,7 +926,7 @@ register_unwind_table (struct module *mod)
 int
 module_finalize (const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod)
 {
-       DEBUGP("%s: init: entry=%p\n", __FUNCTION__, mod->init);
+       DEBUGP("%s: init: entry=%p\n", __func__, mod->init);
        if (mod->arch.unwind)
                register_unwind_table(mod);
        return 0;
index e86d0295979465a56c257298028d5fc9798fb249..60c6ef67ebb215267c79eae647984893d0684f66 100644 (file)
@@ -57,7 +57,7 @@ static void ia64_set_msi_irq_affinity(unsigned int irq, cpumask_t cpu_mask)
        if (!cpu_online(cpu))
                return;
 
-       if (reassign_irq_vector(irq, cpu))
+       if (irq_prepare_move(irq, cpu))
                return;
 
        read_msi_msg(irq, &msg);
@@ -119,6 +119,7 @@ void ia64_teardown_msi_irq(unsigned int irq)
 
 static void ia64_ack_msi_irq(unsigned int irq)
 {
+       irq_complete_move(irq);
        move_native_irq(irq);
        ia64_eoi();
 }
index f6b99719f10f0b4c1ef4893e3e8999f0d4ca75df..a2aabfdc80d9ecaf4a8d1f4853956ca765e73f64 100644 (file)
 #ifdef PFM_DEBUGGING
 #define DPRINT(a) \
        do { \
-               if (unlikely(pfm_sysctl.debug >0)) { printk("%s.%d: CPU%d [%d] ", __FUNCTION__, __LINE__, smp_processor_id(), task_pid_nr(current)); printk a; } \
+               if (unlikely(pfm_sysctl.debug >0)) { printk("%s.%d: CPU%d [%d] ", __func__, __LINE__, smp_processor_id(), task_pid_nr(current)); printk a; } \
        } while (0)
 
 #define DPRINT_ovfl(a) \
        do { \
-               if (unlikely(pfm_sysctl.debug > 0 && pfm_sysctl.debug_ovfl >0)) { printk("%s.%d: CPU%d [%d] ", __FUNCTION__, __LINE__, smp_processor_id(), task_pid_nr(current)); printk a; } \
+               if (unlikely(pfm_sysctl.debug > 0 && pfm_sysctl.debug_ovfl >0)) { printk("%s.%d: CPU%d [%d] ", __func__, __LINE__, smp_processor_id(), task_pid_nr(current)); printk a; } \
        } while (0)
 #endif
 
index a7af1cb419f921490991a2d29c3a6e6bc69d6012..5f637bbfcccdd6f5a09bdfe6a9266859f5cc4e63 100644 (file)
@@ -24,12 +24,12 @@ MODULE_LICENSE("GPL");
 #ifdef DEFAULT_DEBUG
 #define DPRINT(a) \
        do { \
-               if (unlikely(pfm_sysctl.debug >0)) { printk("%s.%d: CPU%d ", __FUNCTION__, __LINE__, smp_processor_id()); printk a; } \
+               if (unlikely(pfm_sysctl.debug >0)) { printk("%s.%d: CPU%d ", __func__, __LINE__, smp_processor_id()); printk a; } \
        } while (0)
 
 #define DPRINT_ovfl(a) \
        do { \
-               if (unlikely(pfm_sysctl.debug > 0 && pfm_sysctl.debug_ovfl >0)) { printk("%s.%d: CPU%d ", __FUNCTION__, __LINE__, smp_processor_id()); printk a; } \
+               if (unlikely(pfm_sysctl.debug > 0 && pfm_sysctl.debug_ovfl >0)) { printk("%s.%d: CPU%d ", __func__, __LINE__, smp_processor_id()); printk a; } \
        } while (0)
 
 #else
index 331d6768b5d50f7257cb6c389929fdfb989800c9..ab784ec4319dbd2eea568a5a6cbc566e829eb358 100644 (file)
@@ -697,52 +697,6 @@ thread_matches (struct task_struct *thread, unsigned long addr)
        return 1;       /* looks like we've got a winner */
 }
 
-/*
- * GDB apparently wants to be able to read the register-backing store
- * of any thread when attached to a given process.  If we are peeking
- * or poking an address that happens to reside in the kernel-backing
- * store of another thread, we need to attach to that thread, because
- * otherwise we end up accessing stale data.
- *
- * task_list_lock must be read-locked before calling this routine!
- */
-static struct task_struct *
-find_thread_for_addr (struct task_struct *child, unsigned long addr)
-{
-       struct task_struct *p;
-       struct mm_struct *mm;
-       struct list_head *this, *next;
-       int mm_users;
-
-       if (!(mm = get_task_mm(child)))
-               return child;
-
-       /* -1 because of our get_task_mm(): */
-       mm_users = atomic_read(&mm->mm_users) - 1;
-       if (mm_users <= 1)
-               goto out;               /* not multi-threaded */
-
-       /*
-        * Traverse the current process' children list.  Every task that
-        * one attaches to becomes a child.  And it is only attached children
-        * of the debugger that are of interest (ptrace_check_attach checks
-        * for this).
-        */
-       list_for_each_safe(this, next, &current->children) {
-               p = list_entry(this, struct task_struct, sibling);
-               if (p->tgid != child->tgid)
-                       continue;
-               if (thread_matches(p, addr)) {
-                       child = p;
-                       goto out;
-               }
-       }
-
-  out:
-       mmput(mm);
-       return child;
-}
-
 /*
  * Write f32-f127 back to task->thread.fph if it has been modified.
  */
@@ -826,14 +780,14 @@ convert_to_non_syscall (struct task_struct *child, struct pt_regs  *pt,
                if ((long)((unsigned long)child + IA64_STK_OFFSET - sp)
                    < IA64_PT_REGS_SIZE) {
                        dprintk("ptrace.%s: ran off the top of the kernel "
-                               "stack\n", __FUNCTION__);
+                               "stack\n", __func__);
                        return;
                }
                if (unw_get_pr (&prev_info, &pr) < 0) {
                        unw_get_rp(&prev_info, &ip);
                        dprintk("ptrace.%s: failed to read "
                                "predicate register (ip=0x%lx)\n",
-                               __FUNCTION__, ip);
+                               __func__, ip);
                        return;
                }
                if (unw_is_intr_frame(&info)
@@ -908,7 +862,7 @@ static int
 access_uarea (struct task_struct *child, unsigned long addr,
              unsigned long *data, int write_access)
 {
-       unsigned long *ptr, regnum, urbs_end, rnat_addr, cfm;
+       unsigned long *ptr, regnum, urbs_end, cfm;
        struct switch_stack *sw;
        struct pt_regs *pt;
 #      define pt_reg_addr(pt, reg)     ((void *)                           \
@@ -1011,14 +965,9 @@ access_uarea (struct task_struct *child, unsigned long addr,
                         * the kernel was entered.
                         *
                         * Furthermore, when changing the contents of
-                        * PT_AR_BSP (or PT_CFM) we MUST copy any
-                        * users-level stacked registers that are
-                        * stored on the kernel stack back to
-                        * user-space because otherwise, we might end
-                        * up clobbering kernel stacked registers.
-                        * Also, if this happens while the task is
-                        * blocked in a system call, which convert the
-                        * state such that the non-system-call exit
+                        * PT_AR_BSP (or PT_CFM) while the task is
+                        * blocked in a system call, convert the state
+                        * so that the non-system-call exit
                         * path is used.  This ensures that the proper
                         * state will be picked up when resuming
                         * execution.  However, it *also* means that
@@ -1035,10 +984,6 @@ access_uarea (struct task_struct *child, unsigned long addr,
                        urbs_end = ia64_get_user_rbs_end(child, pt, &cfm);
                        if (write_access) {
                                if (*data != urbs_end) {
-                                       if (ia64_sync_user_rbs(child, sw,
-                                                              pt->ar_bspstore,
-                                                              urbs_end) < 0)
-                                               return -1;
                                        if (in_syscall(pt))
                                                convert_to_non_syscall(child,
                                                                       pt,
@@ -1058,10 +1003,6 @@ access_uarea (struct task_struct *child, unsigned long addr,
                        urbs_end = ia64_get_user_rbs_end(child, pt, &cfm);
                        if (write_access) {
                                if (((cfm ^ *data) & PFM_MASK) != 0) {
-                                       if (ia64_sync_user_rbs(child, sw,
-                                                              pt->ar_bspstore,
-                                                              urbs_end) < 0)
-                                               return -1;
                                        if (in_syscall(pt))
                                                convert_to_non_syscall(child,
                                                                       pt,
@@ -1093,16 +1034,8 @@ access_uarea (struct task_struct *child, unsigned long addr,
                        return 0;
 
                      case PT_AR_RNAT:
-                       urbs_end = ia64_get_user_rbs_end(child, pt, NULL);
-                       rnat_addr = (long) ia64_rse_rnat_addr((long *)
-                                                             urbs_end);
-                       if (write_access)
-                               return ia64_poke(child, sw, urbs_end,
-                                                rnat_addr, *data);
-                       else
-                               return ia64_peek(child, sw, urbs_end,
-                                                rnat_addr, data);
-
+                       ptr = pt_reg_addr(pt, ar_rnat);
+                       break;
                      case PT_R1:
                        ptr = pt_reg_addr(pt, r1);
                        break;
@@ -1521,215 +1454,97 @@ ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr)
        return ret;
 }
 
-/*
- * Called by kernel/ptrace.c when detaching..
- *
- * Make sure the single step bit is not set.
- */
 void
-ptrace_disable (struct task_struct *child)
+user_enable_single_step (struct task_struct *child)
 {
        struct ia64_psr *child_psr = ia64_psr(task_pt_regs(child));
 
-       /* make sure the single step/taken-branch trap bits are not set: */
-       clear_tsk_thread_flag(child, TIF_SINGLESTEP);
-       child_psr->ss = 0;
-       child_psr->tb = 0;
+       set_tsk_thread_flag(child, TIF_SINGLESTEP);
+       child_psr->ss = 1;
 }
 
-asmlinkage long
-sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data)
+void
+user_enable_block_step (struct task_struct *child)
 {
-       struct pt_regs *pt;
-       unsigned long urbs_end, peek_or_poke;
-       struct task_struct *child;
-       struct switch_stack *sw;
-       long ret;
-       struct unw_frame_info info;
+       struct ia64_psr *child_psr = ia64_psr(task_pt_regs(child));
 
-       lock_kernel();
-       ret = -EPERM;
-       if (request == PTRACE_TRACEME) {
-               ret = ptrace_traceme();
-               goto out;
-       }
+       set_tsk_thread_flag(child, TIF_SINGLESTEP);
+       child_psr->tb = 1;
+}
 
-       peek_or_poke = (request == PTRACE_PEEKTEXT
-                       || request == PTRACE_PEEKDATA
-                       || request == PTRACE_POKETEXT
-                       || request == PTRACE_POKEDATA);
-       ret = -ESRCH;
-       read_lock(&tasklist_lock);
-       {
-               child = find_task_by_pid(pid);
-               if (child) {
-                       if (peek_or_poke)
-                               child = find_thread_for_addr(child, addr);
-                       get_task_struct(child);
-               }
-       }
-       read_unlock(&tasklist_lock);
-       if (!child)
-               goto out;
-       ret = -EPERM;
-       if (pid == 1)           /* no messing around with init! */
-               goto out_tsk;
-
-       if (request == PTRACE_ATTACH) {
-               ret = ptrace_attach(child);
-               if (!ret)
-                       arch_ptrace_attach(child);
-               goto out_tsk;
-       }
+void
+user_disable_single_step (struct task_struct *child)
+{
+       struct ia64_psr *child_psr = ia64_psr(task_pt_regs(child));
 
-       ret = ptrace_check_attach(child, request == PTRACE_KILL);
-       if (ret < 0)
-               goto out_tsk;
+       /* make sure the single step/taken-branch trap bits are not set: */
+       clear_tsk_thread_flag(child, TIF_SINGLESTEP);
+       child_psr->ss = 0;
+       child_psr->tb = 0;
+}
 
-       pt = task_pt_regs(child);
-       sw = (struct switch_stack *) (child->thread.ksp + 16);
+/*
+ * Called by kernel/ptrace.c when detaching..
+ *
+ * Make sure the single step bit is not set.
+ */
+void
+ptrace_disable (struct task_struct *child)
+{
+       user_disable_single_step(child);
+}
 
+long
+arch_ptrace (struct task_struct *child, long request, long addr, long data)
+{
        switch (request) {
-             case PTRACE_PEEKTEXT:
-             case PTRACE_PEEKDATA:
+       case PTRACE_PEEKTEXT:
+       case PTRACE_PEEKDATA:
                /* read word at location addr */
-               urbs_end = ia64_get_user_rbs_end(child, pt, NULL);
-               ret = ia64_peek(child, sw, urbs_end, addr, &data);
-               if (ret == 0) {
-                       ret = data;
-                       /* ensure "ret" is not mistaken as an error code: */
-                       force_successful_syscall_return();
-               }
-               goto out_tsk;
-
-             case PTRACE_POKETEXT:
-             case PTRACE_POKEDATA:
-               /* write the word at location addr */
-               urbs_end = ia64_get_user_rbs_end(child, pt, NULL);
-               ret = ia64_poke(child, sw, urbs_end, addr, data);
-
-               /* Make sure user RBS has the latest data */
-               unw_init_from_blocked_task(&info, child);
-               do_sync_rbs(&info, ia64_sync_user_rbs);
+               if (access_process_vm(child, addr, &data, sizeof(data), 0)
+                   != sizeof(data))
+                       return -EIO;
+               /* ensure return value is not mistaken for error code */
+               force_successful_syscall_return();
+               return data;
 
-               goto out_tsk;
+       /* PTRACE_POKETEXT and PTRACE_POKEDATA is handled
+        * by the generic ptrace_request().
+        */
 
-             case PTRACE_PEEKUSR:
+       case PTRACE_PEEKUSR:
                /* read the word at addr in the USER area */
-               if (access_uarea(child, addr, &data, 0) < 0) {
-                       ret = -EIO;
-                       goto out_tsk;
-               }
-               ret = data;
-               /* ensure "ret" is not mistaken as an error code */
+               if (access_uarea(child, addr, &data, 0) < 0)
+                       return -EIO;
+               /* ensure return value is not mistaken for error code */
                force_successful_syscall_return();
-               goto out_tsk;
+               return data;
 
-             case PTRACE_POKEUSR:
+       case PTRACE_POKEUSR:
                /* write the word at addr in the USER area */
-               if (access_uarea(child, addr, &data, 1) < 0) {
-                       ret = -EIO;
-                       goto out_tsk;
-               }
-               ret = 0;
-               goto out_tsk;
+               if (access_uarea(child, addr, &data, 1) < 0)
+                       return -EIO;
+               return 0;
 
-             case PTRACE_OLD_GETSIGINFO:
+       case PTRACE_OLD_GETSIGINFO:
                /* for backwards-compatibility */
-               ret = ptrace_request(child, PTRACE_GETSIGINFO, addr, data);
-               goto out_tsk;
+               return ptrace_request(child, PTRACE_GETSIGINFO, addr, data);
 
-             case PTRACE_OLD_SETSIGINFO:
+       case PTRACE_OLD_SETSIGINFO:
                /* for backwards-compatibility */
-               ret = ptrace_request(child, PTRACE_SETSIGINFO, addr, data);
-               goto out_tsk;
-
-             case PTRACE_SYSCALL:
-               /* continue and stop at next (return from) syscall */
-             case PTRACE_CONT:
-               /* restart after signal. */
-               ret = -EIO;
-               if (!valid_signal(data))
-                       goto out_tsk;
-               if (request == PTRACE_SYSCALL)
-                       set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-               else
-                       clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-               child->exit_code = data;
+               return ptrace_request(child, PTRACE_SETSIGINFO, addr, data);
 
-               /*
-                * Make sure the single step/taken-branch trap bits
-                * are not set:
-                */
-               clear_tsk_thread_flag(child, TIF_SINGLESTEP);
-               ia64_psr(pt)->ss = 0;
-               ia64_psr(pt)->tb = 0;
+       case PTRACE_GETREGS:
+               return ptrace_getregs(child,
+                                     (struct pt_all_user_regs __user *) data);
 
-               wake_up_process(child);
-               ret = 0;
-               goto out_tsk;
+       case PTRACE_SETREGS:
+               return ptrace_setregs(child,
+                                     (struct pt_all_user_regs __user *) data);
 
-             case PTRACE_KILL:
-               /*
-                * Make the child exit.  Best I can do is send it a
-                * sigkill.  Perhaps it should be put in the status
-                * that it wants to exit.
-                */
-               if (child->exit_state == EXIT_ZOMBIE)
-                       /* already dead */
-                       goto out_tsk;
-               child->exit_code = SIGKILL;
-
-               ptrace_disable(child);
-               wake_up_process(child);
-               ret = 0;
-               goto out_tsk;
-
-             case PTRACE_SINGLESTEP:
-               /* let child execute for one instruction */
-             case PTRACE_SINGLEBLOCK:
-               ret = -EIO;
-               if (!valid_signal(data))
-                       goto out_tsk;
-
-               clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-               set_tsk_thread_flag(child, TIF_SINGLESTEP);
-               if (request == PTRACE_SINGLESTEP) {
-                       ia64_psr(pt)->ss = 1;
-               } else {
-                       ia64_psr(pt)->tb = 1;
-               }
-               child->exit_code = data;
-
-               /* give it a chance to run. */
-               wake_up_process(child);
-               ret = 0;
-               goto out_tsk;
-
-             case PTRACE_DETACH:
-               /* detach a process that was attached. */
-               ret = ptrace_detach(child, data);
-               goto out_tsk;
-
-             case PTRACE_GETREGS:
-               ret = ptrace_getregs(child,
-                                    (struct pt_all_user_regs __user *) data);
-               goto out_tsk;
-
-             case PTRACE_SETREGS:
-               ret = ptrace_setregs(child,
-                                    (struct pt_all_user_regs __user *) data);
-               goto out_tsk;
-
-             default:
-               ret = ptrace_request(child, request, addr, data);
-               goto out_tsk;
+       default:
+               return ptrace_request(child, request, addr, data);
        }
-  out_tsk:
-       put_task_struct(child);
-  out:
-       unlock_kernel();
-       return ret;
 }
 
 
index f44fe8412162c55b73b80663d8bb3e8d4d3d50a9..a3022dc48ef8432a437256948d5a25080b1cf24d 100644 (file)
@@ -109,6 +109,13 @@ check_versions (struct ia64_sal_systab *systab)
                sal_revision = SAL_VERSION_CODE(2, 8);
                sal_version = SAL_VERSION_CODE(0, 0);
        }
+
+       if (ia64_platform_is("sn2") && (sal_revision == SAL_VERSION_CODE(2, 9)))
+               /*
+                * SGI Altix has hard-coded version 2.9 in their prom
+                * but they actually implement 3.2, so let's fix it here.
+                */
+               sal_revision = SAL_VERSION_CODE(3, 2);
 }
 
 static void __init
index ebd1a09f32016b870ccb758dac93f1ade566f866..4aa9eaea76c373bcab89dfa1d058984272030456 100644 (file)
@@ -690,7 +690,7 @@ get_model_name(__u8 family, __u8 model)
        if (overflow++ == 0)
                printk(KERN_ERR
                       "%s: Table overflow. Some processor model information will be missing\n",
-                      __FUNCTION__);
+                      __func__);
        return "Unknown";
 }
 
@@ -785,7 +785,7 @@ get_max_cacheline_size (void)
         status = ia64_pal_cache_summary(&levels, &unique_caches);
         if (status != 0) {
                 printk(KERN_ERR "%s: ia64_pal_cache_summary() failed (status=%ld)\n",
-                       __FUNCTION__, status);
+                       __func__, status);
                 max = SMP_CACHE_BYTES;
                /* Safest setup for "flush_icache_range()" */
                ia64_i_cache_stride_shift = I_CACHE_STRIDE_SHIFT;
@@ -798,7 +798,7 @@ get_max_cacheline_size (void)
                if (status != 0) {
                        printk(KERN_ERR
                               "%s: ia64_pal_cache_config_info(l=%lu, 2) failed (status=%ld)\n",
-                              __FUNCTION__, l, status);
+                              __func__, l, status);
                        max = SMP_CACHE_BYTES;
                        /* The safest setup for "flush_icache_range()" */
                        cci.pcci_stride = I_CACHE_STRIDE_SHIFT;
@@ -814,7 +814,7 @@ get_max_cacheline_size (void)
                        if (status != 0) {
                                printk(KERN_ERR
                                "%s: ia64_pal_cache_config_info(l=%lu, 1) failed (status=%ld)\n",
-                                       __FUNCTION__, l, status);
+                                       __func__, l, status);
                                /* The safest setup for "flush_icache_range()" */
                                cci.pcci_stride = I_CACHE_STRIDE_SHIFT;
                        }
index 309da3567bc851966e8a7ad27e01eccac2e26ff2..5740296c35afa3d597e8fd041db4385ff628f268 100644 (file)
@@ -342,15 +342,33 @@ setup_frame (int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set,
 
        new_sp = scr->pt.r12;
        tramp_addr = (unsigned long) __kernel_sigtramp;
-       if ((ka->sa.sa_flags & SA_ONSTACK) && sas_ss_flags(new_sp) == 0) {
-               new_sp = current->sas_ss_sp + current->sas_ss_size;
-               /*
-                * We need to check for the register stack being on the signal stack
-                * separately, because it's switched separately (memory stack is switched
-                * in the kernel, register stack is switched in the signal trampoline).
-                */
-               if (!rbs_on_sig_stack(scr->pt.ar_bspstore))
-                       new_rbs = (current->sas_ss_sp + sizeof(long) - 1) & ~(sizeof(long) - 1);
+       if (ka->sa.sa_flags & SA_ONSTACK) {
+               int onstack = sas_ss_flags(new_sp);
+
+               if (onstack == 0) {
+                       new_sp = current->sas_ss_sp + current->sas_ss_size;
+                       /*
+                        * We need to check for the register stack being on the
+                        * signal stack separately, because it's switched
+                        * separately (memory stack is switched in the kernel,
+                        * register stack is switched in the signal trampoline).
+                        */
+                       if (!rbs_on_sig_stack(scr->pt.ar_bspstore))
+                               new_rbs = ALIGN(current->sas_ss_sp,
+                                               sizeof(long));
+               } else if (onstack == SS_ONSTACK) {
+                       unsigned long check_sp;
+
+                       /*
+                        * If we are on the alternate signal stack and would
+                        * overflow it, don't. Return an always-bogus address
+                        * instead so we will die with SIGSEGV.
+                        */
+                       check_sp = (new_sp - sizeof(*frame)) & -STACK_ALIGN;
+                       if (!likely(on_sig_stack(check_sp)))
+                               return force_sigsegv_info(sig, (void __user *)
+                                                         check_sp);
+               }
        }
        frame = (void __user *) ((new_sp - sizeof(*frame)) & -STACK_ALIGN);
 
index 52f70bbc192a6faa68ad87bd76bde20b37a6bb73..6903361d11a5766e54f2b8b0e64f5a4d892e2538 100644 (file)
@@ -28,7 +28,7 @@ extern int die_if_kernel(char *str, struct pt_regs *regs, long err);
 #undef DEBUG_UNALIGNED_TRAP
 
 #ifdef DEBUG_UNALIGNED_TRAP
-# define DPRINT(a...)  do { printk("%s %u: ", __FUNCTION__, __LINE__); printk (a); } while (0)
+# define DPRINT(a...)  do { printk("%s %u: ", __func__, __LINE__); printk (a); } while (0)
 # define DDUMP(str,vp,len)     dump(str, vp, len)
 
 static void
@@ -674,7 +674,7 @@ emulate_load_updates (update_t type, load_store_t ld, struct pt_regs *regs, unsi
         * just in case.
         */
        if (ld.x6_op == 1 || ld.x6_op == 3) {
-               printk(KERN_ERR "%s: register update on speculative load, error\n", __FUNCTION__);
+               printk(KERN_ERR "%s: register update on speculative load, error\n", __func__);
                if (die_if_kernel("unaligned reference on speculative load with register update\n",
                                  regs, 30))
                        return;
@@ -1104,7 +1104,7 @@ emulate_load_floatpair (unsigned long ifa, load_store_t ld, struct pt_regs *regs
                 */
                if (ld.x6_op == 1 || ld.x6_op == 3)
                        printk(KERN_ERR "%s: register update on speculative load pair, error\n",
-                              __FUNCTION__);
+                              __func__);
 
                setreg(ld.r3, ifa, 0, regs);
        }
index c1bdb5131814c8f9f24e01cc51eae54e4df35666..67810b77d998768199b3978d288130968e837865 100644 (file)
@@ -257,7 +257,7 @@ pt_regs_off (unsigned long reg)
                off = unw.pt_regs_offsets[reg];
 
        if (off < 0) {
-               UNW_DPRINT(0, "unwind.%s: bad scratch reg r%lu\n", __FUNCTION__, reg);
+               UNW_DPRINT(0, "unwind.%s: bad scratch reg r%lu\n", __func__, reg);
                off = 0;
        }
        return (unsigned long) off;
@@ -268,13 +268,13 @@ get_scratch_regs (struct unw_frame_info *info)
 {
        if (!info->pt) {
                /* This should not happen with valid unwind info.  */
-               UNW_DPRINT(0, "unwind.%s: bad unwind info: resetting info->pt\n", __FUNCTION__);
+               UNW_DPRINT(0, "unwind.%s: bad unwind info: resetting info->pt\n", __func__);
                if (info->flags & UNW_FLAG_INTERRUPT_FRAME)
                        info->pt = (unsigned long) ((struct pt_regs *) info->psp - 1);
                else
                        info->pt = info->sp - 16;
        }
-       UNW_DPRINT(3, "unwind.%s: sp 0x%lx pt 0x%lx\n", __FUNCTION__, info->sp, info->pt);
+       UNW_DPRINT(3, "unwind.%s: sp 0x%lx pt 0x%lx\n", __func__, info->sp, info->pt);
        return (struct pt_regs *) info->pt;
 }
 
@@ -294,7 +294,7 @@ unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char
                        return 0;
                }
                UNW_DPRINT(0, "unwind.%s: trying to access non-existent r%u\n",
-                          __FUNCTION__, regnum);
+                          __func__, regnum);
                return -1;
        }
 
@@ -341,7 +341,7 @@ unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char
                                        {
                                                UNW_DPRINT(0, "unwind.%s: %p outside of regstk "
                                                        "[0x%lx-0x%lx)\n",
-                                                       __FUNCTION__, (void *) addr,
+                                                       __func__, (void *) addr,
                                                        info->regstk.limit,
                                                        info->regstk.top);
                                                return -1;
@@ -374,7 +374,7 @@ unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char
                    || (unsigned long) addr >= info->regstk.top)
                {
                        UNW_DPRINT(0, "unwind.%s: ignoring attempt to access register outside "
-                                  "of rbs\n",  __FUNCTION__);
+                                  "of rbs\n",  __func__);
                        return -1;
                }
                if ((unsigned long) nat_addr >= info->regstk.top)
@@ -385,7 +385,7 @@ unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char
        if (write) {
                if (read_only(addr)) {
                        UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n",
-                               __FUNCTION__);
+                               __func__);
                } else {
                        *addr = *val;
                        if (*nat)
@@ -427,13 +427,13 @@ unw_access_br (struct unw_frame_info *info, int regnum, unsigned long *val, int
 
              default:
                UNW_DPRINT(0, "unwind.%s: trying to access non-existent b%u\n",
-                          __FUNCTION__, regnum);
+                          __func__, regnum);
                return -1;
        }
        if (write)
                if (read_only(addr)) {
                        UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n",
-                               __FUNCTION__);
+                               __func__);
                } else
                        *addr = *val;
        else
@@ -450,7 +450,7 @@ unw_access_fr (struct unw_frame_info *info, int regnum, struct ia64_fpreg *val,
 
        if ((unsigned) (regnum - 2) >= 126) {
                UNW_DPRINT(0, "unwind.%s: trying to access non-existent f%u\n",
-                          __FUNCTION__, regnum);
+                          __func__, regnum);
                return -1;
        }
 
@@ -482,7 +482,7 @@ unw_access_fr (struct unw_frame_info *info, int regnum, struct ia64_fpreg *val,
        if (write)
                if (read_only(addr)) {
                        UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n",
-                               __FUNCTION__);
+                               __func__);
                } else
                        *addr = *val;
        else
@@ -572,14 +572,14 @@ unw_access_ar (struct unw_frame_info *info, int regnum, unsigned long *val, int
 
              default:
                UNW_DPRINT(0, "unwind.%s: trying to access non-existent ar%u\n",
-                          __FUNCTION__, regnum);
+                          __func__, regnum);
                return -1;
        }
 
        if (write) {
                if (read_only(addr)) {
                        UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n",
-                               __FUNCTION__);
+                               __func__);
                } else
                        *addr = *val;
        } else
@@ -600,7 +600,7 @@ unw_access_pr (struct unw_frame_info *info, unsigned long *val, int write)
        if (write) {
                if (read_only(addr)) {
                        UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n",
-                               __FUNCTION__);
+                               __func__);
                } else
                        *addr = *val;
        } else
@@ -699,7 +699,7 @@ decode_abreg (unsigned char abreg, int memory)
              default:
                break;
        }
-       UNW_DPRINT(0, "unwind.%s: bad abreg=0x%x\n", __FUNCTION__, abreg);
+       UNW_DPRINT(0, "unwind.%s: bad abreg=0x%x\n", __func__, abreg);
        return UNW_REG_LC;
 }
 
@@ -739,7 +739,7 @@ spill_next_when (struct unw_reg_info **regp, struct unw_reg_info *lim, unw_word
                        return;
                }
        }
-       UNW_DPRINT(0, "unwind.%s: excess spill!\n",  __FUNCTION__);
+       UNW_DPRINT(0, "unwind.%s: excess spill!\n",  __func__);
 }
 
 static inline void
@@ -855,11 +855,11 @@ desc_abi (unsigned char abi, unsigned char context, struct unw_state_record *sr)
 {
        if (abi == 3 && context == 'i') {
                sr->flags |= UNW_FLAG_INTERRUPT_FRAME;
-               UNW_DPRINT(3, "unwind.%s: interrupt frame\n",  __FUNCTION__);
+               UNW_DPRINT(3, "unwind.%s: interrupt frame\n",  __func__);
        }
        else
                UNW_DPRINT(0, "unwind%s: ignoring unwabi(abi=0x%x,context=0x%x)\n",
-                               __FUNCTION__, abi, context);
+                               __func__, abi, context);
 }
 
 static inline void
@@ -1347,7 +1347,7 @@ script_emit (struct unw_script *script, struct unw_insn insn)
 {
        if (script->count >= UNW_MAX_SCRIPT_LEN) {
                UNW_DPRINT(0, "unwind.%s: script exceeds maximum size of %u instructions!\n",
-                       __FUNCTION__, UNW_MAX_SCRIPT_LEN);
+                       __func__, UNW_MAX_SCRIPT_LEN);
                return;
        }
        script->insn[script->count++] = insn;
@@ -1389,7 +1389,7 @@ emit_nat_info (struct unw_state_record *sr, int i, struct unw_script *script)
 
              default:
                UNW_DPRINT(0, "unwind.%s: don't know how to emit nat info for where = %u\n",
-                          __FUNCTION__, r->where);
+                          __func__, r->where);
                return;
        }
        insn.opc = opc;
@@ -1446,7 +1446,7 @@ compile_reg (struct unw_state_record *sr, int i, struct unw_script *script)
                                val = offsetof(struct pt_regs, f6) + 16*(rval - 6);
                        else
                                UNW_DPRINT(0, "unwind.%s: kernel may not touch f%lu\n",
-                                          __FUNCTION__, rval);
+                                          __func__, rval);
                }
                break;
 
@@ -1474,7 +1474,7 @@ compile_reg (struct unw_state_record *sr, int i, struct unw_script *script)
 
              default:
                UNW_DPRINT(0, "unwind%s: register %u has unexpected `where' value of %u\n",
-                          __FUNCTION__, i, r->where);
+                          __func__, i, r->where);
                break;
        }
        insn.opc = opc;
@@ -1547,10 +1547,10 @@ build_script (struct unw_frame_info *info)
                r->when = UNW_WHEN_NEVER;
        sr.pr_val = info->pr;
 
-       UNW_DPRINT(3, "unwind.%s: ip 0x%lx\n", __FUNCTION__, ip);
+       UNW_DPRINT(3, "unwind.%s: ip 0x%lx\n", __func__, ip);
        script = script_new(ip);
        if (!script) {
-               UNW_DPRINT(0, "unwind.%s: failed to create unwind script\n",  __FUNCTION__);
+               UNW_DPRINT(0, "unwind.%s: failed to create unwind script\n",  __func__);
                STAT(unw.stat.script.build_time += ia64_get_itc() - start);
                return NULL;
        }
@@ -1569,7 +1569,7 @@ build_script (struct unw_frame_info *info)
        if (!e) {
                /* no info, return default unwinder (leaf proc, no mem stack, no saved regs)  */
                UNW_DPRINT(1, "unwind.%s: no unwind info for ip=0x%lx (prev ip=0x%lx)\n",
-                       __FUNCTION__, ip, unw.cache[info->prev_script].ip);
+                       __func__, ip, unw.cache[info->prev_script].ip);
                sr.curr.reg[UNW_REG_RP].where = UNW_WHERE_BR;
                sr.curr.reg[UNW_REG_RP].when = -1;
                sr.curr.reg[UNW_REG_RP].val = 0;
@@ -1618,13 +1618,13 @@ build_script (struct unw_frame_info *info)
                sr.curr.reg[UNW_REG_RP].when = -1;
                sr.curr.reg[UNW_REG_RP].val = sr.return_link_reg;
                UNW_DPRINT(1, "unwind.%s: using default for rp at ip=0x%lx where=%d val=0x%lx\n",
-                          __FUNCTION__, ip, sr.curr.reg[UNW_REG_RP].where,
+                          __func__, ip, sr.curr.reg[UNW_REG_RP].where,
                           sr.curr.reg[UNW_REG_RP].val);
        }
 
 #ifdef UNW_DEBUG
        UNW_DPRINT(1, "unwind.%s: state record for func 0x%lx, t=%u:\n",
-               __FUNCTION__, table->segment_base + e->start_offset, sr.when_target);
+               __func__, table->segment_base + e->start_offset, sr.when_target);
        for (r = sr.curr.reg; r < sr.curr.reg + UNW_NUM_REGS; ++r) {
                if (r->where != UNW_WHERE_NONE || r->when != UNW_WHEN_NEVER) {
                        UNW_DPRINT(1, "  %s <- ", unw.preg_name[r - sr.curr.reg]);
@@ -1746,7 +1746,7 @@ run_script (struct unw_script *script, struct unw_frame_info *state)
                        } else {
                                s[dst] = 0;
                                UNW_DPRINT(0, "unwind.%s: no state->pt, dst=%ld, val=%ld\n",
-                                          __FUNCTION__, dst, val);
+                                          __func__, dst, val);
                        }
                        break;
 
@@ -1756,7 +1756,7 @@ run_script (struct unw_script *script, struct unw_frame_info *state)
                        else {
                                s[dst] = 0;
                                UNW_DPRINT(0, "unwind.%s: UNW_INSN_MOVE_CONST bad val=%ld\n",
-                                          __FUNCTION__, val);
+                                          __func__, val);
                        }
                        break;
 
@@ -1791,7 +1791,7 @@ run_script (struct unw_script *script, struct unw_frame_info *state)
                            || s[val] < TASK_SIZE)
                        {
                                UNW_DPRINT(0, "unwind.%s: rejecting bad psp=0x%lx\n",
-                                          __FUNCTION__, s[val]);
+                                          __func__, s[val]);
                                break;
                        }
 #endif
@@ -1825,7 +1825,7 @@ find_save_locs (struct unw_frame_info *info)
        if ((info->ip & (local_cpu_data->unimpl_va_mask | 0xf)) || info->ip < TASK_SIZE) {
                /* don't let obviously bad addresses pollute the cache */
                /* FIXME: should really be level 0 but it occurs too often. KAO */
-               UNW_DPRINT(1, "unwind.%s: rejecting bad ip=0x%lx\n", __FUNCTION__, info->ip);
+               UNW_DPRINT(1, "unwind.%s: rejecting bad ip=0x%lx\n", __func__, info->ip);
                info->rp_loc = NULL;
                return -1;
        }
@@ -1838,7 +1838,7 @@ find_save_locs (struct unw_frame_info *info)
                        spin_unlock_irqrestore(&unw.lock, flags);
                        UNW_DPRINT(0,
                                   "unwind.%s: failed to locate/build unwind script for ip %lx\n",
-                                  __FUNCTION__, info->ip);
+                                  __func__, info->ip);
                        return -1;
                }
                have_write_lock = 1;
@@ -1882,21 +1882,21 @@ unw_unwind (struct unw_frame_info *info)
        if (!unw_valid(info, info->rp_loc)) {
                /* FIXME: should really be level 0 but it occurs too often. KAO */
                UNW_DPRINT(1, "unwind.%s: failed to locate return link (ip=0x%lx)!\n",
-                          __FUNCTION__, info->ip);
+                          __func__, info->ip);
                STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
                return -1;
        }
        /* restore the ip */
        ip = info->ip = *info->rp_loc;
        if (ip < GATE_ADDR) {
-               UNW_DPRINT(2, "unwind.%s: reached user-space (ip=0x%lx)\n", __FUNCTION__, ip);
+               UNW_DPRINT(2, "unwind.%s: reached user-space (ip=0x%lx)\n", __func__, ip);
                STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
                return -1;
        }
 
        /* validate the previous stack frame pointer */
        if (!unw_valid(info, info->pfs_loc)) {
-               UNW_DPRINT(0, "unwind.%s: failed to locate ar.pfs!\n", __FUNCTION__);
+               UNW_DPRINT(0, "unwind.%s: failed to locate ar.pfs!\n", __func__);
                STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
                return -1;
        }
@@ -1912,13 +1912,13 @@ unw_unwind (struct unw_frame_info *info)
                        num_regs = *info->cfm_loc & 0x7f;               /* size of frame */
                info->pfs_loc =
                        (unsigned long *) (info->pt + offsetof(struct pt_regs, ar_pfs));
-               UNW_DPRINT(3, "unwind.%s: interrupt_frame pt 0x%lx\n", __FUNCTION__, info->pt);
+               UNW_DPRINT(3, "unwind.%s: interrupt_frame pt 0x%lx\n", __func__, info->pt);
        } else
                num_regs = (*info->cfm_loc >> 7) & 0x7f;        /* size of locals */
        info->bsp = (unsigned long) ia64_rse_skip_regs((unsigned long *) info->bsp, -num_regs);
        if (info->bsp < info->regstk.limit || info->bsp > info->regstk.top) {
                UNW_DPRINT(0, "unwind.%s: bsp (0x%lx) out of range [0x%lx-0x%lx]\n",
-                       __FUNCTION__, info->bsp, info->regstk.limit, info->regstk.top);
+                       __func__, info->bsp, info->regstk.limit, info->regstk.top);
                STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
                return -1;
        }
@@ -1927,14 +1927,14 @@ unw_unwind (struct unw_frame_info *info)
        info->sp = info->psp;
        if (info->sp < info->memstk.top || info->sp > info->memstk.limit) {
                UNW_DPRINT(0, "unwind.%s: sp (0x%lx) out of range [0x%lx-0x%lx]\n",
-                       __FUNCTION__, info->sp, info->memstk.top, info->memstk.limit);
+                       __func__, info->sp, info->memstk.top, info->memstk.limit);
                STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
                return -1;
        }
 
        if (info->ip == prev_ip && info->sp == prev_sp && info->bsp == prev_bsp) {
                UNW_DPRINT(0, "unwind.%s: ip, sp, bsp unchanged; stopping here (ip=0x%lx)\n",
-                          __FUNCTION__, ip);
+                          __func__, ip);
                STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
                return -1;
        }
@@ -1961,7 +1961,7 @@ unw_unwind_to_user (struct unw_frame_info *info)
                if ((long)((unsigned long)info->task + IA64_STK_OFFSET - sp)
                    < IA64_PT_REGS_SIZE) {
                        UNW_DPRINT(0, "unwind.%s: ran off the top of the kernel stack\n",
-                                  __FUNCTION__);
+                                  __func__);
                        break;
                }
                if (unw_is_intr_frame(info) &&
@@ -1971,13 +1971,13 @@ unw_unwind_to_user (struct unw_frame_info *info)
                        unw_get_rp(info, &ip);
                        UNW_DPRINT(0, "unwind.%s: failed to read "
                                   "predicate register (ip=0x%lx)\n",
-                               __FUNCTION__, ip);
+                               __func__, ip);
                        return -1;
                }
        } while (unw_unwind(info) >= 0);
        unw_get_ip(info, &ip);
        UNW_DPRINT(0, "unwind.%s: failed to unwind to user-level (ip=0x%lx)\n",
-                  __FUNCTION__, ip);
+                  __func__, ip);
        return -1;
 }
 EXPORT_SYMBOL(unw_unwind_to_user);
@@ -2028,7 +2028,7 @@ init_frame_info (struct unw_frame_info *info, struct task_struct *t,
                   "  pr     0x%lx\n"
                   "  sw     0x%lx\n"
                   "  sp     0x%lx\n",
-                  __FUNCTION__, (unsigned long) t, rbslimit, rbstop, stktop, stklimit,
+                  __func__, (unsigned long) t, rbslimit, rbstop, stktop, stklimit,
                   info->pr, (unsigned long) info->sw, info->sp);
        STAT(unw.stat.api.init_time += ia64_get_itc() - start; local_irq_restore(flags));
 }
@@ -2047,7 +2047,7 @@ unw_init_frame_info (struct unw_frame_info *info, struct task_struct *t, struct
                   "  bsp    0x%lx\n"
                   "  sol    0x%lx\n"
                   "  ip     0x%lx\n",
-                  __FUNCTION__, info->bsp, sol, info->ip);
+                  __func__, info->bsp, sol, info->ip);
        find_save_locs(info);
 }
 
@@ -2058,7 +2058,7 @@ unw_init_from_blocked_task (struct unw_frame_info *info, struct task_struct *t)
 {
        struct switch_stack *sw = (struct switch_stack *) (t->thread.ksp + 16);
 
-       UNW_DPRINT(1, "unwind.%s\n", __FUNCTION__);
+       UNW_DPRINT(1, "unwind.%s\n", __func__);
        unw_init_frame_info(info, t, sw);
 }
 EXPORT_SYMBOL(unw_init_from_blocked_task);
@@ -2088,7 +2088,7 @@ unw_add_unwind_table (const char *name, unsigned long segment_base, unsigned lon
 
        if (end - start <= 0) {
                UNW_DPRINT(0, "unwind.%s: ignoring attempt to insert empty unwind table\n",
-                          __FUNCTION__);
+                          __func__);
                return NULL;
        }
 
@@ -2119,14 +2119,14 @@ unw_remove_unwind_table (void *handle)
 
        if (!handle) {
                UNW_DPRINT(0, "unwind.%s: ignoring attempt to remove non-existent unwind table\n",
-                          __FUNCTION__);
+                          __func__);
                return;
        }
 
        table = handle;
        if (table == &unw.kernel_table) {
                UNW_DPRINT(0, "unwind.%s: sorry, freeing the kernel's unwind table is a "
-                          "no-can-do!\n", __FUNCTION__);
+                          "no-can-do!\n", __func__);
                return;
        }
 
@@ -2139,7 +2139,7 @@ unw_remove_unwind_table (void *handle)
                                break;
                if (!prev) {
                        UNW_DPRINT(0, "unwind.%s: failed to find unwind table %p\n",
-                                  __FUNCTION__, (void *) table);
+                                  __func__, (void *) table);
                        spin_unlock_irqrestore(&unw.lock, flags);
                        return;
                }
@@ -2185,7 +2185,7 @@ create_gate_table (void)
                }
 
        if (!punw) {
-               printk("%s: failed to find gate DSO's unwind table!\n", __FUNCTION__);
+               printk("%s: failed to find gate DSO's unwind table!\n", __func__);
                return 0;
        }
 
@@ -2202,7 +2202,7 @@ create_gate_table (void)
        unw.gate_table = kmalloc(size, GFP_KERNEL);
        if (!unw.gate_table) {
                unw.gate_table_size = 0;
-               printk(KERN_ERR "%s: unable to create unwind data for gate page!\n", __FUNCTION__);
+               printk(KERN_ERR "%s: unable to create unwind data for gate page!\n", __func__);
                return 0;
        }
        unw.gate_table_size = size;
index 3e69881648a35ea1b91536b52eeb9387de9fd8d6..23088bed111ec229c4df3b1315da0e0fce7411a3 100644 (file)
@@ -26,7 +26,7 @@ static inline int notify_page_fault(struct pt_regs *regs, int trap)
        if (!user_mode(regs)) {
                /* kprobe_running() needs smp_processor_id() */
                preempt_disable();
-               if (kprobe_running() && kprobes_fault_handler(regs, trap))
+               if (kprobe_running() && kprobe_fault_handler(regs, trap))
                        ret = 1;
                preempt_enable();
        }
index 25aef6211a54be964778e5e42165bb2d0e3738f1..a4ca657c72c6905a10f9f59be54e7bb260d2922b 100644 (file)
@@ -714,7 +714,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
 
        if (ret)
                printk("%s: Problem encountered in __add_pages() as ret=%d\n",
-                      __FUNCTION__,  ret);
+                      __func__,  ret);
 
        return ret;
 }
index 245dc1fedc24cea6de45d8fb6faee3fae77bac6c..f5959c0c1810422358f48498b29e44dcc743b4b5 100644 (file)
@@ -63,7 +63,7 @@ static void __devinit pci_fixup_video(struct pci_dev *pdev)
        pci_read_config_word(pdev, PCI_COMMAND, &config);
        if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
                pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
-               printk(KERN_DEBUG "Boot video device is %s\n", pci_name(pdev));
+               dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
        }
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);
index 8fd7e825192b60160bf82215ed3004d22da075eb..e282c348dcde0b9a4a6b04b0d7a5077f449518b1 100644 (file)
@@ -765,7 +765,7 @@ static void __init set_pci_cacheline_size(void)
        status = ia64_pal_cache_summary(&levels, &unique_caches);
        if (status != 0) {
                printk(KERN_ERR "%s: ia64_pal_cache_summary() failed "
-                       "(status=%ld)\n", __FUNCTION__, status);
+                       "(status=%ld)\n", __func__, status);
                return;
        }
 
@@ -773,7 +773,7 @@ static void __init set_pci_cacheline_size(void)
                                /* cache_type (data_or_unified)= */ 2, &cci);
        if (status != 0) {
                printk(KERN_ERR "%s: ia64_pal_cache_config_info() failed "
-                       "(status=%ld)\n", __FUNCTION__, status);
+                       "(status=%ld)\n", __func__, status);
                return;
        }
        pci_cache_line_size = (1 << cci.pcci_line_size) / 4;
index b663168da55c5f32f1114b446fa0dd0244f4faea..0101c7924a4d4943dc4c4a4823967e1477dbbf54 100644 (file)
@@ -37,7 +37,7 @@ static irqreturn_t hub_eint_handler(int irq, void *arg)
                        (u64) nasid, 0, 0, 0, 0, 0, 0);
 
                if ((int)ret_stuff.v0)
-                       panic("%s: Fatal %s Error", __FUNCTION__,
+                       panic("%s: Fatal %s Error", __func__,
                                ((nasid & 1) ? "TIO" : "HUBII"));
 
                if (!(nasid & 1)) /* Not a TIO, handle CRB errors */
@@ -48,7 +48,7 @@ static irqreturn_t hub_eint_handler(int irq, void *arg)
                                (u64) nasid, 0, 0, 0, 0, 0, 0);
 
                        if ((int)ret_stuff.v0)
-                               panic("%s: Fatal TIO Error", __FUNCTION__);
+                               panic("%s: Fatal TIO Error", __func__);
                } else
                        bte_error_handler((unsigned long)NODEPDA(nasid_to_cnodeid(nasid)));
 
index 3c7178f5dce82bad1492cbc006579db7f18ad98e..6568942a95f074514d28a96e7ab5b0acffff5173 100644 (file)
@@ -133,7 +133,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
        if (ACPI_FAILURE(status)) {
                printk(KERN_ERR "%s: "
                       "acpi_get_vendor_resource() failed (0x%x) for: ",
-                      __FUNCTION__, status);
+                      __func__, status);
                acpi_ns_print_node_pathname(handle, NULL);
                printk("\n");
                return NULL;
@@ -145,7 +145,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
             sizeof(struct pcibus_bussoft *)) {
                printk(KERN_ERR
                       "%s: Invalid vendor data length %d\n",
-                       __FUNCTION__, vendor->byte_length);
+                       __func__, vendor->byte_length);
                kfree(buffer.pointer);
                return NULL;
        }
@@ -184,7 +184,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
        if (ACPI_FAILURE(status)) {
                printk(KERN_ERR
                       "%s: acpi_get_vendor_resource() failed (0x%x) for: ",
-                       __FUNCTION__, status);
+                       __func__, status);
                acpi_ns_print_node_pathname(handle, NULL);
                printk("\n");
                return 1;
@@ -196,7 +196,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
            sizeof(struct pci_devdev_info *)) {
                printk(KERN_ERR
                       "%s: Invalid vendor data length: %d for: ",
-                       __FUNCTION__, vendor->byte_length);
+                       __func__, vendor->byte_length);
                acpi_ns_print_node_pathname(handle, NULL);
                printk("\n");
                ret = 1;
@@ -205,7 +205,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
 
        pcidev_ptr = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL);
        if (!pcidev_ptr)
-               panic("%s: Unable to alloc memory for pcidev_info", __FUNCTION__);
+               panic("%s: Unable to alloc memory for pcidev_info", __func__);
 
        memcpy(&addr, vendor->byte_data, sizeof(struct pcidev_info *));
        pcidev_prom_ptr = __va(addr);
@@ -214,7 +214,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
        /* Get the IRQ info */
        irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL);
        if (!irq_info)
-                panic("%s: Unable to alloc memory for sn_irq_info", __FUNCTION__);
+                panic("%s: Unable to alloc memory for sn_irq_info", __func__);
 
        if (pcidev_ptr->pdi_sn_irq_info) {
                irq_info_prom = __va(pcidev_ptr->pdi_sn_irq_info);
@@ -249,10 +249,10 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
                status = acpi_get_parent(child, &parent);
                if (ACPI_FAILURE(status)) {
                        printk(KERN_ERR "%s: acpi_get_parent() failed "
-                              "(0x%x) for: ", __FUNCTION__, status);
+                              "(0x%x) for: ", __func__, status);
                        acpi_ns_print_node_pathname(child, NULL);
                        printk("\n");
-                       panic("%s: Unable to find host devfn\n", __FUNCTION__);
+                       panic("%s: Unable to find host devfn\n", __func__);
                }
                if (parent == rootbus_handle)
                        break;
@@ -260,7 +260,7 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
        }
        if (!child) {
                printk(KERN_ERR "%s: Unable to find root bus for: ",
-                      __FUNCTION__);
+                      __func__);
                acpi_ns_print_node_pathname(device_handle, NULL);
                printk("\n");
                BUG();
@@ -269,10 +269,10 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
        status = acpi_evaluate_integer(child, METHOD_NAME__ADR, NULL, &adr);
        if (ACPI_FAILURE(status)) {
                printk(KERN_ERR "%s: Unable to get _ADR (0x%x) for: ",
-                      __FUNCTION__, status);
+                      __func__, status);
                acpi_ns_print_node_pathname(child, NULL);
                printk("\n");
-               panic("%s: Unable to find host devfn\n", __FUNCTION__);
+               panic("%s: Unable to find host devfn\n", __func__);
        }
 
        slot = (adr >> 16) & 0xffff;
@@ -308,7 +308,7 @@ find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv)
                if (ACPI_FAILURE(status)) {
                        printk(KERN_ERR
                               "%s: acpi_get_parent() failed (0x%x) for: ",
-                                       __FUNCTION__, status);
+                                       __func__, status);
                        acpi_ns_print_node_pathname(handle, NULL);
                        printk("\n");
                        return AE_OK;
@@ -318,7 +318,7 @@ find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv)
                if (ACPI_FAILURE(status)) {
                        printk(KERN_ERR
                          "%s: Failed to find _BBN in parent of: ",
-                                       __FUNCTION__);
+                                       __func__);
                        acpi_ns_print_node_pathname(handle, NULL);
                        printk("\n");
                        return AE_OK;
@@ -358,14 +358,14 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
                if (segment != pci_domain_nr(dev)) {
                        printk(KERN_ERR
                               "%s: Segment number mismatch, 0x%lx vs 0x%x for: ",
-                              __FUNCTION__, segment, pci_domain_nr(dev));
+                              __func__, segment, pci_domain_nr(dev));
                        acpi_ns_print_node_pathname(rootbus_handle, NULL);
                        printk("\n");
                        return 1;
                }
        } else {
                printk(KERN_ERR "%s: Unable to get __SEG from: ",
-                      __FUNCTION__);
+                      __func__);
                acpi_ns_print_node_pathname(rootbus_handle, NULL);
                printk("\n");
                return 1;
@@ -386,7 +386,7 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
        if (!pcidev_match.handle) {
                printk(KERN_ERR
                       "%s: Could not find matching ACPI device for %s.\n",
-                      __FUNCTION__, pci_name(dev));
+                      __func__, pci_name(dev));
                return 1;
        }
 
@@ -422,7 +422,7 @@ sn_acpi_slot_fixup(struct pci_dev *dev)
 
        if (sn_acpi_get_pcidev_info(dev, &pcidev_info, &sn_irq_info)) {
                panic("%s:  Failure obtaining pcidev_info for %s\n",
-                     __FUNCTION__, pci_name(dev));
+                     __func__, pci_name(dev));
        }
 
        if (pcidev_info->pdi_pio_mapped_addr[PCI_ROM_RESOURCE]) {
@@ -463,7 +463,7 @@ sn_acpi_bus_fixup(struct pci_bus *bus)
                        printk(KERN_ERR
                               "%s: 0x%04x:0x%02x Unable to "
                               "obtain prom_bussoft_ptr\n",
-                              __FUNCTION__, pci_domain_nr(bus), bus->number);
+                              __func__, pci_domain_nr(bus), bus->number);
                        return;
                }
                sn_common_bus_fixup(bus, prom_bussoft_ptr);
index c4eb84f9e78119c624889e02b43bbfbcca489730..8a924a5661ddffff994bb59a74762b9f5bd5555a 100644 (file)
@@ -364,7 +364,7 @@ void sn_bus_store_sysdata(struct pci_dev *dev)
 
        element = kzalloc(sizeof(struct sysdata_el), GFP_KERNEL);
        if (!element) {
-               dev_dbg(&dev->dev, "%s: out of memory!\n", __FUNCTION__);
+               dev_dbg(&dev->dev, "%s: out of memory!\n", __func__);
                return;
        }
        element->sysdata = SN_PCIDEV_INFO(dev);
index 906b93674b7604e236099c42f68cd8228a1876ed..c3aa851d1ca60278c9897859ba9a6740976ae6c9 100644 (file)
@@ -209,11 +209,11 @@ sn_io_slot_fixup(struct pci_dev *dev)
 
        pcidev_info = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL);
        if (!pcidev_info)
-               panic("%s: Unable to alloc memory for pcidev_info", __FUNCTION__);
+               panic("%s: Unable to alloc memory for pcidev_info", __func__);
 
        sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL);
        if (!sn_irq_info)
-               panic("%s: Unable to alloc memory for sn_irq_info", __FUNCTION__);
+               panic("%s: Unable to alloc memory for sn_irq_info", __func__);
 
        /* Call to retrieve pci device information needed by kernel. */
        status = sal_get_pcidev_info((u64) pci_domain_nr(dev),
index 868c9aa64fe2db7af71a78016ab637b9b0a18a12..27793f7aa99c3c406b5547511a59347b05dd0210 100644 (file)
@@ -100,7 +100,7 @@ sn_platform_plat_specific_err_print(const u8 * sect_header, u8 ** oemdata,
                if (!newbuf) {
                        mutex_unlock(&sn_oemdata_mutex);
                        printk(KERN_ERR "%s: unable to extend sn_oemdata\n",
-                              __FUNCTION__);
+                              __func__);
                        return 1;
                }
                vfree(*sn_oemdata);
index 511db2fd7bff9ad50dd92b7af192c486e73ad27b..18b94b792d5491bad4ccf3f650ce0feecfaed073 100644 (file)
@@ -116,7 +116,7 @@ void *sn_dma_alloc_coherent(struct device *dev, size_t size,
        *dma_handle = provider->dma_map_consistent(pdev, phys_addr, size,
                                                   SN_DMA_ADDR_PHYS);
        if (!*dma_handle) {
-               printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__);
+               printk(KERN_ERR "%s: out of ATEs\n", __func__);
                free_pages((unsigned long)cpuaddr, get_order(size));
                return NULL;
        }
@@ -179,7 +179,7 @@ dma_addr_t sn_dma_map_single(struct device *dev, void *cpu_addr, size_t size,
        phys_addr = __pa(cpu_addr);
        dma_addr = provider->dma_map(pdev, phys_addr, size, SN_DMA_ADDR_PHYS);
        if (!dma_addr) {
-               printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__);
+               printk(KERN_ERR "%s: out of ATEs\n", __func__);
                return 0;
        }
        return dma_addr;
@@ -266,7 +266,7 @@ int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl, int nhwentries,
                                                    SN_DMA_ADDR_PHYS);
 
                if (!sg->dma_address) {
-                       printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__);
+                       printk(KERN_ERR "%s: out of ATEs\n", __func__);
 
                        /*
                         * Free any successfully allocated entries.
index ef048a67477266925db3ce45a562bc318287b06d..529462c01570437aafdc8c9198ad394b8904e238 100644 (file)
@@ -88,7 +88,7 @@ tioca_gart_init(struct tioca_kernel *tioca_kern)
                break;
        default:
                printk(KERN_ERR "%s:  Invalid CA_APERATURE_SIZE "
-                      "0x%lx\n", __FUNCTION__, (ulong) CA_APERATURE_SIZE);
+                      "0x%lx\n", __func__, (ulong) CA_APERATURE_SIZE);
                return -1;
        }
 
@@ -124,7 +124,7 @@ tioca_gart_init(struct tioca_kernel *tioca_kern)
        if (!tmp) {
                printk(KERN_ERR "%s:  Could not allocate "
                       "%lu bytes (order %d) for GART\n",
-                      __FUNCTION__,
+                      __func__,
                       tioca_kern->ca_gart_size,
                       get_order(tioca_kern->ca_gart_size));
                return -ENOMEM;
@@ -341,7 +341,7 @@ tioca_dma_d48(struct pci_dev *pdev, u64 paddr)
 
        if (node_upper > 64) {
                printk(KERN_ERR "%s:  coretalk addr 0x%p node id out "
-                      "of range\n", __FUNCTION__, (void *)ct_addr);
+                      "of range\n", __func__, (void *)ct_addr);
                return 0;
        }
 
@@ -349,7 +349,7 @@ tioca_dma_d48(struct pci_dev *pdev, u64 paddr)
        if (node_upper != (agp_dma_extn >> CA_AGP_DMA_NODE_ID_SHFT)) {
                printk(KERN_ERR "%s:  coretalk upper node (%u) "
                       "mismatch with ca_agp_dma_addr_extn (%lu)\n",
-                      __FUNCTION__,
+                      __func__,
                       node_upper, (agp_dma_extn >> CA_AGP_DMA_NODE_ID_SHFT));
                return 0;
        }
@@ -597,7 +597,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
        if (is_shub1() && sn_sal_rev() < 0x0406) {
                printk
                    (KERN_ERR "%s:  SGI prom rev 4.06 or greater required "
-                    "for tioca support\n", __FUNCTION__);
+                    "for tioca support\n", __func__);
                return NULL;
        }
 
@@ -651,7 +651,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
                printk(KERN_WARNING
                       "%s:  Unable to get irq %d.  "
                       "Error interrupts won't be routed for TIOCA bus %d\n",
-                      __FUNCTION__, SGI_TIOCA_ERROR,
+                      __func__, SGI_TIOCA_ERROR,
                       (int)tioca_common->ca_common.bs_persist_busnum);
 
        sn_set_err_irq_affinity(SGI_TIOCA_ERROR);
index 999f14f986e2cc99c8f6204d598092e2e942d4ea..9b3c11373022d2bd1319836b05eb92b97a06e4d7 100644 (file)
@@ -494,7 +494,7 @@ tioce_dma_unmap(struct pci_dev *pdev, dma_addr_t bus_addr, int dir)
                if (&map->ce_dmamap_list == &ce_kern->ce_dmamap_list) {
                        printk(KERN_WARNING
                               "%s:  %s - no map found for bus_addr 0x%lx\n",
-                              __FUNCTION__, pci_name(pdev), bus_addr);
+                              __func__, pci_name(pdev), bus_addr);
                } else if (--map->refcnt == 0) {
                        for (i = 0; i < map->ate_count; i++) {
                                map->ate_shadow[i] = 0;
@@ -1030,7 +1030,7 @@ tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
                       "%s:  Unable to get irq %d.  "
                       "Error interrupts won't be routed for "
                       "TIOCE bus %04x:%02x\n",
-                      __FUNCTION__, SGI_PCIASIC_ERROR,
+                      __func__, SGI_PCIASIC_ERROR,
                       tioce_common->ce_pcibus.bs_persist_segment,
                       tioce_common->ce_pcibus.bs_persist_busnum);
 
index 6dfa3b3c0e2a737d0b128e33cc1e6965e1aa8d00..18a9c5f4b00d4745dc8dfadb6c33c113ca705b37 100644 (file)
@@ -742,7 +742,9 @@ sys_call_table:
        .long sys_epoll_pwait           /* 315 */
        .long sys_utimensat
        .long sys_signalfd
-       .long sys_ni_syscall
+       .long sys_timerfd_create
        .long sys_eventfd
        .long sys_fallocate             /* 320 */
+       .long sys_timerfd_settime
+       .long sys_timerfd_gettime
 
index 648113075f9722cf0be3c657c7fc28554d533028..670b0a99cfa096424b131e2005a970cfc311b72c 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23
-# Thu Oct 18 13:17:38 2007
+# Linux kernel version: 2.6.25-rc3
+# Mon Feb 25 15:03:00 2008
 #
 CONFIG_M68K=y
 # CONFIG_MMU is not set
@@ -15,8 +15,10 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME=y
 CONFIG_TIME_LOW_RES=y
 CONFIG_NO_IOPORT=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -31,12 +33,14 @@ CONFIG_LOCALVERSION_AUTO=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
 # CONFIG_SYSFS_DEPRECATED is not set
 # CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
 # CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
@@ -48,15 +52,22 @@ CONFIG_SYSCTL_SYSCALL=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
 # CONFIG_SIGNALFD is not set
+# CONFIG_TIMERFD is not set
 # CONFIG_EVENTFD is not set
 # CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+# CONFIG_HAVE_OPROFILE is not set
+# CONFIG_HAVE_KPROBES is not set
+CONFIG_SLABINFO=y
 CONFIG_TINY_SHMEM=y
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
@@ -83,6 +94,8 @@ CONFIG_IOSCHED_NOOP=y
 # CONFIG_DEFAULT_CFQ is not set
 CONFIG_DEFAULT_NOOP=y
 CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_RCU is not set
 
 #
 # Processor type and features
@@ -121,6 +134,7 @@ CONFIG_M5272C3=y
 # CONFIG_MOD5272 is not set
 CONFIG_FREESCALE=y
 CONFIG_4KSTACKS=y
+CONFIG_HZ=100
 
 #
 # RAM configuration
@@ -147,6 +161,7 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
@@ -158,10 +173,6 @@ CONFIG_VIRT_TO_BUS=y
 # CONFIG_PCI is not set
 # CONFIG_ARCH_SUPPORTS_MSI is not set
 
-#
-# PCCARD (PCMCIA/CardBus) support
-#
-
 #
 # Executable file formats
 #
@@ -205,6 +216,7 @@ CONFIG_IP_FIB_HASH=y
 # CONFIG_INET_XFRM_MODE_TRANSPORT is not set
 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_CUBIC=y
@@ -229,10 +241,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -240,6 +248,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
@@ -283,6 +292,7 @@ CONFIG_MTD_BLOCK=y
 # CONFIG_INFTL is not set
 # CONFIG_RFD_FTL is not set
 # CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -339,10 +349,11 @@ CONFIG_BLK_DEV=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 # CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -360,9 +371,15 @@ CONFIG_NETDEVICES=y
 # CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
+# CONFIG_VETH is not set
 # CONFIG_PHYLIB is not set
 CONFIG_NET_ETHERNET=y
 # CONFIG_MII is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
 CONFIG_FEC=y
 # CONFIG_FEC2 is not set
 # CONFIG_NETDEV_1000 is not set
@@ -377,7 +394,7 @@ CONFIG_FEC=y
 CONFIG_PPP=y
 # CONFIG_PPP_MULTILINK is not set
 # CONFIG_PPP_FILTER is not set
-# CONFIG_PPP_ASYNC is not set
+CONFIG_PPP_ASYNC=y
 # CONFIG_PPP_SYNC_TTY is not set
 # CONFIG_PPP_DEFLATE is not set
 # CONFIG_PPP_BSDCOMP is not set
@@ -386,7 +403,6 @@ CONFIG_PPP=y
 # CONFIG_PPPOL2TP is not set
 # CONFIG_SLIP is not set
 CONFIG_SLHC=y
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -418,12 +434,16 @@ CONFIG_SLHC=y
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_COLDFIRE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_COLDFIRE is not set
+CONFIG_SERIAL_MCF=y
+CONFIG_SERIAL_MCF_BAUDRATE=19200
+CONFIG_SERIAL_MCF_CONSOLE=y
 # CONFIG_UNIX98_PTYS is not set
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_GEN_RTC is not set
 # CONFIG_R3964 is not set
@@ -439,6 +459,14 @@ CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
@@ -450,20 +478,20 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 # CONFIG_VIDEO_DEV is not set
 # CONFIG_DVB_CORE is not set
-CONFIG_DAB=y
+# CONFIG_DAB is not set
 
 #
 # Graphics support
 #
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Display device support
 #
 # CONFIG_DISPLAY_SUPPORT is not set
-# CONFIG_VGASTATE is not set
-CONFIG_VIDEO_OUTPUT_CONTROL=y
-# CONFIG_FB is not set
 
 #
 # Sound
@@ -471,22 +499,10 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
 # CONFIG_SOUND is not set
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
 # CONFIG_RTC_CLASS is not set
 
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
 #
 # Userspace I/O
 #
@@ -505,11 +521,9 @@ CONFIG_EXT2_FS=y
 # CONFIG_XFS_FS is not set
 # CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-CONFIG_ROMFS_FS=y
+# CONFIG_DNOTIFY is not set
 # CONFIG_INOTIFY is not set
 # CONFIG_QUOTA is not set
-# CONFIG_DNOTIFY is not set
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -535,7 +549,6 @@ CONFIG_PROC_SYSCTL=y
 CONFIG_SYSFS=y
 # CONFIG_TMPFS is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -551,42 +564,27 @@ CONFIG_RAMFS=y
 # CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+CONFIG_ROMFS_FS=y
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
-# CONFIG_NFS_FS is not set
-# CONFIG_NFSD is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_AFS_FS is not set
+# CONFIG_NETWORK_FILESYSTEMS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 # CONFIG_NLS is not set
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 # CONFIG_ENABLE_MUST_CHECK is not set
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -594,6 +592,7 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
 # CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_SAMPLES is not set
 # CONFIG_FULLDEBUG is not set
 # CONFIG_HIGHPROFILE is not set
 # CONFIG_BOOTPARAM is not set
@@ -605,6 +604,7 @@ CONFIG_MSDOS_PARTITION=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 # CONFIG_CRYPTO is not set
 
 #
index 1b02b88200680c8ebbec377d4c67b56622bc1595..fca2e49917a37179bb0d99646d011edf52dc96e2 100644 (file)
@@ -336,9 +336,11 @@ ENTRY(sys_call_table)
        .long sys_epoll_pwait           /* 315 */
        .long sys_utimensat
        .long sys_signalfd
-       .long sys_ni_syscall
+       .long sys_timerfd_create
        .long sys_eventfd
        .long sys_fallocate             /* 320 */
+       .long sys_timerfd_settime
+       .long sys_timerfd_gettime
 
        .rept NR_syscalls-(.-sys_call_table)/4
                .long sys_ni_syscall
index 9159fd05c9ac7638e64af74f8f9502936142d721..6bafefa546e5cd810531ff654fd1d8192a3749b1 100644 (file)
@@ -67,16 +67,6 @@ static irqreturn_t hw_tick(int irq, void *dummy)
 
 /***************************************************************************/
 
-static irqreturn_t hw_tick(int irq, void *dummy)
-{
-       /* Reset Timer1 */
-       TSTAT &= 0;
-
-       return arch_timer_interrupt(irq, dummy);
-}
-
-/***************************************************************************/
-
 static struct irqaction m68328_timer_irq = {
        .name    = "timer",
        .flags   = IRQF_DISABLED | IRQF_TIMER,
index 5b8d8382b7629e93ccdb07a7d86b96049f587e38..1189d8d6170d252013ddcf112903073297308da7 100644 (file)
@@ -90,6 +90,7 @@ config PPC
        select HAVE_IDE
        select HAVE_OPROFILE
        select HAVE_KPROBES
+       select HAVE_KRETPROBES
 
 config EARLY_PRINTK
        bool
index a3637fff73ccea43951ccca804d4e62e4452a376..49c05e97386cfccfd520e3ab17de4d0c2b787bba 100644 (file)
                reg = <0x00000000 0x20000000>;  // 512MB at 0
        };
 
+       localbus@e0005000 {
+               #address-cells = <2>;
+               #size-cells = <1>;
+               compatible = "fsl,mpc8377-elbc", "fsl,elbc", "simple-bus";
+               reg = <0xe0005000 0x1000>;
+               interrupts = <77 0x8>;
+               interrupt-parent = <&ipic>;
+
+               // booting from NOR flash
+               ranges = <0 0x0 0xfe000000 0x02000000
+                         1 0x0 0xf8000000 0x00008000
+                         3 0x0 0xe0600000 0x00008000>;
+
+               flash@0,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "cfi-flash";
+                       reg = <0 0x0 0x2000000>;
+                       bank-width = <2>;
+                       device-width = <1>;
+
+                       u-boot@0 {
+                               reg = <0x0 0x100000>;
+                               read-only;
+                       };
+
+                       fs@100000 {
+                               reg = <0x100000 0x800000>;
+                       };
+
+                       kernel@1d00000 {
+                               reg = <0x1d00000 0x200000>;
+                       };
+
+                       dtb@1f00000 {
+                               reg = <0x1f00000 0x100000>;
+                       };
+               };
+
+               bcsr@1,0 {
+                       reg = <1 0x0 0x8000>;
+                       compatible = "fsl,mpc837xmds-bcsr";
+               };
+
+               nand@3,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "fsl,mpc8377-fcm-nand",
+                                    "fsl,elbc-fcm-nand";
+                       reg = <3 0x0 0x8000>;
+
+                       u-boot@0 {
+                               reg = <0x0 0x100000>;
+                               read-only;
+                       };
+
+                       kernel@100000 {
+                               reg = <0x100000 0x300000>;
+                       };
+
+                       fs@400000 {
+                               reg = <0x400000 0x1c00000>;
+                       };
+               };
+       };
+
        soc@e0000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                        mode = "cpu";
                };
 
-               /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
                usb@23000 {
                        compatible = "fsl-usb2-dr";
                        reg = <0x23000 0x1000>;
                        #size-cells = <0>;
                        interrupt-parent = <&ipic>;
                        interrupts = <38 0x8>;
-                       phy_type = "utmi_wide";
+                       dr_mode = "host";
+                       phy_type = "ulpi";
                };
 
                mdio@24520 {
index 533e9b06cc8f7f11a62ce17e2e81ed291d62fa85..1d6ea080ad730d6224caecf1d185a9b69e1aeea0 100644 (file)
                reg = <0x00000000 0x20000000>;  // 512MB at 0
        };
 
+       localbus@e0005000 {
+               #address-cells = <2>;
+               #size-cells = <1>;
+               compatible = "fsl,mpc8378-elbc", "fsl,elbc", "simple-bus";
+               reg = <0xe0005000 0x1000>;
+               interrupts = <77 0x8>;
+               interrupt-parent = <&ipic>;
+
+               // booting from NOR flash
+               ranges = <0 0x0 0xfe000000 0x02000000
+                         1 0x0 0xf8000000 0x00008000
+                         3 0x0 0xe0600000 0x00008000>;
+
+               flash@0,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "cfi-flash";
+                       reg = <0 0x0 0x2000000>;
+                       bank-width = <2>;
+                       device-width = <1>;
+
+                       u-boot@0 {
+                               reg = <0x0 0x100000>;
+                               read-only;
+                       };
+
+                       fs@100000 {
+                               reg = <0x100000 0x800000>;
+                       };
+
+                       kernel@1d00000 {
+                               reg = <0x1d00000 0x200000>;
+                       };
+
+                       dtb@1f00000 {
+                               reg = <0x1f00000 0x100000>;
+                       };
+               };
+
+               bcsr@1,0 {
+                       reg = <1 0x0 0x8000>;
+                       compatible = "fsl,mpc837xmds-bcsr";
+               };
+
+               nand@3,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "fsl,mpc8378-fcm-nand",
+                                    "fsl,elbc-fcm-nand";
+                       reg = <3 0x0 0x8000>;
+
+                       u-boot@0 {
+                               reg = <0x0 0x100000>;
+                               read-only;
+                       };
+
+                       kernel@100000 {
+                               reg = <0x100000 0x300000>;
+                       };
+
+                       fs@400000 {
+                               reg = <0x400000 0x1c00000>;
+                       };
+               };
+       };
+
        soc@e0000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                        mode = "cpu";
                };
 
-               /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
                usb@23000 {
                        compatible = "fsl-usb2-dr";
                        reg = <0x23000 0x1000>;
                        #size-cells = <0>;
                        interrupt-parent = <&ipic>;
                        interrupts = <38 0x8>;
-                       phy_type = "utmi_wide";
+                       dr_mode = "host";
+                       phy_type = "ulpi";
                };
 
                mdio@24520 {
index c270685bbde4d26e53a12a0bc6bf43282997501b..fdb4a9255b24ab5a3070a578f03f427d1b27055b 100644 (file)
                reg = <0x00000000 0x20000000>;  // 512MB at 0
        };
 
+       localbus@e0005000 {
+               #address-cells = <2>;
+               #size-cells = <1>;
+               compatible = "fsl,mpc8379-elbc", "fsl,elbc", "simple-bus";
+               reg = <0xe0005000 0x1000>;
+               interrupts = <77 0x8>;
+               interrupt-parent = <&ipic>;
+
+               // booting from NOR flash
+               ranges = <0 0x0 0xfe000000 0x02000000
+                         1 0x0 0xf8000000 0x00008000
+                         3 0x0 0xe0600000 0x00008000>;
+
+               flash@0,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "cfi-flash";
+                       reg = <0 0x0 0x2000000>;
+                       bank-width = <2>;
+                       device-width = <1>;
+
+                       u-boot@0 {
+                               reg = <0x0 0x100000>;
+                               read-only;
+                       };
+
+                       fs@100000 {
+                               reg = <0x100000 0x800000>;
+                       };
+
+                       kernel@1d00000 {
+                               reg = <0x1d00000 0x200000>;
+                       };
+
+                       dtb@1f00000 {
+                               reg = <0x1f00000 0x100000>;
+                       };
+               };
+
+               bcsr@1,0 {
+                       reg = <1 0x0 0x8000>;
+                       compatible = "fsl,mpc837xmds-bcsr";
+               };
+
+               nand@3,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "fsl,mpc8379-fcm-nand",
+                                    "fsl,elbc-fcm-nand";
+                       reg = <3 0x0 0x8000>;
+
+                       u-boot@0 {
+                               reg = <0x0 0x100000>;
+                               read-only;
+                       };
+
+                       kernel@100000 {
+                               reg = <0x100000 0x300000>;
+                       };
+
+                       fs@400000 {
+                               reg = <0x400000 0x1c00000>;
+                       };
+               };
+       };
+
        soc@e0000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                        mode = "cpu";
                };
 
-               /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
                usb@23000 {
                        compatible = "fsl-usb2-dr";
                        reg = <0x23000 0x1000>;
                        #size-cells = <0>;
                        interrupt-parent = <&ipic>;
                        interrupts = <38 0x8>;
-                       phy_type = "utmi_wide";
+                       dr_mode = "host";
+                       phy_type = "ulpi";
                };
 
                mdio@24520 {
index 14be38ad5d4b30f4ff3fcaa0a118680a68ba5df5..b86e65d926c16e40acffd304193018075deffa88 100644 (file)
                cell-index = <0>;
                interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
-                       /* IDSEL 0x01 (PCI-X slot) */
-                       0x0800 0x0 0x0 0x1 &mpic 0x0 0x1
-                       0x0800 0x0 0x0 0x2 &mpic 0x1 0x1
-                       0x0800 0x0 0x0 0x3 &mpic 0x2 0x1
-                       0x0800 0x0 0x0 0x4 &mpic 0x3 0x1>;
+                       /* IDSEL 0x01 (PCI-X slot) @66MHz */
+                       0x0800 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x0800 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x0800 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x0800 0x0 0x0 0x4 &mpic 0x1 0x1
+
+                       /* IDSEL 0x11 (PCI, 3.3V 32bit) @33MHz */
+                       0x8800 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x8800 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x8800 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x8800 0x0 0x0 0x4 &mpic 0x1 0x1>;
 
                interrupt-parent = <&mpic>;
                interrupts = <0x18 0x2>;
index c3178155311ba1f565e8af685f61f83046b02db1..d50e498a072b99cd50af01960655a8edae9af27e 100755 (executable)
@@ -191,10 +191,14 @@ ps3)
     ksection=.kernel:vmlinux.bin
     isection=.kernel:initrd
     ;;
-ep88xc|ep405|redboot*|ep8248e)
+ep88xc|ep405|ep8248e)
     platformo="$object/fixed-head.o $object/$platform.o"
     binary=y
     ;;
+adder875-redboot)
+    platformo="$object/fixed-head.o $object/redboot-8xx.o"
+    binary=y
+    ;;
 esac
 
 vmz="$tmpdir/`basename \"$kernel\"`.$ext"
diff --git a/arch/powerpc/configs/adder875-uboot_defconfig b/arch/powerpc/configs/adder875-uboot_defconfig
deleted file mode 100644 (file)
index 1faf7ef..0000000
+++ /dev/null
@@ -1,798 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24-rc6
-# Thu Jan 17 16:17:18 2008
-#
-# CONFIG_PPC64 is not set
-
-#
-# Processor support
-#
-# CONFIG_6xx is not set
-# CONFIG_PPC_85xx is not set
-CONFIG_PPC_8xx=y
-# CONFIG_40x is not set
-# CONFIG_44x is not set
-# CONFIG_E200 is not set
-CONFIG_8xx=y
-# CONFIG_PPC_MM_SLICES is not set
-CONFIG_NOT_COHERENT_CACHE=y
-CONFIG_PPC32=y
-CONFIG_WORD_SIZE=32
-CONFIG_PPC_MERGE=y
-CONFIG_MMU=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_TIME=y
-CONFIG_GENERIC_TIME_VSYSCALL=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_IRQ_PER_CPU=y
-CONFIG_RWSEM_XCHGADD_ALGORITHM=y
-CONFIG_ARCH_HAS_ILOG2_U32=y
-CONFIG_GENERIC_HWEIGHT=y
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
-CONFIG_PPC=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_GENERIC_NVRAM=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-CONFIG_ARCH_MAY_HAVE_PC_FDC=y
-CONFIG_PPC_OF=y
-CONFIG_OF=y
-# CONFIG_PPC_UDBG_16550 is not set
-# CONFIG_GENERIC_TBSYNC is not set
-CONFIG_AUDIT_ARCH=y
-CONFIG_GENERIC_BUG=y
-# CONFIG_DEFAULT_UIMAGE is not set
-CONFIG_REDBOOT=y
-# CONFIG_PPC_DCR_NATIVE is not set
-# CONFIG_PPC_DCR_MMIO is not set
-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
-
-#
-# General setup
-#
-CONFIG_EXPERIMENTAL=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
-CONFIG_LOCALVERSION=""
-CONFIG_LOCALVERSION_AUTO=y
-# CONFIG_SWAP is not set
-CONFIG_SYSVIPC=y
-CONFIG_SYSVIPC_SYSCTL=y
-# CONFIG_POSIX_MQUEUE is not set
-# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
-# CONFIG_PID_NS is not set
-# CONFIG_AUDIT is not set
-# CONFIG_IKCONFIG is not set
-CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_CGROUPS is not set
-CONFIG_FAIR_GROUP_SCHED=y
-CONFIG_FAIR_USER_SCHED=y
-# CONFIG_FAIR_CGROUP_SCHED is not set
-CONFIG_SYSFS_DEPRECATED=y
-# CONFIG_RELAY is not set
-# CONFIG_BLK_DEV_INITRD is not set
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_SYSCTL=y
-CONFIG_EMBEDDED=y
-# CONFIG_SYSCTL_SYSCALL is not set
-CONFIG_KALLSYMS=y
-# CONFIG_KALLSYMS_ALL is not set
-# CONFIG_KALLSYMS_EXTRA_PASS is not set
-CONFIG_HOTPLUG=y
-CONFIG_PRINTK=y
-CONFIG_BUG=y
-# CONFIG_ELF_CORE is not set
-# CONFIG_BASE_FULL is not set
-# CONFIG_FUTEX is not set
-CONFIG_ANON_INODES=y
-CONFIG_EPOLL=y
-CONFIG_SIGNALFD=y
-CONFIG_EVENTFD=y
-CONFIG_SHMEM=y
-# CONFIG_VM_EVENT_COUNTERS is not set
-CONFIG_SLUB_DEBUG=y
-# CONFIG_SLAB is not set
-CONFIG_SLUB=y
-# CONFIG_SLOB is not set
-# CONFIG_TINY_SHMEM is not set
-CONFIG_BASE_SMALL=1
-# CONFIG_MODULES is not set
-CONFIG_BLOCK=y
-# CONFIG_LBD is not set
-# CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
-# CONFIG_BLK_DEV_BSG is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
-# CONFIG_IOSCHED_AS is not set
-CONFIG_IOSCHED_DEADLINE=y
-# CONFIG_IOSCHED_CFQ is not set
-# CONFIG_DEFAULT_AS is not set
-CONFIG_DEFAULT_DEADLINE=y
-# CONFIG_DEFAULT_CFQ is not set
-# CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="deadline"
-
-#
-# Platform support
-#
-# CONFIG_PPC_MPC52xx is not set
-# CONFIG_PPC_MPC5200 is not set
-# CONFIG_PPC_CELL is not set
-# CONFIG_PPC_CELL_NATIVE is not set
-CONFIG_CPM1=y
-# CONFIG_MPC8XXFADS is not set
-# CONFIG_MPC86XADS is not set
-# CONFIG_MPC885ADS is not set
-# CONFIG_PPC_EP88XC is not set
-CONFIG_PPC_ADDER875=y
-
-#
-# MPC8xx CPM Options
-#
-
-#
-# Generic MPC8xx Options
-#
-CONFIG_8xx_COPYBACK=y
-# CONFIG_8xx_CPU6 is not set
-CONFIG_8xx_CPU15=y
-CONFIG_NO_UCODE_PATCH=y
-# CONFIG_USB_SOF_UCODE_PATCH is not set
-# CONFIG_I2C_SPI_UCODE_PATCH is not set
-# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
-# CONFIG_PQ2ADS is not set
-# CONFIG_MPIC is not set
-# CONFIG_MPIC_WEIRD is not set
-# CONFIG_PPC_I8259 is not set
-# CONFIG_PPC_RTAS is not set
-# CONFIG_MMIO_NVRAM is not set
-# CONFIG_PPC_MPC106 is not set
-# CONFIG_PPC_970_NAP is not set
-# CONFIG_PPC_INDIRECT_IO is not set
-# CONFIG_GENERIC_IOMAP is not set
-# CONFIG_CPU_FREQ is not set
-# CONFIG_CPM2 is not set
-CONFIG_PPC_CPM_NEW_BINDING=y
-# CONFIG_FSL_ULI1575 is not set
-CONFIG_CPM=y
-
-#
-# Kernel options
-#
-# CONFIG_HIGHMEM is not set
-# CONFIG_TICK_ONESHOT is not set
-# CONFIG_NO_HZ is not set
-# CONFIG_HIGH_RES_TIMERS is not set
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-# CONFIG_HZ_100 is not set
-# CONFIG_HZ_250 is not set
-# CONFIG_HZ_300 is not set
-CONFIG_HZ_1000=y
-CONFIG_HZ=1000
-CONFIG_PREEMPT_NONE=y
-# CONFIG_PREEMPT_VOLUNTARY is not set
-# CONFIG_PREEMPT is not set
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_MISC is not set
-# CONFIG_MATH_EMULATION is not set
-# CONFIG_8XX_MINIMAL_FPEMU is not set
-CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
-CONFIG_ARCH_FLATMEM_ENABLE=y
-CONFIG_ARCH_POPULATES_NODE_MAP=y
-CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
-# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
-# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
-CONFIG_SPLIT_PTLOCK_CPUS=4
-# CONFIG_RESOURCES_64BIT is not set
-CONFIG_ZONE_DMA_FLAG=1
-CONFIG_BOUNCE=y
-CONFIG_VIRT_TO_BUS=y
-# CONFIG_PROC_DEVICETREE is not set
-# CONFIG_CMDLINE_BOOL is not set
-# CONFIG_PM is not set
-CONFIG_SUSPEND_UP_POSSIBLE=y
-CONFIG_HIBERNATION_UP_POSSIBLE=y
-# CONFIG_SECCOMP is not set
-CONFIG_WANT_DEVICE_TREE=y
-CONFIG_DEVICE_TREE="adder875-uboot.dts"
-CONFIG_ISA_DMA_API=y
-
-#
-# Bus options
-#
-CONFIG_ZONE_DMA=y
-CONFIG_FSL_SOC=y
-# CONFIG_PCI is not set
-# CONFIG_PCI_DOMAINS is not set
-# CONFIG_PCI_SYSCALL is not set
-# CONFIG_PCI_QSPAN is not set
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-# CONFIG_PCCARD is not set
-
-#
-# Advanced setup
-#
-# CONFIG_ADVANCED_OPTIONS is not set
-
-#
-# Default settings for advanced configuration options are used
-#
-CONFIG_HIGHMEM_START=0xfe000000
-CONFIG_LOWMEM_SIZE=0x30000000
-CONFIG_KERNEL_START=0xc0000000
-CONFIG_TASK_SIZE=0x80000000
-CONFIG_CONSISTENT_START=0xfd000000
-CONFIG_CONSISTENT_SIZE=0x00200000
-CONFIG_BOOT_LOAD=0x00400000
-
-#
-# Networking
-#
-CONFIG_NET=y
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
-# CONFIG_PACKET_MMAP is not set
-CONFIG_UNIX=y
-# CONFIG_NET_KEY is not set
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-CONFIG_IP_FIB_HASH=y
-CONFIG_IP_PNP=y
-# CONFIG_IP_PNP_DHCP is not set
-# CONFIG_IP_PNP_BOOTP is not set
-# CONFIG_IP_PNP_RARP is not set
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE is not set
-# CONFIG_IP_MROUTE is not set
-# CONFIG_ARPD is not set
-CONFIG_SYN_COOKIES=y
-# CONFIG_INET_AH is not set
-# CONFIG_INET_ESP is not set
-# CONFIG_INET_IPCOMP is not set
-# CONFIG_INET_XFRM_TUNNEL is not set
-# CONFIG_INET_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_BEET is not set
-# CONFIG_INET_LRO is not set
-CONFIG_INET_DIAG=y
-CONFIG_INET_TCP_DIAG=y
-# CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
-# CONFIG_TCP_MD5SIG is not set
-# CONFIG_IPV6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
-# CONFIG_NETWORK_SECMARK is not set
-# CONFIG_NETFILTER is not set
-# CONFIG_IP_DCCP is not set
-# CONFIG_IP_SCTP is not set
-# CONFIG_TIPC is not set
-# CONFIG_ATM is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_VLAN_8021Q is not set
-# CONFIG_DECNET is not set
-# CONFIG_LLC2 is not set
-# CONFIG_IPX is not set
-# CONFIG_ATALK is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_SCHED is not set
-
-#
-# Network testing
-#
-# CONFIG_NET_PKTGEN is not set
-# CONFIG_HAMRADIO is not set
-# CONFIG_IRDA is not set
-# CONFIG_BT is not set
-# CONFIG_AF_RXRPC is not set
-
-#
-# Wireless
-#
-# CONFIG_CFG80211 is not set
-# CONFIG_WIRELESS_EXT is not set
-# CONFIG_MAC80211 is not set
-# CONFIG_IEEE80211 is not set
-# CONFIG_RFKILL is not set
-# CONFIG_NET_9P is not set
-
-#
-# Device Drivers
-#
-
-#
-# Generic Driver Options
-#
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_STANDALONE=y
-CONFIG_PREVENT_FIRMWARE_BUILD=y
-# CONFIG_FW_LOADER is not set
-# CONFIG_DEBUG_DRIVER is not set
-# CONFIG_DEBUG_DEVRES is not set
-# CONFIG_SYS_HYPERVISOR is not set
-# CONFIG_CONNECTOR is not set
-CONFIG_MTD=y
-# CONFIG_MTD_DEBUG is not set
-# CONFIG_MTD_CONCAT is not set
-# CONFIG_MTD_PARTITIONS is not set
-
-#
-# User Modules And Translation Layers
-#
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-# CONFIG_INFTL is not set
-# CONFIG_RFD_FTL is not set
-# CONFIG_SSFDC is not set
-# CONFIG_MTD_OOPS is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_GEN_PROBE=y
-# CONFIG_MTD_CFI_ADV_OPTIONS is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-# CONFIG_MTD_CFI_INTELEXT is not set
-CONFIG_MTD_CFI_AMDSTD=y
-# CONFIG_MTD_CFI_STAA is not set
-CONFIG_MTD_CFI_UTIL=y
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ABSENT is not set
-
-#
-# Mapping drivers for chip access
-#
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-# CONFIG_MTD_PHYSMAP is not set
-CONFIG_MTD_PHYSMAP_OF=y
-# CONFIG_MTD_CFI_FLAGADM is not set
-# CONFIG_MTD_PLATRAM is not set
-
-#
-# Self-contained MTD device drivers
-#
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLOCK2MTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-# CONFIG_MTD_NAND is not set
-# CONFIG_MTD_ONENAND is not set
-
-#
-# UBI - Unsorted block images
-#
-# CONFIG_MTD_UBI is not set
-CONFIG_OF_DEVICE=y
-# CONFIG_PARPORT is not set
-# CONFIG_BLK_DEV is not set
-# CONFIG_MISC_DEVICES is not set
-# CONFIG_IDE is not set
-
-#
-# SCSI device support
-#
-# CONFIG_RAID_ATTRS is not set
-# CONFIG_SCSI is not set
-# CONFIG_SCSI_DMA is not set
-# CONFIG_SCSI_NETLINK is not set
-# CONFIG_ATA is not set
-# CONFIG_MD is not set
-# CONFIG_MACINTOSH_DRIVERS is not set
-CONFIG_NETDEVICES=y
-# CONFIG_NETDEVICES_MULTIQUEUE is not set
-# CONFIG_DUMMY is not set
-# CONFIG_BONDING is not set
-# CONFIG_MACVLAN is not set
-# CONFIG_EQUALIZER is not set
-# CONFIG_TUN is not set
-# CONFIG_VETH is not set
-CONFIG_PHYLIB=y
-
-#
-# MII PHY device drivers
-#
-# CONFIG_MARVELL_PHY is not set
-CONFIG_DAVICOM_PHY=y
-# CONFIG_QSEMI_PHY is not set
-# CONFIG_LXT_PHY is not set
-# CONFIG_CICADA_PHY is not set
-# CONFIG_VITESSE_PHY is not set
-# CONFIG_SMSC_PHY is not set
-# CONFIG_BROADCOM_PHY is not set
-# CONFIG_ICPLUS_PHY is not set
-# CONFIG_FIXED_PHY is not set
-# CONFIG_MDIO_BITBANG is not set
-CONFIG_NET_ETHERNET=y
-CONFIG_MII=y
-# CONFIG_IBM_NEW_EMAC_ZMII is not set
-# CONFIG_IBM_NEW_EMAC_RGMII is not set
-# CONFIG_IBM_NEW_EMAC_TAH is not set
-# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
-# CONFIG_B44 is not set
-CONFIG_FS_ENET=y
-# CONFIG_FS_ENET_HAS_SCC is not set
-CONFIG_FS_ENET_HAS_FEC=y
-CONFIG_FS_ENET_MDIO_FEC=y
-# CONFIG_NETDEV_1000 is not set
-# CONFIG_NETDEV_10000 is not set
-
-#
-# Wireless LAN
-#
-# CONFIG_WLAN_PRE80211 is not set
-# CONFIG_WLAN_80211 is not set
-# CONFIG_WAN is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-# CONFIG_ISDN is not set
-# CONFIG_PHONE is not set
-
-#
-# Input device support
-#
-CONFIG_INPUT=y
-# CONFIG_INPUT_FF_MEMLESS is not set
-# CONFIG_INPUT_POLLDEV is not set
-
-#
-# Userland interfaces
-#
-CONFIG_INPUT_MOUSEDEV=y
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_EVDEV is not set
-# CONFIG_INPUT_EVBUG is not set
-
-#
-# Input Device Drivers
-#
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_KEYBOARD_ATKBD=y
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-# CONFIG_KEYBOARD_STOWAWAY is not set
-CONFIG_INPUT_MOUSE=y
-CONFIG_MOUSE_PS2=y
-CONFIG_MOUSE_PS2_ALPS=y
-CONFIG_MOUSE_PS2_LOGIPS2PP=y
-CONFIG_MOUSE_PS2_SYNAPTICS=y
-CONFIG_MOUSE_PS2_LIFEBOOK=y
-CONFIG_MOUSE_PS2_TRACKPOINT=y
-# CONFIG_MOUSE_PS2_TOUCHKIT is not set
-# CONFIG_MOUSE_SERIAL is not set
-# CONFIG_MOUSE_VSXXXAA is not set
-# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TABLET is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
-# CONFIG_INPUT_MISC is not set
-
-#
-# Hardware I/O ports
-#
-CONFIG_SERIO=y
-CONFIG_SERIO_I8042=y
-CONFIG_SERIO_SERPORT=y
-CONFIG_SERIO_LIBPS2=y
-# CONFIG_SERIO_RAW is not set
-# CONFIG_GAMEPORT is not set
-
-#
-# Character devices
-#
-# CONFIG_VT is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-
-#
-# Serial drivers
-#
-# CONFIG_SERIAL_8250 is not set
-
-#
-# Non-8250 serial port support
-#
-# CONFIG_SERIAL_UARTLITE is not set
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_SERIAL_CPM=y
-CONFIG_SERIAL_CPM_CONSOLE=y
-# CONFIG_SERIAL_CPM_SCC1 is not set
-# CONFIG_SERIAL_CPM_SCC2 is not set
-# CONFIG_SERIAL_CPM_SCC3 is not set
-# CONFIG_SERIAL_CPM_SCC4 is not set
-CONFIG_SERIAL_CPM_SMC1=y
-CONFIG_SERIAL_CPM_SMC2=y
-CONFIG_UNIX98_PTYS=y
-# CONFIG_LEGACY_PTYS is not set
-# CONFIG_IPMI_HANDLER is not set
-CONFIG_HW_RANDOM=y
-# CONFIG_NVRAM is not set
-CONFIG_GEN_RTC=y
-# CONFIG_GEN_RTC_X is not set
-# CONFIG_R3964 is not set
-# CONFIG_RAW_DRIVER is not set
-# CONFIG_TCG_TPM is not set
-# CONFIG_I2C is not set
-
-#
-# SPI support
-#
-# CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
-# CONFIG_W1 is not set
-# CONFIG_POWER_SUPPLY is not set
-# CONFIG_HWMON is not set
-# CONFIG_WATCHDOG is not set
-
-#
-# Sonics Silicon Backplane
-#
-CONFIG_SSB_POSSIBLE=y
-# CONFIG_SSB is not set
-
-#
-# Multifunction device drivers
-#
-# CONFIG_MFD_SM501 is not set
-
-#
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-# CONFIG_DVB_CORE is not set
-CONFIG_DAB=y
-
-#
-# Graphics support
-#
-# CONFIG_VGASTATE is not set
-CONFIG_VIDEO_OUTPUT_CONTROL=y
-# CONFIG_FB is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Display device support
-#
-# CONFIG_DISPLAY_SUPPORT is not set
-
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-# CONFIG_HID_SUPPORT is not set
-# CONFIG_USB_SUPPORT is not set
-# CONFIG_MMC is not set
-# CONFIG_NEW_LEDS is not set
-# CONFIG_EDAC is not set
-# CONFIG_RTC_CLASS is not set
-
-#
-# Userspace I/O
-#
-# CONFIG_UIO is not set
-
-#
-# File systems
-#
-# CONFIG_EXT2_FS is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_EXT4DEV_FS is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_FS_POSIX_ACL is not set
-# CONFIG_XFS_FS is not set
-# CONFIG_GFS2_FS is not set
-# CONFIG_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_INOTIFY is not set
-# CONFIG_QUOTA is not set
-# CONFIG_DNOTIFY is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_FUSE_FS is not set
-
-#
-# CD-ROM/DVD Filesystems
-#
-# CONFIG_ISO9660_FS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-# CONFIG_MSDOS_FS is not set
-# CONFIG_VFAT_FS is not set
-# CONFIG_NTFS_FS is not set
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-# CONFIG_PROC_KCORE is not set
-CONFIG_PROC_SYSCTL=y
-CONFIG_SYSFS=y
-CONFIG_TMPFS=y
-# CONFIG_TMPFS_POSIX_ACL is not set
-# CONFIG_HUGETLB_PAGE is not set
-# CONFIG_CONFIGFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_HFSPLUS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_JFFS2_FS is not set
-CONFIG_CRAMFS=y
-# CONFIG_VXFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-CONFIG_NETWORK_FILESYSTEMS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-# CONFIG_NFS_V3_ACL is not set
-# CONFIG_NFS_V4 is not set
-# CONFIG_NFS_DIRECTIO is not set
-# CONFIG_NFSD is not set
-CONFIG_ROOT_NFS=y
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-CONFIG_NFS_COMMON=y
-CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_BIND34 is not set
-# CONFIG_RPCSEC_GSS_KRB5 is not set
-# CONFIG_RPCSEC_GSS_SPKM3 is not set
-# CONFIG_SMB_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_AFS_FS is not set
-
-#
-# Partition Types
-#
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ACORN_PARTITION is not set
-# CONFIG_OSF_PARTITION is not set
-# CONFIG_AMIGA_PARTITION is not set
-# CONFIG_ATARI_PARTITION is not set
-# CONFIG_MAC_PARTITION is not set
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_BSD_DISKLABEL is not set
-# CONFIG_MINIX_SUBPARTITION is not set
-# CONFIG_SOLARIS_X86_PARTITION is not set
-# CONFIG_UNIXWARE_DISKLABEL is not set
-# CONFIG_LDM_PARTITION is not set
-# CONFIG_SGI_PARTITION is not set
-# CONFIG_ULTRIX_PARTITION is not set
-# CONFIG_SUN_PARTITION is not set
-# CONFIG_KARMA_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
-# CONFIG_SYSV68_PARTITION is not set
-# CONFIG_NLS is not set
-# CONFIG_DLM is not set
-# CONFIG_UCC_SLOW is not set
-
-#
-# Library routines
-#
-# CONFIG_CRC_CCITT is not set
-# CONFIG_CRC16 is not set
-# CONFIG_CRC_ITU_T is not set
-# CONFIG_CRC32 is not set
-# CONFIG_CRC7 is not set
-# CONFIG_LIBCRC32C is not set
-CONFIG_ZLIB_INFLATE=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAS_DMA=y
-CONFIG_INSTRUMENTATION=y
-# CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
-
-#
-# Kernel hacking
-#
-# CONFIG_PRINTK_TIME is not set
-CONFIG_ENABLE_WARN_DEPRECATED=y
-CONFIG_ENABLE_MUST_CHECK=y
-CONFIG_MAGIC_SYSRQ=y
-# CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_FS is not set
-# CONFIG_HEADERS_CHECK is not set
-CONFIG_DEBUG_KERNEL=y
-# CONFIG_DEBUG_SHIRQ is not set
-CONFIG_DETECT_SOFTLOCKUP=y
-CONFIG_SCHED_DEBUG=y
-# CONFIG_SCHEDSTATS is not set
-# CONFIG_TIMER_STATS is not set
-# CONFIG_SLUB_DEBUG_ON is not set
-# CONFIG_DEBUG_SPINLOCK is not set
-# CONFIG_DEBUG_MUTEXES is not set
-# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
-# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
-# CONFIG_DEBUG_KOBJECT is not set
-CONFIG_DEBUG_BUGVERBOSE=y
-CONFIG_DEBUG_INFO=y
-# CONFIG_DEBUG_VM is not set
-# CONFIG_DEBUG_LIST is not set
-# CONFIG_DEBUG_SG is not set
-CONFIG_FORCED_INLINING=y
-# CONFIG_BOOT_PRINTK_DELAY is not set
-# CONFIG_FAULT_INJECTION is not set
-# CONFIG_SAMPLES is not set
-# CONFIG_DEBUG_STACKOVERFLOW is not set
-# CONFIG_DEBUG_STACK_USAGE is not set
-# CONFIG_DEBUG_PAGEALLOC is not set
-# CONFIG_DEBUGGER is not set
-# CONFIG_BDI_SWITCH is not set
-# CONFIG_PPC_EARLY_DEBUG is not set
-
-#
-# Security options
-#
-# CONFIG_KEYS is not set
-# CONFIG_SECURITY is not set
-# CONFIG_SECURITY_FILE_CAPABILITIES is not set
-# CONFIG_CRYPTO is not set
-# CONFIG_PPC_CLOCK is not set
-CONFIG_PPC_LIB_RHEAP=y
similarity index 95%
rename from arch/powerpc/configs/adder875-redboot_defconfig
rename to arch/powerpc/configs/adder875_defconfig
index cab5f9b64567c654c89250a2b2b38bb47737e4d3..a3cc94a2ff06a40104d6ddaea804b13aeb8c6a4f 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24-rc6
-# Thu Jan 17 16:17:38 2008
+# Linux kernel version: 2.6.25-rc2
+# Wed Feb 20 12:26:07 2008
 #
 # CONFIG_PPC64 is not set
 
@@ -26,6 +26,7 @@ CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_HARDIRQS=y
+# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
 CONFIG_IRQ_PER_CPU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_ARCH_HAS_ILOG2_U32=y
@@ -64,17 +65,18 @@ CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
-# CONFIG_PID_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
+CONFIG_GROUP_SCHED=y
 CONFIG_FAIR_GROUP_SCHED=y
-CONFIG_FAIR_USER_SCHED=y
-# CONFIG_FAIR_CGROUP_SCHED is not set
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
 # CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
@@ -87,11 +89,13 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 # CONFIG_ELF_CORE is not set
+CONFIG_COMPAT_BRK=y
 # CONFIG_BASE_FULL is not set
 # CONFIG_FUTEX is not set
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 # CONFIG_VM_EVENT_COUNTERS is not set
@@ -99,6 +103,12 @@ CONFIG_SLUB_DEBUG=y
 # CONFIG_SLAB is not set
 CONFIG_SLUB=y
 # CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=1
 # CONFIG_MODULES is not set
@@ -120,12 +130,14 @@ CONFIG_DEFAULT_DEADLINE=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="deadline"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_RCU is not set
 
 #
 # Platform support
 #
-# CONFIG_PPC_MPC52xx is not set
-# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_MPC512x is not set
+# CONFIG_PPC_MPC5121 is not set
 # CONFIG_PPC_CELL is not set
 # CONFIG_PPC_CELL_NATIVE is not set
 CONFIG_CPM1=y
@@ -150,6 +162,7 @@ CONFIG_NO_UCODE_PATCH=y
 # CONFIG_I2C_SPI_UCODE_PATCH is not set
 # CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
 # CONFIG_PQ2ADS is not set
+# CONFIG_IPIC is not set
 # CONFIG_MPIC is not set
 # CONFIG_MPIC_WEIRD is not set
 # CONFIG_PPC_I8259 is not set
@@ -160,7 +173,6 @@ CONFIG_NO_UCODE_PATCH=y
 # CONFIG_PPC_INDIRECT_IO is not set
 # CONFIG_GENERIC_IOMAP is not set
 # CONFIG_CPU_FREQ is not set
-# CONFIG_CPM2 is not set
 CONFIG_PPC_CPM_NEW_BINDING=y
 # CONFIG_FSL_ULI1575 is not set
 CONFIG_CPM=y
@@ -178,14 +190,19 @@ CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 # CONFIG_HZ_300 is not set
 CONFIG_HZ_1000=y
 CONFIG_HZ=1000
+# CONFIG_SCHED_HRTICK is not set
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
+CONFIG_RCU_TRACE=y
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 # CONFIG_MATH_EMULATION is not set
 # CONFIG_8XX_MINIMAL_FPEMU is not set
+# CONFIG_IOMMU_HELPER is not set
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_HAS_WALK_MEMORY=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
@@ -204,11 +221,7 @@ CONFIG_VIRT_TO_BUS=y
 # CONFIG_PROC_DEVICETREE is not set
 # CONFIG_CMDLINE_BOOL is not set
 # CONFIG_PM is not set
-CONFIG_SUSPEND_UP_POSSIBLE=y
-CONFIG_HIBERNATION_UP_POSSIBLE=y
 # CONFIG_SECCOMP is not set
-CONFIG_WANT_DEVICE_TREE=y
-CONFIG_DEVICE_TREE="adder875-redboot.dts"
 CONFIG_ISA_DMA_API=y
 
 #
@@ -305,6 +318,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
@@ -411,6 +425,7 @@ CONFIG_OF_DEVICE=y
 # CONFIG_PARPORT is not set
 # CONFIG_BLK_DEV is not set
 # CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -445,6 +460,7 @@ CONFIG_DAVICOM_PHY=y
 # CONFIG_SMSC_PHY is not set
 # CONFIG_BROADCOM_PHY is not set
 # CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
 # CONFIG_FIXED_PHY is not set
 # CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
@@ -469,7 +485,6 @@ CONFIG_FS_ENET_MDIO_FEC=y
 # CONFIG_WAN is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -574,6 +589,7 @@ CONFIG_GEN_RTC=y
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
+CONFIG_THERMAL=y
 # CONFIG_WATCHDOG is not set
 
 #
@@ -614,6 +630,7 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
 # CONFIG_HID_SUPPORT is not set
 # CONFIG_USB_SUPPORT is not set
 # CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
 # CONFIG_EDAC is not set
 # CONFIG_RTC_CLASS is not set
@@ -635,11 +652,9 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
 # CONFIG_XFS_FS is not set
 # CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
+# CONFIG_DNOTIFY is not set
 # CONFIG_INOTIFY is not set
 # CONFIG_QUOTA is not set
-# CONFIG_DNOTIFY is not set
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -682,8 +697,10 @@ CONFIG_TMPFS=y
 # CONFIG_JFFS2_FS is not set
 CONFIG_CRAMFS=y
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
 CONFIG_NETWORK_FILESYSTEMS=y
@@ -730,7 +747,6 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SYSV68_PARTITION is not set
 # CONFIG_NLS is not set
 # CONFIG_DLM is not set
-# CONFIG_UCC_SLOW is not set
 
 #
 # Library routines
@@ -745,9 +761,6 @@ CONFIG_ZLIB_INFLATE=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
-CONFIG_INSTRUMENTATION=y
-# CONFIG_PROFILING is not set
-# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
@@ -757,7 +770,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_FS is not set
+CONFIG_DEBUG_FS=y
 # CONFIG_HEADERS_CHECK is not set
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SHIRQ is not set
@@ -766,6 +779,7 @@ CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
 # CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_MUTEXES is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
@@ -776,14 +790,15 @@ CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
-CONFIG_FORCED_INLINING=y
 # CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_SAMPLES is not set
 # CONFIG_DEBUG_STACKOVERFLOW is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_DEBUG_PAGEALLOC is not set
 # CONFIG_DEBUGGER is not set
+# CONFIG_VIRQ_DEBUG is not set
 # CONFIG_BDI_SWITCH is not set
 # CONFIG_PPC_EARLY_DEBUG is not set
 
index f7458396cd7c022968abb231d1fdf62cb5ec2c67..3c9452d4308b8d245f1c85816b62d971948c6d44 100644 (file)
@@ -332,8 +332,18 @@ InstructionTLBMiss:
        mfspr   r11, SPRN_MD_TWC        /* ....and get the pte address */
        lwz     r10, 0(r11)     /* Get the pte */
 
+#ifdef CONFIG_SWAP
+       /* do not set the _PAGE_ACCESSED bit of a non-present page */
+       andi.   r11, r10, _PAGE_PRESENT
+       beq     4f
+       ori     r10, r10, _PAGE_ACCESSED
+       mfspr   r11, SPRN_MD_TWC        /* get the pte address again */
+       stw     r10, 0(r11)
+4:
+#else
        ori     r10, r10, _PAGE_ACCESSED
        stw     r10, 0(r11)
+#endif
 
        /* The Linux PTE won't go exactly into the MMU TLB.
         * Software indicator bits 21, 22 and 28 must be clear.
@@ -398,8 +408,17 @@ DataStoreTLBMiss:
        DO_8xx_CPU6(0x3b80, r3)
        mtspr   SPRN_MD_TWC, r11
 
-       mfspr   r11, SPRN_MD_TWC        /* get the pte address again */
+#ifdef CONFIG_SWAP
+       /* do not set the _PAGE_ACCESSED bit of a non-present page */
+       andi.   r11, r10, _PAGE_PRESENT
+       beq     4f
        ori     r10, r10, _PAGE_ACCESSED
+4:
+       /* and update pte in table */
+#else
+       ori     r10, r10, _PAGE_ACCESSED
+#endif
+       mfspr   r11, SPRN_MD_TWC        /* get the pte address again */
        stw     r10, 0(r11)
 
        /* The Linux PTE won't go exactly into the MMU TLB.
@@ -507,7 +526,16 @@ DataTLBError:
 
        /* Update 'changed', among others.
        */
+#ifdef CONFIG_SWAP
+       ori     r10, r10, _PAGE_DIRTY|_PAGE_HWWRITE
+       /* do not set the _PAGE_ACCESSED bit of a non-present page */
+       andi.   r11, r10, _PAGE_PRESENT
+       beq     4f
+       ori     r10, r10, _PAGE_ACCESSED
+4:
+#else
        ori     r10, r10, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE
+#endif
        mfspr   r11, SPRN_MD_TWC                /* Get pte address again */
        stw     r10, 0(r11)             /* and update pte in table */
 
index 8a9c26973605d918259acd874e7d5c627eb631fe..64d17b0d64555cbd4a29271b7f7122abed2caba0 100644 (file)
@@ -39,12 +39,9 @@ static int mpc837xmds_usb_cfg(void)
        if (ret)
                return ret;
        /* Map BCSR area */
-       np = of_find_node_by_name(NULL, "bcsr");
+       np = of_find_compatible_node(NULL, NULL, "fsl,mpc837xmds-bcsr");
        if (np) {
-               struct resource res;
-
-               of_address_to_resource(np, 0, &res);
-               bcsr_regs = ioremap(res.start, res.end - res.start + 1);
+               bcsr_regs = of_iomap(np, 0);
                of_node_put(np);
        }
        if (!bcsr_regs)
@@ -96,6 +93,7 @@ static void __init mpc837x_mds_setup_arch(void)
 static struct of_device_id mpc837x_ids[] = {
        { .type = "soc", },
        { .compatible = "soc", },
+       { .compatible = "simple-bus", },
        {},
 };
 
index 0afd22595546fc68d981972e15e0815eda7da09d..a578b966ecbc1da6452ff0160f07e5e0349d80eb 100644 (file)
@@ -22,7 +22,6 @@ config PPC_83xx
        select FSL_SOC
        select MPC83xx
        select IPIC
-       select FSL_EMB_PERFMON
 
 config PPC_86xx
        bool "Freescale 86xx"
index 73d81ce14b6763c185397d998c1208c4a073d0ab..0c3face0ddbb4d78010e1efcbd12569e8343e25c 100644 (file)
@@ -113,7 +113,12 @@ config FSL_BOOKE
        default y
 
 config FSL_EMB_PERFMON
-       bool
+       bool "Freescale Embedded Perfmon"
+       depends on E500 || PPC_83xx
+       help
+         This is the Performance Monitor support found on the e500 core
+         and some e300 cores (c3 and c4).  Select this only if your
+         core supports the Embedded Performance Monitor APU
 
 config PTE_64BIT
        bool
index 6efbd5e5bb1b6f1b8119ed8ccf7e8ed35591a015..cc81fd1141b031ffe476a12f033a7c925aff8f79 100644 (file)
@@ -509,7 +509,7 @@ int qe_upload_firmware(const struct qe_firmware *firmware)
        }
 
        /* Validate some of the fields */
-       if ((firmware->count < 1) || (firmware->count >= MAX_QE_RISC)) {
+       if ((firmware->count < 1) || (firmware->count > MAX_QE_RISC)) {
                printk(KERN_ERR "qe-firmware: invalid data\n");
                return -EINVAL;
        }
@@ -609,7 +609,10 @@ struct qe_firmware_info *qe_get_firmware_info(void)
         * If we haven't checked yet, and a driver hasn't uploaded a firmware
         * yet, then check the device tree for information.
         */
-       if (initialized || qe_firmware_uploaded)
+       if (qe_firmware_uploaded)
+               return &qe_firmware_info;
+
+       if (initialized)
                return NULL;
 
        initialized = 1;
index eb8d26f8736239ace4aaac1163a81150e9003e78..321bda2de2cb8a40ab0600bb75da4676556edda3 100644 (file)
@@ -329,8 +329,18 @@ InstructionTLBMiss:
        mfspr   r11, SPRN_MD_TWC        /* ....and get the pte address */
        lwz     r10, 0(r11)     /* Get the pte */
 
+#ifdef CONFIG_SWAP
+       /* do not set the _PAGE_ACCESSED bit of a non-present page */
+       andi.   r11, r10, _PAGE_PRESENT
+       beq     4f
+       ori     r10, r10, _PAGE_ACCESSED
+       mfspr   r11, SPRN_MD_TWC        /* get the pte address again */
+       stw     r10, 0(r11)
+4:
+#else
        ori     r10, r10, _PAGE_ACCESSED
        stw     r10, 0(r11)
+#endif
 
        /* The Linux PTE won't go exactly into the MMU TLB.
         * Software indicator bits 21, 22 and 28 must be clear.
@@ -395,8 +405,17 @@ DataStoreTLBMiss:
        DO_8xx_CPU6(0x3b80, r3)
        mtspr   SPRN_MD_TWC, r11
 
-       mfspr   r11, SPRN_MD_TWC        /* get the pte address again */
+#ifdef CONFIG_SWAP
+       /* do not set the _PAGE_ACCESSED bit of a non-present page */
+       andi.   r11, r10, _PAGE_PRESENT
+       beq     4f
+       ori     r10, r10, _PAGE_ACCESSED
+4:
+       /* and update pte in table */
+#else
        ori     r10, r10, _PAGE_ACCESSED
+#endif
+       mfspr   r11, SPRN_MD_TWC        /* get the pte address again */
        stw     r10, 0(r11)
 
        /* The Linux PTE won't go exactly into the MMU TLB.
@@ -575,7 +594,16 @@ DataTLBError:
 
        /* Update 'changed', among others.
        */
+#ifdef CONFIG_SWAP
+       ori     r10, r10, _PAGE_DIRTY|_PAGE_HWWRITE
+       /* do not set the _PAGE_ACCESSED bit of a non-present page */
+       andi.   r11, r10, _PAGE_PRESENT
+       beq     4f
+       ori     r10, r10, _PAGE_ACCESSED
+4:
+#else
        ori     r10, r10, _PAGE_DIRTY|_PAGE_ACCESSED|_PAGE_HWWRITE
+#endif
        mfspr   r11, SPRN_MD_TWC                /* Get pte address again */
        stw     r10, 0(r11)             /* and update pte in table */
 
index b21444b681b667b526ddbebcca337e24d6b48581..1831833c430edc8d17015c739e9262b46bc88e77 100644 (file)
@@ -61,6 +61,7 @@ config S390
        def_bool y
        select HAVE_OPROFILE
        select HAVE_KPROBES
+       select HAVE_KRETPROBES
 
 source "init/Kconfig"
 
@@ -350,6 +351,10 @@ endchoice
 
 source "fs/Kconfig.binfmt"
 
+config FORCE_MAX_ZONEORDER
+       int
+       default "9"
+
 config PROCESS_DEBUG
        bool "Show crashed user process info"
        help
index 39921f3a9685a74247c9c2b8fbee8ad48bf1142c..62f6b5a606ddf3a8afbd63983822c0f14e45d483 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24
-# Sat Feb  9 12:13:01 2008
+# Linux kernel version: 2.6.25-rc4
+# Wed Mar  5 11:22:59 2008
 #
 CONFIG_MMU=y
 CONFIG_ZONE_DMA=y
@@ -43,12 +43,15 @@ CONFIG_CGROUPS=y
 # CONFIG_CGROUP_DEBUG is not set
 CONFIG_CGROUP_NS=y
 # CONFIG_CPUSETS is not set
+CONFIG_GROUP_SCHED=y
 CONFIG_FAIR_GROUP_SCHED=y
-CONFIG_FAIR_USER_SCHED=y
-# CONFIG_FAIR_CGROUP_SCHED is not set
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
 # CONFIG_CGROUP_CPUACCT is not set
 # CONFIG_RESOURCE_COUNTERS is not set
 CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
 CONFIG_NAMESPACES=y
 CONFIG_UTS_NS=y
@@ -85,7 +88,9 @@ CONFIG_SLAB=y
 # CONFIG_MARKERS is not set
 CONFIG_HAVE_OPROFILE=y
 CONFIG_KPROBES=y
+CONFIG_KRETPROBES=y
 CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -185,6 +190,7 @@ CONFIG_IPL=y
 CONFIG_IPL_VM=y
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
+CONFIG_FORCE_MAX_ZONEORDER=9
 # CONFIG_PROCESS_DEBUG is not set
 CONFIG_PFAULT=y
 # CONFIG_SHARED_KERNEL is not set
@@ -435,6 +441,7 @@ CONFIG_DASD_EER=y
 CONFIG_MISC_DEVICES=y
 # CONFIG_EEPROM_93CX6 is not set
 # CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_HAVE_IDE is not set
 
 #
 # SCSI device support
@@ -593,6 +600,7 @@ CONFIG_S390_VMUR=m
 #
 # Sonics Silicon Backplane
 #
+# CONFIG_MEMSTICK is not set
 
 #
 # File systems
@@ -750,7 +758,6 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
 # CONFIG_FRAME_POINTER is not set
-CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_KPROBES_SANITY_TEST is not set
 # CONFIG_BACKTRACE_SELF_TEST is not set
@@ -759,6 +766,7 @@ CONFIG_FORCED_INLINING=y
 # CONFIG_LATENCYTOP is not set
 CONFIG_SAMPLES=y
 # CONFIG_SAMPLE_KOBJECT is not set
+# CONFIG_SAMPLE_KPROBES is not set
 # CONFIG_DEBUG_PAGEALLOC is not set
 
 #
index b3b650a93c7c752f6d95c5b789beef5cfbd99589..4d3e38392cb1486dd11db7868098ec30c22808b4 100644 (file)
@@ -4,6 +4,11 @@
 
 EXTRA_AFLAGS   := -traditional
 
+#
+# Passing null pointers is ok for smp code, since we access the lowcore here.
+#
+CFLAGS_smp.o   := -Wno-nonnull
+
 obj-y  :=  bitmap.o traps.o time.o process.o base.o early.o \
             setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
            semaphore.o s390_ext.o debug.o irq.o ipl.o dis.o diag.o
index 9f7b73b180f00a064ce36457b9ba88e0ecb38c79..01832c44063629ebf66afc77bb01fc2d838197bc 100644 (file)
@@ -88,13 +88,17 @@ static noinline __init void create_kernel_nss(void)
 
        __cpcmd(defsys_cmd, NULL, 0, &response);
 
-       if (response != 0)
+       if (response != 0) {
+               kernel_nss_name[0] = '\0';
                return;
+       }
 
        __cpcmd(savesys_cmd, NULL, 0, &response);
 
-       if (response != strlen(savesys_cmd))
+       if (response != strlen(savesys_cmd)) {
+               kernel_nss_name[0] = '\0';
                return;
+       }
 
        ipl_flags = IPL_NSS_VALID;
 }
index 60acdc266db177fab528d5cedea72829a1cbe939..375232c46c7a51178f1e51c7a83043026c8c68d1 100644 (file)
@@ -704,6 +704,7 @@ void reipl_run(struct shutdown_trigger *trigger)
        default:
                break;
        }
+       disabled_wait((unsigned long) __builtin_return_address(0));
 }
 
 static void __init reipl_probe(void)
index 1c59ec161cf8772e5ac260aa0cce812c4db84ba8..ce203154d8ce3a6c8f9bf4a07cd7ad072e3b3ec8 100644 (file)
@@ -152,6 +152,10 @@ static void default_idle(void)
        local_mcck_disable();
        if (test_thread_flag(TIF_MCCK_PENDING)) {
                local_mcck_enable();
+               /* disable monitor call class 0 */
+               __ctl_clear_bit(8, 15);
+               atomic_notifier_call_chain(&idle_chain, S390_CPU_NOT_IDLE,
+                                          hcpu);
                local_irq_enable();
                s390_handle_mcck();
                return;
index 818bd09c0260e05fb3a58eb2764f88e8f055a585..8f894d380a626316c68aeb073043f027abdcfee6 100644 (file)
@@ -629,14 +629,8 @@ static int __cpuinit smp_alloc_lowcore(int cpu)
        panic_stack = __get_free_page(GFP_KERNEL);
        if (!panic_stack || !async_stack)
                goto out;
-       /*
-        * Only need to copy the first 512 bytes from address 0. But since
-        * the compiler emits a warning if src == NULL for memcpy use copy_page
-        * instead. Copies more than needed but this code is not performance
-        * critical.
-        */
-       copy_page(lowcore, &S390_lowcore);
-       memset((void *)lowcore + 512, 0, sizeof(*lowcore) - 512);
+       memcpy(lowcore, &S390_lowcore, 512);
+       memset((char *)lowcore + 512, 0, sizeof(*lowcore) - 512);
        lowcore->async_stack = async_stack + ASYNC_SIZE;
        lowcore->panic_stack = panic_stack + PAGE_SIZE;
 
index 76a5dd1b4ce9a1376f85c7d1e8711aa423a6f85a..cb232c155360627866c4e9f7decda622f4048b50 100644 (file)
@@ -209,8 +209,6 @@ static void stop_hz_timer(void)
  */
 static void start_hz_timer(void)
 {
-       BUG_ON(!in_interrupt());
-
        if (!cpu_isset(smp_processor_id(), nohz_cpu_mask))
                return;
        account_ticks(get_clock());
index 783cfbbf87cad992ae388047dbdd8f60c43ebbca..95b7534e9e3ccb53a6ea55addf0e2d60a5cbe45f 100644 (file)
@@ -456,13 +456,6 @@ config SH_SECUREEDGE5410
          This includes both the OEM SecureEdge products as well as the
          SME product line.
 
-config SH_7710VOIPGW
-       bool "SH7710-VOIP-GW"
-       depends on CPU_SUBTYPE_SH7710
-       help
-         Select this option to build a kernel for the SH7710 based
-         VOIP GW.
-
 config SH_RTS7751R2D
        bool "RTS7751R2D"
        depends on CPU_SUBTYPE_SH7751R
index 81381e5773c85b841e42a8fb0e7dd41d37579484..c510c225144fc57a9222af156f98fe8384073cb3 100644 (file)
@@ -118,7 +118,6 @@ machdir-$(CONFIG_SH_EDOSK7705)                      += renesas/edosk7705
 machdir-$(CONFIG_SH_HIGHLANDER)                        += renesas/r7780rp
 machdir-$(CONFIG_SH_MIGOR)                     += renesas/migor
 machdir-$(CONFIG_SH_SDK7780)                   += renesas/sdk7780
-machdir-$(CONFIG_SH_7710VOIPGW)                        += renesas/sh7710voipgw
 machdir-$(CONFIG_SH_X3PROTO)                   += renesas/x3proto
 machdir-$(CONFIG_SH_SH4202_MICRODEV)           += superh/microdev
 machdir-$(CONFIG_SH_LANDISK)                   += landisk
index 640ca2a74f163c07ef42ac570e11cb254da76e0f..177f4f028e0dd5769d6d530290b6b6fec9097318 100644 (file)
@@ -2,6 +2,7 @@
  * bios-less APM driver for hp680
  *
  * Copyright 2005 (c) Andriy Skulysh <askulysh@gmail.com>
+ * Copyright 2008 (c) Kristoffer Ericson <kristoffer.ericson@gmail.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License.
 #include <asm/adc.h>
 #include <asm/hp6xx.h>
 
-#define SH7709_PGDR                    0xa400012c
-
+/* percentage values */
 #define APM_CRITICAL                   10
 #define APM_LOW                                30
 
+/* resonably sane values */
 #define HP680_BATTERY_MAX              898
 #define HP680_BATTERY_MIN              486
 #define HP680_BATTERY_AC_ON            1023
 
 #define MODNAME "hp6x0_apm"
 
+#define PGDR   0xa400012c
+
 static void hp6x0_apm_get_power_status(struct apm_power_info *info)
 {
        int battery, backup, charging, percentage;
@@ -38,17 +41,26 @@ static void hp6x0_apm_get_power_status(struct apm_power_info *info)
        percentage = 100 * (battery - HP680_BATTERY_MIN) /
                           (HP680_BATTERY_MAX - HP680_BATTERY_MIN);
 
+       /* % of full battery */
+       info->battery_life = percentage;
+
+       /* We want our estimates in minutes */
+       info->units = 0;
+
+       /* Extremely(!!) rough estimate, we will replace this with a datalist later on */
+       info->time = (2 * battery);
+
        info->ac_line_status = (battery > HP680_BATTERY_AC_ON) ?
                         APM_AC_ONLINE : APM_AC_OFFLINE;
 
-       pgdr = ctrl_inb(SH7709_PGDR);
+       pgdr = ctrl_inb(PGDR);
        if (pgdr & PGDR_MAIN_BATTERY_OUT) {
                info->battery_status    = APM_BATTERY_STATUS_NOT_PRESENT;
                info->battery_flag      = 0x80;
        } else if (charging < 8) {
                info->battery_status    = APM_BATTERY_STATUS_CHARGING;
                info->battery_flag      = 0x08;
-               info->ac_line_status = 0xff;
+               info->ac_line_status    = 0x01;
        } else if (percentage <= APM_CRITICAL) {
                info->battery_status    = APM_BATTERY_STATUS_CRITICAL;
                info->battery_flag      = 0x04;
@@ -59,8 +71,6 @@ static void hp6x0_apm_get_power_status(struct apm_power_info *info)
                info->battery_status    = APM_BATTERY_STATUS_HIGH;
                info->battery_flag      = 0x01;
        }
-
-       info->units = 0;
 }
 
 static irqreturn_t hp6x0_apm_interrupt(int irq, void *dev)
diff --git a/arch/sh/boards/renesas/sh7710voipgw/Makefile b/arch/sh/boards/renesas/sh7710voipgw/Makefile
deleted file mode 100644 (file)
index 7703756..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y   := setup.o
diff --git a/arch/sh/boards/renesas/sh7710voipgw/setup.c b/arch/sh/boards/renesas/sh7710voipgw/setup.c
deleted file mode 100644 (file)
index 0d56fd8..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Renesas Technology SH7710 VoIP Gateway
- *
- * Copyright (C) 2006  Ranjit Deshpande
- * Kenati Technologies Inc.
- *
- * May be copied or modified under the terms of the GNU General Public
- * License.  See linux/COPYING for more information.
- */
-#include <linux/init.h>
-#include <asm/machvec.h>
-#include <asm/irq.h>
-#include <asm/io.h>
-
-static struct ipr_data sh7710voipgw_ipr_map[] = {
-       { TIMER2_IRQ, TIMER2_IPR_ADDR, TIMER2_IPR_POS, TIMER2_PRIORITY },
-       { WDT_IRQ, WDT_IPR_ADDR, WDT_IPR_POS, WDT_PRIORITY },
-
-       /* SCIF0 */
-       { SCIF0_ERI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
-       { SCIF0_RXI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
-       { SCIF0_BRI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
-       { SCIF0_TXI_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY },
-
-       /* DMAC-1 */
-       { DMTE0_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
-       { DMTE1_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
-       { DMTE2_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
-       { DMTE3_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY },
-
-       /* DMAC-2 */
-       { DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY },
-       { DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY },
-
-       /* IPSEC */
-       { IPSEC_IRQ, IPSEC_IPR_ADDR, IPSEC_IPR_POS, IPSEC_PRIORITY },
-
-       /* EDMAC */
-       { EDMAC0_IRQ, EDMAC0_IPR_ADDR, EDMAC0_IPR_POS, EDMAC0_PRIORITY },
-       { EDMAC1_IRQ, EDMAC1_IPR_ADDR, EDMAC1_IPR_POS, EDMAC1_PRIORITY },
-       { EDMAC2_IRQ, EDMAC2_IPR_ADDR, EDMAC2_IPR_POS, EDMAC2_PRIORITY },
-
-       /* SIOF0 */
-       { SIOF0_ERI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
-       { SIOF0_TXI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
-       { SIOF0_RXI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
-       { SIOF0_CCI_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY },
-
-       /* SIOF1 */
-       { SIOF1_ERI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY },
-       { SIOF1_TXI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY },
-       { SIOF1_RXI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY },
-       { SIOF1_CCI_IRQ, SIOF1_IPR_ADDR, SIOF1_IPR_POS, SIOF1_PRIORITY },
-
-       /* SLIC IRQ's */
-       { IRQ1_IRQ, IRQ1_IPR_ADDR, IRQ1_IPR_POS, IRQ1_PRIORITY },
-       { IRQ2_IRQ, IRQ2_IPR_ADDR, IRQ2_IPR_POS, IRQ2_PRIORITY },
-};
-
-/*
- * Initialize IRQ setting
- */
-static void __init sh7710voipgw_init_irq(void)
-{
-       /* Disable all interrupts in IPR registers */
-       ctrl_outw(0x0, INTC_IPRA);
-       ctrl_outw(0x0, INTC_IPRB);
-       ctrl_outw(0x0, INTC_IPRC);
-       ctrl_outw(0x0, INTC_IPRD);
-       ctrl_outw(0x0, INTC_IPRE);
-       ctrl_outw(0x0, INTC_IPRF);
-       ctrl_outw(0x0, INTC_IPRG);
-       ctrl_outw(0x0, INTC_IPRH);
-       ctrl_outw(0x0, INTC_IPRI);
-
-       /* Ack all interrupt sources in the IRR0 register */
-       ctrl_outb(0x3f, INTC_IRR0);
-
-       /* Use IRQ0 - IRQ3 as active low interrupt lines i.e. disable
-        * IRL mode.
-        */
-       ctrl_outw(0x2aa, INTC_ICR1);
-
-       make_ipr_irq(sh7710voipgw_ipr_map, ARRAY_SIZE(sh7710voipgw_ipr_map));
-}
-
-/*
- * The Machine Vector
- */
-static struct sh_machine_vector mv_sh7710voipgw __initmv = {
-       .mv_name                = "SH7710 VoIP Gateway",
-       .mv_nr_irqs             = 104,
-       .mv_init_irq            = sh7710voipgw_init_irq,
-};
index 6d4454fef97c948e3ba9640ced74c636e326adcc..b5c673c39337ef14fb6b7b7ab99de0b6d838c0c6 100644 (file)
@@ -68,7 +68,7 @@ static void __ilsel_enable(ilsel_source_t set, unsigned int bit)
        shift = mk_ilsel_shift(bit);
 
        pr_debug("%s: bit#%d: addr - 0x%08lx (shift %d, set %d)\n",
-                __FUNCTION__, bit, addr, shift, set);
+                __func__, bit, addr, shift, set);
 
        tmp = ctrl_inw(addr);
        tmp &= ~(0xf << shift);
index b704e20d7e4dccf35ac9c5b3c614577840f5ec80..9f8a540f7e141d0ee61f9094c7d9436fc1135b1c 100644 (file)
@@ -127,7 +127,7 @@ static unsigned long microdev_isa_port2addr(unsigned long offset)
                         *      safe default.
                         */
                printk("Warning: unexpected port in %s( offset = 0x%lx )\n",
-                      __FUNCTION__, offset);
+                      __func__, offset);
                result = PVR;
        }
 
index 2ad804ec920a62d6f3373f74955f595f2dc138f0..1a072615ffd41a1c62c1dbc547d43cbfa61657b3 100644 (file)
@@ -1,9 +1,10 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24-rc2
-# Tue Nov 13 20:32:39 2007
+# Linux kernel version: 2.6.25-rc4
+# Thu Mar  6 15:39:59 2008
 #
 CONFIG_SUPERH=y
+CONFIG_SUPERH32=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -19,6 +20,8 @@ CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
+CONFIG_IO_TRAPPED=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
@@ -37,17 +40,20 @@ CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_BSD_PROCESS_ACCT=y
 # CONFIG_BSD_PROCESS_ACCT_V3 is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_USER_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
+CONFIG_GROUP_SCHED=y
 CONFIG_FAIR_GROUP_SCHED=y
-CONFIG_FAIR_USER_SCHED=y
-# CONFIG_FAIR_CGROUP_SCHED is not set
-# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
 # CONFIG_BLK_DEV_INITRD is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
@@ -61,17 +67,27 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 # CONFIG_FUTEX is not set
 CONFIG_ANON_INODES=y
 # CONFIG_EPOLL is not set
 CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
 CONFIG_SLAB=y
 # CONFIG_SLUB is not set
 # CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=m
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
@@ -98,6 +114,8 @@ CONFIG_IOSCHED_NOOP=y
 # CONFIG_DEFAULT_CFQ is not set
 CONFIG_DEFAULT_NOOP=y
 CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_RCU is not set
 
 #
 # System type
@@ -105,7 +123,9 @@ CONFIG_DEFAULT_IOSCHED="noop"
 CONFIG_CPU_SH4=y
 CONFIG_CPU_SH4A=y
 # CONFIG_CPU_SUBTYPE_SH7619 is not set
+# CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
+# CONFIG_CPU_SUBTYPE_SH7263 is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
@@ -114,6 +134,7 @@ CONFIG_CPU_SH4A=y
 # CONFIG_CPU_SUBTYPE_SH7710 is not set
 # CONFIG_CPU_SUBTYPE_SH7712 is not set
 # CONFIG_CPU_SUBTYPE_SH7720 is not set
+# CONFIG_CPU_SUBTYPE_SH7721 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 # CONFIG_CPU_SUBTYPE_SH7091 is not set
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -122,12 +143,16 @@ CONFIG_CPU_SH4A=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
+# CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 CONFIG_CPU_SUBTYPE_SH7780=y
 # CONFIG_CPU_SUBTYPE_SH7785 is not set
 # CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
+# CONFIG_CPU_SUBTYPE_SH5_101 is not set
+# CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
 #
 # Memory management options
@@ -137,7 +162,8 @@ CONFIG_MMU=y
 CONFIG_PAGE_OFFSET=0x80000000
 CONFIG_MEMORY_START=0x08000000
 CONFIG_MEMORY_SIZE=0x08000000
-# CONFIG_32BIT is not set
+CONFIG_29BIT=y
+# CONFIG_PMB is not set
 CONFIG_VSYSCALL=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
@@ -153,6 +179,7 @@ CONFIG_HUGETLB_PAGE_SIZE_64K=y
 # CONFIG_HUGETLB_PAGE_SIZE_1MB is not set
 # CONFIG_HUGETLB_PAGE_SIZE_4MB is not set
 # CONFIG_HUGETLB_PAGE_SIZE_64MB is not set
+# CONFIG_HUGETLB_PAGE_SIZE_512MB is not set
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -190,6 +217,7 @@ CONFIG_CPU_HAS_FPU=y
 # Board support
 #
 # CONFIG_SH_7780_SOLUTION_ENGINE is not set
+# CONFIG_SH_SDK7780 is not set
 CONFIG_SH_HIGHLANDER=y
 # CONFIG_SH_R7780RP is not set
 CONFIG_SH_R7780MP=y
@@ -234,12 +262,13 @@ CONFIG_HZ_250=y
 # CONFIG_HZ_300 is not set
 # CONFIG_HZ_1000 is not set
 CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
 CONFIG_KEXEC=y
 # CONFIG_CRASH_DUMP is not set
 # CONFIG_PREEMPT_NONE is not set
 # CONFIG_PREEMPT_VOLUNTARY is not set
 CONFIG_PREEMPT=y
-CONFIG_PREEMPT_BKL=y
+CONFIG_RCU_TRACE=y
 CONFIG_GUSA=y
 
 #
@@ -284,6 +313,7 @@ CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
 # CONFIG_XFRM_SUB_POLICY is not set
 # CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
@@ -344,6 +374,7 @@ CONFIG_LLC=m
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
@@ -386,7 +417,7 @@ CONFIG_BLK_DEV=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 CONFIG_MISC_DEVICES=y
@@ -394,6 +425,8 @@ CONFIG_MISC_DEVICES=y
 CONFIG_EEPROM_93CX6=y
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -453,6 +486,7 @@ CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_MVSAS is not set
 # CONFIG_SCSI_STEX is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_IPR is not set
@@ -506,6 +540,7 @@ CONFIG_SATA_SIL=y
 # CONFIG_PATA_MPIIX is not set
 # CONFIG_PATA_OLDPIIX is not set
 # CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
 # CONFIG_PATA_NS87410 is not set
 # CONFIG_PATA_NS87415 is not set
 # CONFIG_PATA_OPTI is not set
@@ -538,7 +573,6 @@ CONFIG_NETDEVICES=y
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_VETH is not set
-# CONFIG_IP1000 is not set
 # CONFIG_ARCNET is not set
 # CONFIG_PHYLIB is not set
 CONFIG_NET_ETHERNET=y
@@ -551,7 +585,6 @@ CONFIG_AX88796_93CX6=y
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 # CONFIG_SMC91X is not set
-# CONFIG_SMC911X is not set
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
 # CONFIG_IBM_NEW_EMAC_ZMII is not set
@@ -576,6 +609,7 @@ CONFIG_8139TOO=m
 # CONFIG_8139TOO_TUNE_TWISTER is not set
 CONFIG_8139TOO_8129=y
 # CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_R6040 is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
@@ -591,6 +625,9 @@ CONFIG_E1000=m
 # CONFIG_E1000_NAPI is not set
 # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
 # CONFIG_E1000E is not set
+# CONFIG_E1000E_ENABLED is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
 # CONFIG_NS83820 is not set
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
@@ -616,6 +653,7 @@ CONFIG_NETDEV_10000=y
 # CONFIG_NIU is not set
 # CONFIG_MLX4_CORE is not set
 # CONFIG_TEHUTI is not set
+# CONFIG_BNX2X is not set
 # CONFIG_TR is not set
 
 #
@@ -629,7 +667,6 @@ CONFIG_NETDEV_10000=y
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 # CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -686,6 +723,7 @@ CONFIG_SERIO_LIBPS2=y
 #
 # CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
 
 #
 # Serial drivers
@@ -722,6 +760,7 @@ CONFIG_DEVPORT=y
 # CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_I5K_AMB is not set
 # CONFIG_SENSORS_F71805F is not set
 # CONFIG_SENSORS_F71882FG is not set
 # CONFIG_SENSORS_IT87 is not set
@@ -736,6 +775,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_W83627HF is not set
 # CONFIG_SENSORS_W83627EHF is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
+CONFIG_THERMAL=y
 # CONFIG_WATCHDOG is not set
 
 #
@@ -800,12 +840,9 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
-
-#
-# USB Gadget Support
-#
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
 # CONFIG_INFINIBAND is not set
 CONFIG_RTC_LIB=y
@@ -830,9 +867,10 @@ CONFIG_RTC_INTF_DEV=y
 #
 # Platform RTC drivers
 #
+# CONFIG_RTC_DRV_DS1511 is not set
 # CONFIG_RTC_DRV_DS1553 is not set
-# CONFIG_RTC_DRV_STK17TA8 is not set
 # CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
 # CONFIG_RTC_DRV_M48T86 is not set
 # CONFIG_RTC_DRV_M48T59 is not set
 # CONFIG_RTC_DRV_V3020 is not set
@@ -867,12 +905,10 @@ CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
 # CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
-CONFIG_MINIX_FS=y
-# CONFIG_ROMFS_FS is not set
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 CONFIG_FUSE_FS=m
@@ -920,8 +956,10 @@ CONFIG_CONFIGFS_FS=m
 # CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+CONFIG_MINIX_FS=y
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
 CONFIG_NETWORK_FILESYSTEMS=y
@@ -997,10 +1035,6 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
 # CONFIG_DLM is not set
-CONFIG_INSTRUMENTATION=y
-CONFIG_PROFILING=y
-CONFIG_OPROFILE=m
-# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
@@ -1035,9 +1069,9 @@ CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
 # CONFIG_FRAME_POINTER is not set
-CONFIG_FORCED_INLINING=y
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
 # CONFIG_SAMPLES is not set
 CONFIG_SH_STANDARD_BIOS=y
@@ -1059,6 +1093,7 @@ CONFIG_DEBUG_STACKOVERFLOW=y
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_BLKCIPHER=y
+# CONFIG_CRYPTO_SEQIV is not set
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_HMAC=y
@@ -1077,6 +1112,9 @@ CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_LRW is not set
 # CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_CCM is not set
 # CONFIG_CRYPTO_CRYPTD is not set
 CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_FCRYPT is not set
@@ -1091,13 +1129,16 @@ CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_KHAZAD is not set
 # CONFIG_CRYPTO_ANUBIS is not set
 # CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SALSA20 is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
 # CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_CAMELLIA is not set
 # CONFIG_CRYPTO_TEST is not set
 # CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_LZO is not set
 CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
 
 #
 # Library routines
index f68743dc3931e876838f03d5a4dfdddbdf69e96b..30f5ee40c312fc43105d4660d9eb4e23c6796d05 100644 (file)
@@ -1,9 +1,10 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.21-rc3
-# Thu Mar 15 14:06:20 2007
+# Linux kernel version: 2.6.25-rc3
+# Thu Feb 28 10:18:04 2008
 #
 CONFIG_SUPERH=y
+CONFIG_SUPERH32=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
@@ -11,38 +12,44 @@ CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-# CONFIG_GENERIC_TIME is not set
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_SYS_SUPPORTS_PCI=y
 CONFIG_STACKTRACE_SUPPORT=y
 CONFIG_LOCKDEP_SUPPORT=y
 # CONFIG_ARCH_HAS_ILOG2_U32 is not set
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 # CONFIG_EXPERIMENTAL is not set
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
 CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
 # CONFIG_BLK_DEV_INITRD is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 CONFIG_EMBEDDED=y
 CONFIG_UID16=y
@@ -52,31 +59,36 @@ CONFIG_SYSCTL_SYSCALL=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
 # CONFIG_EPOLL is not set
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
-CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_KPROBES is not set
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
 
 #
@@ -91,68 +103,27 @@ CONFIG_DEFAULT_DEADLINE=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="deadline"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_RCU is not set
 
 #
 # System type
 #
-CONFIG_SOLUTION_ENGINE=y
-# CONFIG_SH_SOLUTION_ENGINE is not set
-# CONFIG_SH_7751_SOLUTION_ENGINE is not set
-CONFIG_SH_7780_SOLUTION_ENGINE=y
-# CONFIG_SH_7300_SOLUTION_ENGINE is not set
-# CONFIG_SH_7343_SOLUTION_ENGINE is not set
-# CONFIG_SH_73180_SOLUTION_ENGINE is not set
-# CONFIG_SH_7751_SYSTEMH is not set
-# CONFIG_SH_HP6XX is not set
-# CONFIG_SH_SATURN is not set
-# CONFIG_SH_DREAMCAST is not set
-# CONFIG_SH_MPC1211 is not set
-# CONFIG_SH_SH03 is not set
-# CONFIG_SH_SECUREEDGE5410 is not set
-# CONFIG_SH_HS7751RVOIP is not set
-# CONFIG_SH_7710VOIPGW is not set
-# CONFIG_SH_RTS7751R2D is not set
-# CONFIG_SH_HIGHLANDER is not set
-# CONFIG_SH_EDOSK7705 is not set
-# CONFIG_SH_SH4202_MICRODEV is not set
-# CONFIG_SH_LANDISK is not set
-# CONFIG_SH_TITAN is not set
-# CONFIG_SH_SHMIN is not set
-# CONFIG_SH_7206_SOLUTION_ENGINE is not set
-# CONFIG_SH_7619_SOLUTION_ENGINE is not set
-# CONFIG_SH_UNKNOWN is not set
-
-#
-# Processor selection
-#
 CONFIG_CPU_SH4=y
 CONFIG_CPU_SH4A=y
-
-#
-# SH-2 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH7604 is not set
 # CONFIG_CPU_SUBTYPE_SH7619 is not set
-
-#
-# SH-2A Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7203 is not set
 # CONFIG_CPU_SUBTYPE_SH7206 is not set
-
-#
-# SH-3 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH7300 is not set
+# CONFIG_CPU_SUBTYPE_SH7263 is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
 # CONFIG_CPU_SUBTYPE_SH7708 is not set
 # CONFIG_CPU_SUBTYPE_SH7709 is not set
 # CONFIG_CPU_SUBTYPE_SH7710 is not set
-
-#
-# SH-4 Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7712 is not set
+# CONFIG_CPU_SUBTYPE_SH7720 is not set
+# CONFIG_CPU_SUBTYPE_SH7721 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 # CONFIG_CPU_SUBTYPE_SH7091 is not set
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -161,52 +132,58 @@ CONFIG_CPU_SH4A=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
-
-#
-# ST40 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
-# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
-
-#
-# SH-4A Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 CONFIG_CPU_SUBTYPE_SH7780=y
 # CONFIG_CPU_SUBTYPE_SH7785 is not set
-
-#
-# SH4AL-DSP Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH73180 is not set
+# CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
 # CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
+# CONFIG_CPU_SUBTYPE_SH5_101 is not set
+# CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
 #
 # Memory management options
 #
+CONFIG_QUICKLIST=y
 CONFIG_MMU=y
 CONFIG_PAGE_OFFSET=0x80000000
 CONFIG_MEMORY_START=0x08000000
 CONFIG_MEMORY_SIZE=0x08000000
-CONFIG_32BIT=y
+CONFIG_29BIT=y
+# CONFIG_PMB is not set
 CONFIG_VSYSCALL=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_MAX_ACTIVE_REGIONS=1
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_PAGE_SIZE_4KB=y
 # CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+# CONFIG_FLATMEM_MANUAL is not set
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_SPARSEMEM=y
+CONFIG_HAVE_MEMORY_PRESENT=y
+CONFIG_SPARSEMEM_STATIC=y
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=0
+CONFIG_NR_QUICK=2
 
 #
 # Cache configuration
 #
 # CONFIG_SH_DIRECT_MAPPED is not set
-# CONFIG_SH_WRITETHROUGH is not set
-# CONFIG_SH_OCRAM is not set
+CONFIG_CACHE_WRITEBACK=y
+# CONFIG_CACHE_WRITETHROUGH is not set
+# CONFIG_CACHE_OFF is not set
 
 #
 # Processor features
@@ -214,20 +191,29 @@ CONFIG_ZONE_DMA_FLAG=0
 CONFIG_CPU_LITTLE_ENDIAN=y
 # CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_SH_FPU=y
-# CONFIG_SH_DSP is not set
 # CONFIG_SH_STORE_QUEUES is not set
 CONFIG_CPU_HAS_INTEVT=y
-CONFIG_CPU_HAS_INTC2_IRQ=y
-CONFIG_CPU_HAS_INTC_IRQ=y
 CONFIG_CPU_HAS_SR_RB=y
+CONFIG_CPU_HAS_FPU=y
+
+#
+# Board support
+#
+CONFIG_SOLUTION_ENGINE=y
+CONFIG_SH_7780_SOLUTION_ENGINE=y
+# CONFIG_SH_SDK7780 is not set
+# CONFIG_SH_HIGHLANDER is not set
 
 #
 # Timer and clock configuration
 #
 CONFIG_SH_TMU=y
 CONFIG_SH_TIMER_IRQ=28
-# CONFIG_NO_IDLE_HZ is not set
 CONFIG_SH_PCLK_FREQ=33333333
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 
 #
 # CPU Frequency scaling
@@ -242,7 +228,6 @@ CONFIG_SH_PCLK_FREQ=33333333
 #
 # Companion Chips
 #
-# CONFIG_HD6446X_SERIES is not set
 
 #
 # Additional SuperH Device Drivers
@@ -258,40 +243,36 @@ CONFIG_HZ_250=y
 # CONFIG_HZ_300 is not set
 # CONFIG_HZ_1000 is not set
 CONFIG_HZ=250
-# CONFIG_SMP is not set
+# CONFIG_SCHED_HRTICK is not set
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
+CONFIG_RCU_TRACE=y
+CONFIG_GUSA=y
 
 #
 # Boot options
 #
 CONFIG_ZERO_PAGE_OFFSET=0x00001000
 CONFIG_BOOT_LINK_OFFSET=0x00810000
-# CONFIG_UBC_WAKEUP is not set
-# CONFIG_CMDLINE_BOOL is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=ttySC0.115200 root=/dev/sda1"
 
 #
 # Bus options
 #
+# CONFIG_CF_ENABLER is not set
 CONFIG_PCI=y
 CONFIG_SH_PCIDMA_NONCOHERENT=y
 CONFIG_PCI_AUTO=y
 CONFIG_PCI_AUTO_UPDATE_RESOURCES=y
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
-
-#
-# PCI Hotplug Support
-#
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_PCI_LEGACY=y
 
 #
 # Executable file formats
 #
 CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_FLAT is not set
 # CONFIG_BINFMT_MISC is not set
 
 #
@@ -302,7 +283,6 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -329,6 +309,7 @@ CONFIG_IP_PNP=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -349,16 +330,13 @@ CONFIG_IPV6=y
 # CONFIG_IPV6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
+# CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -366,9 +344,18 @@ CONFIG_IPV6=y
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
 
 #
 # Device Drivers
@@ -380,15 +367,7 @@ CONFIG_IPV6=y
 CONFIG_STANDALONE=y
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 # CONFIG_MTD_CONCAT is not set
@@ -407,6 +386,7 @@ CONFIG_MTD_BLOCK=y
 # CONFIG_INFTL is not set
 # CONFIG_RFD_FTL is not set
 # CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -437,13 +417,13 @@ CONFIG_MTD_CFI_UTIL=y
 # CONFIG_MTD_RAM is not set
 CONFIG_MTD_ROM=y
 # CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_OBSOLETE_CHIPS is not set
 
 #
 # Mapping drivers for chip access
 #
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
 # CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_INTEL_VR_NOR is not set
 # CONFIG_MTD_PLATRAM is not set
 
 #
@@ -461,31 +441,15 @@ CONFIG_MTD_ROM=y
 # CONFIG_MTD_DOC2000 is not set
 # CONFIG_MTD_DOC2001 is not set
 # CONFIG_MTD_DOC2001PLUS is not set
-
-#
-# NAND Flash Device Drivers
-#
 # CONFIG_MTD_NAND is not set
-
-#
-# OneNAND Flash Device Drivers
-#
 # CONFIG_MTD_ONENAND is not set
 
 #
-# Parallel port support
+# UBI - Unsorted block images
 #
+# CONFIG_MTD_UBI is not set
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNPACPI is not set
-
-#
-# Block devices
-#
-# CONFIG_BLK_CPQ_DA is not set
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_COW_COMMON is not set
@@ -497,15 +461,12 @@ CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-
-#
-# Misc devices
-#
+CONFIG_MISC_DEVICES=y
+# CONFIG_PHANTOM is not set
+# CONFIG_EEPROM_93CX6 is not set
 # CONFIG_SGI_IOC4 is not set
-
-#
-# ATA/ATAPI/MFM/RLL support
-#
+# CONFIG_ENCLOSURE_SERVICES is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -513,6 +474,7 @@ CONFIG_BLK_DEV_LOOP=y
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
 # CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
 
@@ -533,6 +495,7 @@ CONFIG_CHR_DEV_SG=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 # CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
 # SCSI Transports
@@ -540,12 +503,9 @@ CONFIG_CHR_DEV_SG=y
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
 # CONFIG_SCSI_3W_9XXX is not set
@@ -555,7 +515,6 @@ CONFIG_CHR_DEV_SG=y
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
 # CONFIG_SCSI_AIC94XX is not set
-# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ARCMSR is not set
 # CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
@@ -566,6 +525,7 @@ CONFIG_CHR_DEV_SG=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INITIO is not set
 # CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_MVSAS is not set
 # CONFIG_SCSI_STEX is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
 # CONFIG_SCSI_IPR is not set
@@ -577,10 +537,6 @@ CONFIG_CHR_DEV_SG=y
 # CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 # CONFIG_SCSI_SRP is not set
-
-#
-# Serial ATA (prod) and Parallel ATA (experimental) drivers
-#
 CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
 # CONFIG_SATA_AHCI is not set
@@ -597,62 +553,48 @@ CONFIG_SATA_SIL=y
 # CONFIG_SATA_VIA is not set
 # CONFIG_SATA_VITESSE is not set
 # CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD64X is not set
 # CONFIG_PATA_CS5520 is not set
 # CONFIG_PATA_EFAR is not set
 # CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
 # CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
 # CONFIG_PATA_JMICRON is not set
 # CONFIG_PATA_TRIFLEX is not set
 # CONFIG_PATA_MARVELL is not set
 # CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
 # CONFIG_PATA_NETCELL is not set
 # CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SERVERWORKS is not set
 # CONFIG_PATA_PDC2027X is not set
 # CONFIG_PATA_SIL680 is not set
 # CONFIG_PATA_VIA is not set
 # CONFIG_PATA_WINBOND is not set
 # CONFIG_PATA_PLATFORM is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
 # CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
 #
-# CONFIG_IEEE1394 is not set
 
 #
-# I2O device support
+# An alternative FireWire stack is available with EXPERIMENTAL=y
 #
+# CONFIG_IEEE1394 is not set
 # CONFIG_I2O is not set
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-
-#
-# ARCnet devices
-#
+# CONFIG_VETH is not set
 # CONFIG_ARCNET is not set
-
-#
-# PHY device support
-#
 CONFIG_PHYLIB=y
 
 #
@@ -666,85 +608,59 @@ CONFIG_PHYLIB=y
 # CONFIG_VITESSE_PHY is not set
 CONFIG_SMSC_PHY=y
 # CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
 # CONFIG_FIXED_PHY is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
+# CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+# CONFIG_AX88796 is not set
 # CONFIG_STNIC is not set
 # CONFIG_HAPPYMEAL is not set
 # CONFIG_SUNGEM is not set
 # CONFIG_CASSINI is not set
 # CONFIG_NET_VENDOR_3COM is not set
 CONFIG_SMC91X=y
-
-#
-# Tulip family network device support
-#
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
 CONFIG_NET_PCI=y
 # CONFIG_PCNET32 is not set
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
 # CONFIG_FORCEDETH is not set
-# CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 # CONFIG_E100 is not set
 # CONFIG_FEALNX is not set
 # CONFIG_NATSEMI is not set
 # CONFIG_NE2K_PCI is not set
 # CONFIG_8139TOO is not set
+# CONFIG_R6040 is not set
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
 # CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
-
-#
-# Ethernet (1000 Mbit)
-#
-# CONFIG_ACENIC is not set
-# CONFIG_DL2K is not set
-# CONFIG_E1000 is not set
-# CONFIG_NS83820 is not set
-# CONFIG_HAMACHI is not set
-# CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
-# CONFIG_SKGE is not set
-# CONFIG_SKY2 is not set
-# CONFIG_SK98LIN is not set
-# CONFIG_VIA_VELOCITY is not set
-# CONFIG_TIGON3 is not set
-# CONFIG_BNX2 is not set
-# CONFIG_QLA3XXX is not set
-
-#
-# Ethernet (10000 Mbit)
-#
-# CONFIG_CHELSIO_T1 is not set
-# CONFIG_CHELSIO_T3 is not set
-# CONFIG_IXGB is not set
-# CONFIG_S2IO is not set
-# CONFIG_MYRI10GE is not set
-# CONFIG_NETXEN_NIC is not set
-
-#
-# Token Ring devices
-#
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
 # CONFIG_TR is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Wireless LAN
 #
-# CONFIG_NET_RADIO is not set
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
 
 #
-# Wan interfaces
+# USB Network Adapters
 #
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_USBNET is not set
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_PPP is not set
@@ -752,15 +668,7 @@ CONFIG_NET_PCI=y
 # CONFIG_NET_FC is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
 # CONFIG_PHONE is not set
 
 #
@@ -768,6 +676,7 @@ CONFIG_NET_PCI=y
 #
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
@@ -777,7 +686,6 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -787,6 +695,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
@@ -821,31 +730,12 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_SERIAL_JSM is not set
 CONFIG_UNIX98_PTYS=y
 # CONFIG_LEGACY_PTYS is not set
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
-# CONFIG_GEN_RTC is not set
-# CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
-
-#
-# I2C support
-#
+CONFIG_DEVPORT=y
 # CONFIG_I2C is not set
 
 #
@@ -853,18 +743,27 @@ CONFIG_UNIX98_PTYS=y
 #
 # CONFIG_SPI is not set
 # CONFIG_SPI_MASTER is not set
-
-#
-# Dallas's 1-wire bus
-#
 # CONFIG_W1 is not set
-
-#
-# Hardware Monitoring support
-#
+# CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
+CONFIG_THERMAL=y
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
@@ -875,23 +774,27 @@ CONFIG_HWMON=y
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
-
-#
-# Digital Video Broadcasting Devices
-#
-# CONFIG_DVB is not set
-# CONFIG_USB_DABUSB is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
 
 #
 # Graphics support
 #
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
 CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 # CONFIG_FB_DDC is not set
 # CONFIG_FB_CFB_FILLRECT is not set
 # CONFIG_FB_CFB_COPYAREA is not set
 # CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_SYS_FOPS is not set
+CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 # CONFIG_FB_MACMODES is not set
 # CONFIG_FB_BACKLIGHT is not set
@@ -899,14 +802,13 @@ CONFIG_FIRMWARE_EDID=y
 # CONFIG_FB_TILEBLITTING is not set
 
 #
-# Frambuffer hardware drivers
+# Frambuffer hardware drivers
 #
 # CONFIG_FB_CIRRUS is not set
 # CONFIG_FB_PM2 is not set
 # CONFIG_FB_CYBER2000 is not set
 # CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
-# CONFIG_FB_EPSON1355 is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_NVIDIA is not set
 # CONFIG_FB_RIVA is not set
@@ -920,22 +822,27 @@ CONFIG_FIRMWARE_EDID=y
 # CONFIG_FB_KYRO is not set
 # CONFIG_FB_3DFX is not set
 # CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_VT8623 is not set
 # CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_ARK is not set
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
 #
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
 # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
 # CONFIG_FONTS is not set
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
-
-#
-# Logo configuration
-#
 CONFIG_LOGO=y
 # CONFIG_LOGO_LINUX_MONO is not set
 # CONFIG_LOGO_LINUX_VGA16 is not set
@@ -958,39 +865,38 @@ CONFIG_SOUND=y
 # Open Sound System
 #
 CONFIG_SOUND_PRIME=y
-# CONFIG_OBSOLETE_OSS is not set
-# CONFIG_SOUND_BT878 is not set
-# CONFIG_SOUND_ICH is not set
 # CONFIG_SOUND_TRIDENT is not set
 # CONFIG_SOUND_MSNDCLAS is not set
 # CONFIG_SOUND_MSNDPIN is not set
-# CONFIG_SOUND_VIA82CXXX is not set
-
-#
-# HID Devices
-#
+CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
 
 #
-# USB support
+# USB Input Devices
 #
+CONFIG_USB_HID=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_USB_HIDDEV is not set
+CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
 CONFIG_USB=y
-CONFIG_USB_DEBUG=y
+# CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
 
 #
 # Miscellaneous USB options
 #
 CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DEVICE_CLASS is not set
 
 #
 # USB Host Controller Drivers
 #
 CONFIG_USB_EHCI_HCD=y
-# CONFIG_USB_EHCI_BIG_ENDIAN_MMIO is not set
 # CONFIG_USB_ISP116X_HCD is not set
 CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
@@ -998,6 +904,7 @@ CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_UHCI_HCD is not set
 # CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
 
 #
 # USB Device Class drivers
@@ -1015,49 +922,20 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_DEBUG is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
 # CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_STORAGE_KARMA is not set
 # CONFIG_USB_LIBUSUAL is not set
 
-#
-# USB Input Devices
-#
-CONFIG_USB_HID=y
-# CONFIG_USB_HIDINPUT_POWERBOOK is not set
-# CONFIG_USB_HIDDEV is not set
-# CONFIG_USB_AIPTEK is not set
-# CONFIG_USB_WACOM is not set
-# CONFIG_USB_ACECAD is not set
-# CONFIG_USB_KBTAB is not set
-# CONFIG_USB_POWERMATE is not set
-# CONFIG_USB_TOUCHSCREEN is not set
-# CONFIG_USB_XPAD is not set
-# CONFIG_USB_ATI_REMOTE is not set
-# CONFIG_USB_ATI_REMOTE2 is not set
-# CONFIG_USB_APPLETOUCH is not set
-# CONFIG_USB_GTCO is not set
-
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MICROTEK is not set
-
-#
-# USB Network Adapters
-#
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_USBNET_MII is not set
-# CONFIG_USB_USBNET is not set
 CONFIG_USB_MON=y
 
 #
 # USB port drivers
 #
-
-#
-# USB Serial Converter support
-#
 # CONFIG_USB_SERIAL is not set
 
 #
@@ -1078,67 +956,17 @@ CONFIG_USB_MON=y
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_IOWARRIOR is not set
-
-#
-# USB DSL modem support
-#
-
-#
-# USB Gadget Support
-#
 # CONFIG_USB_GADGET is not set
-
-#
-# MMC/SD Card support
-#
 # CONFIG_MMC is not set
-
-#
-# LED devices
-#
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
 # CONFIG_INFINIBAND is not set
+# CONFIG_RTC_CLASS is not set
 
 #
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
-#
-
-#
-# Real Time Clock
-#
-
-#
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
-#
-# Auxiliary Display support
-#
-
-#
-# Virtualization
+# Userspace I/O
 #
+# CONFIG_UIO is not set
 
 #
 # File systems
@@ -1151,12 +979,11 @@ CONFIG_EXT2_FS=y
 # CONFIG_JFS_FS is not set
 # CONFIG_FS_POSIX_ACL is not set
 # CONFIG_XFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_DNOTIFY is not set
 CONFIG_INOTIFY=y
 CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-# CONFIG_DNOTIFY is not set
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -1181,14 +1008,14 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 # Pseudo filesystems
 #
 CONFIG_PROC_FS=y
-# CONFIG_PROC_KCORE is not set
+CONFIG_PROC_KCORE=y
 CONFIG_PROC_SYSCTL=y
-# CONFIG_SYSFS is not set
+CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLBFS is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -1197,14 +1024,13 @@ CONFIG_RAMFS=y
 # CONFIG_JFFS2_FS is not set
 CONFIG_CRAMFS=y
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
@@ -1225,10 +1051,6 @@ CONFIG_SUNRPC=y
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_CODEPAGE_437 is not set
@@ -1275,13 +1097,15 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 #
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
-CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_SAMPLES is not set
 # CONFIG_SH_STANDARD_BIOS is not set
 # CONFIG_EARLY_SCIF_CONSOLE is not set
 # CONFIG_SH_KGDB is not set
@@ -1290,11 +1114,48 @@ CONFIG_LOG_BUF_SHIFT=14
 # Security options
 #
 # CONFIG_KEYS is not set
-
-#
-# Cryptographic options
-#
-# CONFIG_CRYPTO is not set
+# CONFIG_SECURITY is not set
+CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_SEQIV is not set
+# CONFIG_CRYPTO_MANAGER is not set
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_CBC is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_TEST is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_LZO is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
 
 #
 # Library routines
@@ -1302,9 +1163,12 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BITREVERSE=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index 9380c321169a747d19a993bc52a51776591a1f84..37e49a58920792af09be018214e24011074e9bde 100644 (file)
@@ -1,40 +1,55 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.18
-# Tue Oct  3 12:48:56 2006
+# Linux kernel version: 2.6.25-rc4
+# Thu Mar  6 16:02:29 2008
 #
 CONFIG_SUPERH=y
+CONFIG_SUPERH32=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
-CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_NAMESPACES is not set
+# CONFIG_BLK_DEV_INITRD is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 CONFIG_EMBEDDED=y
@@ -46,33 +61,39 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 # CONFIG_FUTEX is not set
+CONFIG_ANON_INODES=y
 # CONFIG_EPOLL is not set
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
 # CONFIG_SHMEM is not set
-CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
 CONFIG_TINY_SHMEM=y
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 # CONFIG_KMOD is not set
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -86,59 +107,26 @@ CONFIG_DEFAULT_DEADLINE=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="deadline"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_RCU is not set
 
 #
 # System type
 #
-# CONFIG_SH_SOLUTION_ENGINE is not set
-# CONFIG_SH_7751_SOLUTION_ENGINE is not set
-# CONFIG_SH_7300_SOLUTION_ENGINE is not set
-# CONFIG_SH_7343_SOLUTION_ENGINE is not set
-# CONFIG_SH_73180_SOLUTION_ENGINE is not set
-# CONFIG_SH_7751_SYSTEMH is not set
-# CONFIG_SH_HP6XX is not set
-# CONFIG_SH_EC3104 is not set
-# CONFIG_SH_SATURN is not set
-# CONFIG_SH_DREAMCAST is not set
-# CONFIG_SH_BIGSUR is not set
-# CONFIG_SH_MPC1211 is not set
-# CONFIG_SH_SH03 is not set
-# CONFIG_SH_SECUREEDGE5410 is not set
-# CONFIG_SH_HS7751RVOIP is not set
-CONFIG_SH_7710VOIPGW=y
-# CONFIG_SH_RTS7751R2D is not set
-# CONFIG_SH_R7780RP is not set
-# CONFIG_SH_EDOSK7705 is not set
-# CONFIG_SH_SH4202_MICRODEV is not set
-# CONFIG_SH_LANDISK is not set
-# CONFIG_SH_TITAN is not set
-# CONFIG_SH_SHMIN is not set
-# CONFIG_SH_UNKNOWN is not set
-
-#
-# Processor selection
-#
 CONFIG_CPU_SH3=y
-
-#
-# SH-2 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH7604 is not set
-
-#
-# SH-3 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH7300 is not set
+# CONFIG_CPU_SUBTYPE_SH7619 is not set
+# CONFIG_CPU_SUBTYPE_SH7203 is not set
+# CONFIG_CPU_SUBTYPE_SH7206 is not set
+# CONFIG_CPU_SUBTYPE_SH7263 is not set
 # CONFIG_CPU_SUBTYPE_SH7705 is not set
 # CONFIG_CPU_SUBTYPE_SH7706 is not set
 # CONFIG_CPU_SUBTYPE_SH7707 is not set
 # CONFIG_CPU_SUBTYPE_SH7708 is not set
 # CONFIG_CPU_SUBTYPE_SH7709 is not set
 CONFIG_CPU_SUBTYPE_SH7710=y
-
-#
-# SH-4 Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7712 is not set
+# CONFIG_CPU_SUBTYPE_SH7720 is not set
+# CONFIG_CPU_SUBTYPE_SH7721 is not set
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 # CONFIG_CPU_SUBTYPE_SH7091 is not set
 # CONFIG_CPU_SUBTYPE_SH7750R is not set
@@ -147,65 +135,84 @@ CONFIG_CPU_SUBTYPE_SH7710=y
 # CONFIG_CPU_SUBTYPE_SH7751R is not set
 # CONFIG_CPU_SUBTYPE_SH7760 is not set
 # CONFIG_CPU_SUBTYPE_SH4_202 is not set
-
-#
-# ST40 Processor Support
-#
-# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
-# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
-
-#
-# SH-4A Processor Support
-#
+# CONFIG_CPU_SUBTYPE_SH7763 is not set
 # CONFIG_CPU_SUBTYPE_SH7770 is not set
 # CONFIG_CPU_SUBTYPE_SH7780 is not set
-
-#
-# SH4AL-DSP Processor Support
-#
-# CONFIG_CPU_SUBTYPE_SH73180 is not set
+# CONFIG_CPU_SUBTYPE_SH7785 is not set
+# CONFIG_CPU_SUBTYPE_SHX3 is not set
 # CONFIG_CPU_SUBTYPE_SH7343 is not set
+# CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
+# CONFIG_CPU_SUBTYPE_SH5_101 is not set
+# CONFIG_CPU_SUBTYPE_SH5_103 is not set
 
 #
 # Memory management options
 #
+CONFIG_QUICKLIST=y
 CONFIG_MMU=y
 CONFIG_PAGE_OFFSET=0x80000000
 CONFIG_MEMORY_START=0x0c000000
 CONFIG_MEMORY_SIZE=0x00800000
+CONFIG_29BIT=y
 CONFIG_VSYSCALL=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_MAX_ACTIVE_REGIONS=1
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
 # CONFIG_SPARSEMEM_MANUAL is not set
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPARSEMEM_STATIC=y
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_NR_QUICK=2
 
 #
 # Cache configuration
 #
 # CONFIG_SH_DIRECT_MAPPED is not set
-# CONFIG_SH_WRITETHROUGH is not set
-# CONFIG_SH_OCRAM is not set
+CONFIG_CACHE_WRITEBACK=y
+# CONFIG_CACHE_WRITETHROUGH is not set
+# CONFIG_CACHE_OFF is not set
 
 #
 # Processor features
 #
 CONFIG_CPU_LITTLE_ENDIAN=y
+# CONFIG_CPU_BIG_ENDIAN is not set
 # CONFIG_SH_FPU_EMU is not set
 CONFIG_SH_DSP=y
 # CONFIG_SH_ADC is not set
 CONFIG_CPU_HAS_INTEVT=y
 CONFIG_CPU_HAS_SR_RB=y
+CONFIG_CPU_HAS_DSP=y
 
 #
-# Timer support
+# Board support
+#
+# CONFIG_SH_SOLUTION_ENGINE is not set
+
+#
+# Timer and clock configuration
 #
 CONFIG_SH_TMU=y
+CONFIG_SH_TIMER_IRQ=16
 CONFIG_SH_PCLK_FREQ=32768000
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 
 #
 # CPU Frequency scaling
@@ -220,55 +227,50 @@ CONFIG_SH_PCLK_FREQ=32768000
 #
 # Companion Chips
 #
-# CONFIG_HD6446X_SERIES is not set
+
+#
+# Additional SuperH Device Drivers
+#
+# CONFIG_HEARTBEAT is not set
+# CONFIG_PUSH_SWITCH is not set
 
 #
 # Kernel features
 #
 # CONFIG_HZ_100 is not set
 CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
 # CONFIG_HZ_1000 is not set
 CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
 # CONFIG_KEXEC is not set
-# CONFIG_SMP is not set
+# CONFIG_CRASH_DUMP is not set
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
+CONFIG_RCU_TRACE=y
+CONFIG_GUSA=y
+# CONFIG_GUSA_RB is not set
 
 #
 # Boot options
 #
 CONFIG_ZERO_PAGE_OFFSET=0x00001000
 CONFIG_BOOT_LINK_OFFSET=0x00800000
-# CONFIG_UBC_WAKEUP is not set
 # CONFIG_CMDLINE_BOOL is not set
 
 #
 # Bus options
 #
-# CONFIG_PCI is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+# CONFIG_ARCH_SUPPORTS_MSI is not set
 # CONFIG_PCCARD is not set
 
-#
-# PCI Hotplug Support
-#
-
 #
 # Executable file formats
 #
 CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_FLAT is not set
 # CONFIG_BINFMT_MISC is not set
 
-#
-# Power management options (EXPERIMENTAL)
-#
-# CONFIG_PM is not set
-
 #
 # Networking
 #
@@ -277,13 +279,14 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
 # CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
@@ -301,14 +304,13 @@ CONFIG_SYN_COOKIES=y
 # CONFIG_INET_TUNNEL is not set
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
-
-#
-# IP: Virtual Server Configuration
-#
+# CONFIG_TCP_MD5SIG is not set
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
@@ -316,44 +318,24 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_NETWORK_SECMARK is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
+CONFIG_NETFILTER_ADVANCED=y
 
 #
 # Core Netfilter Configuration
 #
-# CONFIG_NETFILTER_NETLINK is not set
+# CONFIG_NETFILTER_NETLINK_QUEUE is not set
+# CONFIG_NETFILTER_NETLINK_LOG is not set
+# CONFIG_NF_CONNTRACK is not set
 # CONFIG_NETFILTER_XTABLES is not set
 
 #
 # IP: Netfilter Configuration
 #
-CONFIG_IP_NF_CONNTRACK=y
-# CONFIG_IP_NF_CT_ACCT is not set
-# CONFIG_IP_NF_CONNTRACK_MARK is not set
-# CONFIG_IP_NF_CONNTRACK_EVENTS is not set
-# CONFIG_IP_NF_CT_PROTO_SCTP is not set
-CONFIG_IP_NF_FTP=m
-# CONFIG_IP_NF_IRC is not set
-# CONFIG_IP_NF_NETBIOS_NS is not set
-# CONFIG_IP_NF_TFTP is not set
-# CONFIG_IP_NF_AMANDA is not set
-CONFIG_IP_NF_PPTP=m
-# CONFIG_IP_NF_H323 is not set
-# CONFIG_IP_NF_SIP is not set
 # CONFIG_IP_NF_QUEUE is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
+# CONFIG_IP_NF_IPTABLES is not set
+# CONFIG_IP_NF_ARPTABLES is not set
 # CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_SCTP is not set
-
-#
-# TIPC Configuration (EXPERIMENTAL)
-#
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
@@ -366,14 +348,7 @@ CONFIG_IP_NF_PPTP=m
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 CONFIG_NET_SCHED=y
-CONFIG_NET_SCH_CLK_JIFFIES=y
-# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
-# CONFIG_NET_SCH_CLK_CPU is not set
 
 #
 # Queueing/Scheduling
@@ -382,6 +357,7 @@ CONFIG_NET_SCH_CBQ=y
 # CONFIG_NET_SCH_HTB is not set
 # CONFIG_NET_SCH_HFSC is not set
 # CONFIG_NET_SCH_PRIO is not set
+# CONFIG_NET_SCH_RR is not set
 # CONFIG_NET_SCH_RED is not set
 # CONFIG_NET_SCH_SFQ is not set
 # CONFIG_NET_SCH_TEQL is not set
@@ -389,7 +365,6 @@ CONFIG_NET_SCH_CBQ=y
 # CONFIG_NET_SCH_GRED is not set
 # CONFIG_NET_SCH_DSMARK is not set
 # CONFIG_NET_SCH_NETEM is not set
-CONFIG_NET_SCH_INGRESS=y
 
 #
 # Classification
@@ -405,20 +380,31 @@ CONFIG_NET_CLS_U32=y
 # CONFIG_CLS_U32_MARK is not set
 # CONFIG_NET_CLS_RSVP is not set
 # CONFIG_NET_CLS_RSVP6 is not set
+# CONFIG_NET_CLS_FLOW is not set
 # CONFIG_NET_EMATCH is not set
 # CONFIG_NET_CLS_ACT is not set
-CONFIG_NET_CLS_POLICE=y
 # CONFIG_NET_CLS_IND is not set
-CONFIG_NET_ESTIMATOR=y
+CONFIG_NET_SCH_FIFO=y
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -427,19 +413,12 @@ CONFIG_NET_ESTIMATOR=y
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 # CONFIG_MTD_CONCAT is not set
@@ -451,12 +430,14 @@ CONFIG_MTD_PARTITIONS=y
 # User Modules And Translation Layers
 #
 CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
 CONFIG_MTD_BLOCK=y
 # CONFIG_FTL is not set
 # CONFIG_NFTL is not set
 # CONFIG_INFTL is not set
 # CONFIG_RFD_FTL is not set
 # CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -482,7 +463,6 @@ CONFIG_MTD_CFI_UTIL=y
 CONFIG_MTD_RAM=y
 # CONFIG_MTD_ROM is not set
 # CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_OBSOLETE_CHIPS is not set
 
 #
 # Mapping drivers for chip access
@@ -505,40 +485,25 @@ CONFIG_MTD_RAM=y
 # CONFIG_MTD_DOC2000 is not set
 # CONFIG_MTD_DOC2001 is not set
 # CONFIG_MTD_DOC2001PLUS is not set
-
-#
-# NAND Flash Device Drivers
-#
 # CONFIG_MTD_NAND is not set
-
-#
-# OneNAND Flash Device Drivers
-#
 # CONFIG_MTD_ONENAND is not set
 
 #
-# Parallel port support
+# UBI - Unsorted block images
 #
+# CONFIG_MTD_UBI is not set
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_COW_COMMON is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_RAM is not set
-# CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-
-#
-# ATA/ATAPI/MFM/RLL support
-#
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -546,104 +511,59 @@ CONFIG_MTD_RAM=y
 #
 # CONFIG_RAID_ATTRS is not set
 # CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
 # CONFIG_SCSI_NETLINK is not set
-
-#
-# Serial ATA (prod) and Parallel ATA (experimental) drivers
-#
 # CONFIG_ATA is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-
-#
-# I2O device support
-#
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-
-#
-# PHY device support
-#
+# CONFIG_VETH is not set
 # CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
 CONFIG_NET_ETHERNET=y
 # CONFIG_MII is not set
+# CONFIG_AX88796 is not set
 # CONFIG_STNIC is not set
 # CONFIG_SMC91X is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_E1000E_ENABLED is not set
+CONFIG_NETDEV_10000=y
 
 #
-# Ethernet (1000 Mbit)
-#
-
-#
-# Ethernet (10000 Mbit)
-#
-
-#
-# Token Ring devices
-#
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Wan interfaces
+# Wireless LAN
 #
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
 # CONFIG_WAN is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
-
-#
-# Telephony Support
-#
 CONFIG_PHONE=y
-# CONFIG_PHONE_IXJ is not set
 
 #
 # Input device support
 #
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
 #
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -653,6 +573,7 @@ CONFIG_INPUT=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
@@ -684,35 +605,11 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_UNIX98_PTYS is not set
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
 CONFIG_HW_RANDOM=y
-# CONFIG_GEN_RTC is not set
-# CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
-
-#
-# Ftape, the floppy tape device driver
-#
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
-# CONFIG_TELCLOCK is not set
-
-#
-# I2C support
-#
 # CONFIG_I2C is not set
 
 #
@@ -720,119 +617,86 @@ CONFIG_HW_RANDOM=y
 #
 # CONFIG_SPI is not set
 # CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+CONFIG_THERMAL=y
+# CONFIG_WATCHDOG is not set
 
 #
-# Dallas's 1-wire bus
-#
-
-#
-# Hardware Monitoring support
+# Sonics Silicon Backplane
 #
-# CONFIG_HWMON is not set
-# CONFIG_HWMON_VID is not set
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
-# Misc devices
+# Multifunction device drivers
 #
+# CONFIG_MFD_SM501 is not set
 
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
-CONFIG_VIDEO_V4L2=y
-
-#
-# Digital Video Broadcasting Devices
-#
-# CONFIG_DVB is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
 
 #
 # Graphics support
 #
-CONFIG_FIRMWARE_EDID=y
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
 # CONFIG_FB is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
-# Sound
+# Display device support
 #
-# CONFIG_SOUND is not set
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
-# USB support
+# Sound
 #
-# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
 # CONFIG_USB_ARCH_HAS_OHCI is not set
 # CONFIG_USB_ARCH_HAS_EHCI is not set
+# CONFIG_USB is not set
 
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
-
-#
-# USB Gadget Support
-#
 # CONFIG_USB_GADGET is not set
-
-#
-# MMC/SD Card support
-#
 # CONFIG_MMC is not set
-
-#
-# LED devices
-#
+# CONFIG_MEMSTICK is not set
 # CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# InfiniBand support
-#
-
-#
-# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
-#
-
-#
-# Real Time Clock
-#
 # CONFIG_RTC_CLASS is not set
 
 #
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
+# Userspace I/O
 #
+# CONFIG_UIO is not set
 
 #
 # File systems
 #
 # CONFIG_EXT2_FS is not set
 # CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
 # CONFIG_FS_POSIX_ACL is not set
 # CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
 # CONFIG_OCFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
+# CONFIG_DNOTIFY is not set
 # CONFIG_INOTIFY is not set
 # CONFIG_QUOTA is not set
-# CONFIG_DNOTIFY is not set
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -861,7 +725,6 @@ CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLBFS is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -874,26 +737,26 @@ CONFIG_RAMFS=y
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_FS_DEBUG=0
 CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
 # CONFIG_JFFS2_SUMMARY is not set
 # CONFIG_JFFS2_FS_XATTR is not set
 # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
 CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
 CONFIG_JFFS2_RTIME=y
 # CONFIG_JFFS2_RUBIN is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 # CONFIG_NFS_FS is not set
 # CONFIG_NFSD is not set
 # CONFIG_SMB_FS is not set
@@ -901,55 +764,97 @@ CONFIG_JFFS2_RTIME=y
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 # CONFIG_NLS is not set
-
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
+# CONFIG_DLM is not set
 
 #
 # Kernel hacking
 #
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
 # CONFIG_DEBUG_KERNEL is not set
-CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_DEBUG_FS is not set
+# CONFIG_SAMPLES is not set
 # CONFIG_SH_STANDARD_BIOS is not set
-# CONFIG_KGDB is not set
+# CONFIG_EARLY_SCIF_CONSOLE is not set
+# CONFIG_SH_KGDB is not set
 
 #
 # Security options
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
-# CONFIG_CRYPTO is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_SEQIV is not set
+# CONFIG_CRYPTO_MANAGER is not set
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_CBC is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_TEST is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_LZO is not set
+CONFIG_CRYPTO_HW=y
 
 #
 # Library routines
 #
+CONFIG_BITREVERSE=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index 80a31329ead9cfb05ff428a00755faefd1889568..75fb03d3567008e733748d2748366ab4fb3d1654 100644 (file)
@@ -233,7 +233,7 @@ static void __init dsp_init(void)
  * and cache configuration in detect_cpu_and_cache_system().
  */
 
-asmlinkage void __cpuinit sh_cpu_init(void)
+asmlinkage void __init sh_cpu_init(void)
 {
        current_thread_info()->cpu = hard_smp_processor_id();
 
index 8250e017bd4eaac43989cfa037be64b4c59688fe..9561b02ade0ef84e0b1a904c0a89891517ef77b2 100644 (file)
@@ -216,7 +216,7 @@ void sq_unmap(unsigned long vaddr)
 
        if (unlikely(!map)) {
                printk("%s: bad store queue address 0x%08lx\n",
-                      __FUNCTION__, vaddr);
+                      __func__, vaddr);
                return;
        }
 
@@ -233,7 +233,7 @@ void sq_unmap(unsigned long vaddr)
                vma = remove_vm_area((void *)(map->sq_addr & PAGE_MASK));
                if (!vma) {
                        printk(KERN_ERR "%s: bad address 0x%08lx\n",
-                              __FUNCTION__, map->sq_addr);
+                              __func__, map->sq_addr);
                        return;
                }
        }
index 119c20afd4e5afb0d9d8803c2d94f2b5747e7d15..b205b25eaf45d6d6b0b791703ee83fe3f9e45f8b 100644 (file)
@@ -149,7 +149,7 @@ static int lookup_prev_stack_frame(unsigned long fp, unsigned long pc,
                        if (dest >= 63) {
                                printk(KERN_NOTICE "%s: Invalid dest reg %d "
                                       "specified in movi handler. Failed "
-                                      "opcode was 0x%lx: ", __FUNCTION__,
+                                      "opcode was 0x%lx: ", __func__,
                                       dest, op);
 
                                continue;
index 86a665d92201ef67ca91349da2bf46d4717edf45..39cd7f3aec7bc34b2139a272c497b2bbf8141276 100644 (file)
@@ -32,7 +32,7 @@ EXPORT_SYMBOL_GPL(trapped_mem);
 #endif
 static DEFINE_SPINLOCK(trapped_lock);
 
-int __init register_trapped_io(struct trapped_io *tiop)
+int register_trapped_io(struct trapped_io *tiop)
 {
        struct resource *res;
        unsigned long len = 0, flags = 0;
index e1a6de9088b5bde648fcae3f8ab0e9fcf89cb158..d80de39032710d094fdb73147eff86466a558ef2 100644 (file)
@@ -111,9 +111,9 @@ DECLARE_EXPORT(__movmem_i4_even);
 DECLARE_EXPORT(__movmem_i4_odd);
 DECLARE_EXPORT(__movmemSI12_i4);
 
-#if (__GNUC_MINOR__ == 2 || defined(__GNUC_STM_RELEASE__))
+#if (__GNUC_MINOR__ >= 2 || defined(__GNUC_STM_RELEASE__))
 /*
- * GCC 4.2 emits these for division, as do GCC 4.1.x versions of the ST
+ * GCC >= 4.2 emits these for division, as do GCC 4.1.x versions of the ST
  * compiler which include backported patches.
  */
 DECLARE_EXPORT(__sdivsi3_i4i);
@@ -146,5 +146,6 @@ EXPORT_SYMBOL(csum_partial_copy_generic);
 EXPORT_SYMBOL(csum_ipv6_magic);
 #endif
 EXPORT_SYMBOL(clear_page);
+EXPORT_SYMBOL(copy_page);
 EXPORT_SYMBOL(__clear_user);
 EXPORT_SYMBOL(_ebss);
index 8004c38d3d37f6ba73b1725f366dc892d7901060..dd38a683de65633d38176de60384dcb3432b5b77 100644 (file)
@@ -42,6 +42,7 @@ EXPORT_SYMBOL(__down_trylock);
 EXPORT_SYMBOL(__up);
 EXPORT_SYMBOL(__put_user_asm_l);
 EXPORT_SYMBOL(__get_user_asm_l);
+EXPORT_SYMBOL(copy_page);
 EXPORT_SYMBOL(__copy_user);
 EXPORT_SYMBOL(memcpy);
 EXPORT_SYMBOL(__udelay);
index 71312324b5defb4383d4760ecfd12f196fd52b7e..d20c8c3758817981549ac4fce5e47d7dafc2ffa7 100644 (file)
@@ -77,7 +77,7 @@ static unsigned long cmt_timer_get_offset(void)
                                count -= LATCH;
                        } else {
                                printk("%s (): hardware timer problem?\n",
-                                      __FUNCTION__);
+                                      __func__);
                        }
                }
        } else
index ade9d6eb29f9e92ce40ab774db506e6e9817d817..fe453c01f9c9d533ab4d3fd5e4e1356c4bba6aa8 100644 (file)
@@ -76,7 +76,7 @@ static unsigned long mtu2_timer_get_offset(void)
                                count -= LATCH;
                        } else {
                                printk("%s (): hardware timer problem?\n",
-                                      __FUNCTION__);
+                                      __func__);
                        }
                }
        } else
index 9b5844a1bdaaa814d951b07da66fb848a9a94e5c..0838942b70837f715634e80d099e9f31b0f99001 100644 (file)
@@ -29,7 +29,7 @@ static int __init topology_init(void)
                ret = register_cpu(&per_cpu(cpu_devices, i), i);
                if (unlikely(ret))
                        printk(KERN_WARNING "%s: register_cpu %d failed (%d)\n",
-                              __FUNCTION__, i, ret);
+                              __func__, i, ret);
        }
 
 #if defined(CONFIG_NUMA) && !defined(CONFIG_SMP)
index a55ac81d795bd393a10caf8b394592815b0a8a01..1b58a749908739d4a3224ee5eb7eef33bc51c565 100644 (file)
@@ -238,7 +238,7 @@ DO_ERROR(12, SIGILL,  "reserved instruction", reserved_inst, current)
 /* Called with interrupts disabled */
 asmlinkage void do_exception_error(unsigned long ex, struct pt_regs *regs)
 {
-       show_excp_regs(__FUNCTION__, -1, -1, regs);
+       show_excp_regs(__func__, -1, -1, regs);
        die_if_kernel("exception", regs, ex);
 }
 
index 5dfbd8b5e5586b9e1c344ff3497e0b3a5cb8e182..5c284e0cff9c66c0fd298de301e173da94d99c97 100644 (file)
@@ -207,7 +207,7 @@ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
        result = (result & 0xffffffff) + (result >> 32);
 
        pr_debug("%s saddr %x daddr %x len %x proto %x sum %x result %08Lx\n",
-               __FUNCTION__, saddr, daddr, len, proto, sum, result);
+               __func__, saddr, daddr, len, proto, sum, result);
 
        return (__wsum)result;
 }
index 23c7d17fb9f7398b842c0c9a0b2a19faa2430930..d76bd801194f538972219b3682e90ed77ffa3cb3 100644 (file)
@@ -21,7 +21,7 @@
  * a 1GHz box, that's about 2 seconds.
  */
 
-void __delay(int loops)
+void __delay(unsigned long loops)
 {
        long long dummy;
        __asm__ __volatile__("gettr     tr0, %1\n\t"
@@ -33,24 +33,17 @@ void __delay(int loops)
                             :"0"(loops));
 }
 
-void __udelay(unsigned long long usecs, unsigned long lpj)
+inline void __const_udelay(unsigned long xloops)
 {
-       usecs *= (((unsigned long long) HZ << 32) / 1000000) * lpj;
-       __delay((long long) usecs >> 32);
+       __delay(xloops * (HZ * cpu_data[raw_smp_processor_id()].loops_per_jiffy));
 }
 
-void __ndelay(unsigned long long nsecs, unsigned long lpj)
+void __udelay(unsigned long usecs)
 {
-       nsecs *= (((unsigned long long) HZ << 32) / 1000000000) * lpj;
-       __delay((long long) nsecs >> 32);
+       __const_udelay(usecs * 0x000010c6);  /* 2**32 / 1000000 */
 }
 
-void udelay(unsigned long usecs)
+void __ndelay(unsigned long nsecs)
 {
-       __udelay(usecs, cpu_data[raw_smp_processor_id()].loops_per_jiffy);
-}
-
-void ndelay(unsigned long nsecs)
-{
-       __ndelay(nsecs, cpu_data[raw_smp_processor_id()].loops_per_jiffy);
+       __const_udelay(nsecs * 0x00000005);
 }
index f549b8cd25010c74fd3dbdfe054ec81e410ab1cc..5fd218430b19a9e1b91fc17c6f75d4650cf40142 100644 (file)
@@ -59,7 +59,7 @@ config 32BIT
 
 config PMB
        bool "Support 32-bit physical addressing through PMB"
-       depends on MMU && (CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785)
+       depends on MMU && EXPERIMENTAL && (CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785)
        select 32BIT
        default y
        help
index e2ed6dd252b9f1ca71c9c566ec2978897d3ba6d0..53dde06073627d693d431fd308e6c647d87da30e 100644 (file)
@@ -328,7 +328,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
        /* We only have ZONE_NORMAL, so this is easy.. */
        ret = __add_pages(pgdat->node_zones + ZONE_NORMAL, start_pfn, nr_pages);
        if (unlikely(ret))
-               printk("%s: Failed, __add_pages() == %d\n", __FUNCTION__, ret);
+               printk("%s: Failed, __add_pages() == %d\n", __func__, ret);
 
        return ret;
 }
index 0c7b7e33abdcfd6e2ddf242623683d3ee89d7b6c..882a32ebc6b7c593c303a4d711cce5ae03001222 100644 (file)
@@ -141,7 +141,7 @@ void __iounmap(void __iomem *addr)
 
        p = remove_vm_area((void *)(vaddr & PAGE_MASK));
        if (!p) {
-               printk(KERN_ERR "%s: bad address %p\n", __FUNCTION__, addr);
+               printk(KERN_ERR "%s: bad address %p\n", __func__, addr);
                return;
        }
 
index e27d165192354cda7d827b5a11ecac3207c9d802..cea224c3e49b6049b54edd6d5a6e782a02728dc2 100644 (file)
@@ -178,7 +178,7 @@ static unsigned long shmedia_alloc_io(unsigned long phys, unsigned long size,
         } else {
                 if (!printed_full) {
                         printk("%s: done with statics, switching to kmalloc\n",
-                              __FUNCTION__);
+                              __func__);
                         printed_full = 1;
                 }
                 tlen = strlen(name);
@@ -352,7 +352,7 @@ void onchip_unmap(unsigned long vaddr)
        res = shmedia_find_resource(&shmedia_iomap, vaddr);
        if (!res) {
                printk(KERN_ERR "%s: Failed to free 0x%08lx\n",
-                      __FUNCTION__, vaddr);
+                      __func__, vaddr);
                return;
        }
 
index a4b015f95a3ad379b69e9f2bffe13bcce3aa1450..7f885b7f8afffa36a4bac0d73e4180aeecf04ded 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/mman.h>
 #include <linux/mm.h>
 #include <linux/threads.h>
+#include <linux/fs.h>
 #include <asm/addrspace.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
index 2a98c9ec88ff49c48d919aa696f8700b72901dcf..7876997ba19a829f50941757ba6807bd93d3b3d4 100644 (file)
@@ -131,7 +131,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
 #ifdef DEBUG_FAULT
                print_task(tsk);
                printk("%s:%d fault, address is 0x%08x PC %016Lx textaccess %d writeaccess %d\n",
-                      __FUNCTION__,__LINE__,
+                      __func__, __LINE__,
                       address,regs->pc,textaccess,writeaccess);
                show_regs(regs);
 #endif
@@ -145,7 +145,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
 #ifdef DEBUG_FAULT
                print_task(tsk);
                printk("%s:%d fault, address is 0x%08x PC %016Lx textaccess %d writeaccess %d\n",
-                      __FUNCTION__,__LINE__,
+                      __func__, __LINE__,
                       address,regs->pc,textaccess,writeaccess);
                show_regs(regs);
 
@@ -157,7 +157,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
 #ifdef DEBUG_FAULT
                print_task(tsk);
                printk("%s:%d fault, address is 0x%08x PC %016Lx textaccess %d writeaccess %d\n",
-                      __FUNCTION__,__LINE__,
+                      __func__, __LINE__,
                       address,regs->pc,textaccess,writeaccess);
                show_regs(regs);
 #endif
index 67997af25c0c3fa0b7a68d919aee59d956618dcf..d63b93da952d4e0eafa9e6df984bccdb6517881b 100644 (file)
@@ -38,7 +38,6 @@ R7780MP                       SH_R7780MP
 R7785RP                        SH_R7785RP
 TITAN                  SH_TITAN
 SHMIN                  SH_SHMIN
-7710VOIPGW             SH_7710VOIPGW
 LBOXRE2                        SH_LBOX_RE2
 X3PROTO                        SH_X3PROTO
 MAGICPANELR2           SH_MAGIC_PANEL_R2
index e795f282dece9f29d6914bc639ffb0c73da5d9f9..bf1b15d3f6f58be2265f1d6e13a0bbf22c9c0862 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.62 2000/12/15 00:41:17 davem Exp $
+#
 # Makefile for the linux kernel.
 #
 
@@ -12,7 +12,8 @@ obj-y    := entry.o wof.o wuf.o etrap.o rtrap.o traps.o $(IRQ_OBJS) \
            sys_sparc.o sunos_asm.o systbls.o \
            time.o windows.o cpu.o devices.o sclow.o \
            tadpole.o tick14.o ptrace.o sys_solaris.o \
-           unaligned.o muldiv.o semaphore.o prom.o of_device.o devres.o
+           unaligned.o una_asm.o muldiv.o semaphore.o \
+           prom.o of_device.o devres.o
 
 devres-y = ../../../kernel/irq/devres.o
 
index 259a559d4cea120fb2beb13ad808ef1f152056f8..e7a0edfc1a32532823d315a78deb6f1585a35502 100644 (file)
@@ -32,7 +32,7 @@ struct cpu_fp_info {
 /* In order to get the fpu type correct, you need to take the IDPROM's
  * machine type value into consideration too.  I will fix this.
  */
-struct cpu_fp_info linux_sparc_fpu[] = {
+static struct cpu_fp_info linux_sparc_fpu[] = {
   { 0, 0, "Fujitsu MB86910 or Weitek WTL1164/5"},
   { 0, 1, "Fujitsu MB86911 or Weitek WTL1164/5 or LSI L64831"},
   { 0, 2, "LSI Logic L64802 or Texas Instruments ACT8847"},
@@ -76,7 +76,7 @@ struct cpu_fp_info linux_sparc_fpu[] = {
 
 #define NSPARCFPU  ARRAY_SIZE(linux_sparc_fpu)
 
-struct cpu_iu_info linux_sparc_chips[] = {
+static struct cpu_iu_info linux_sparc_chips[] = {
   /* Sun4/100, 4/200, SLC */
   { 0, 0, "Fujitsu  MB86900/1A or LSI L64831 SparcKIT-40"},
   /* borned STP1012PGA */
index d850785b20808716b5d843af7877712db1b9dc7d..96344ff2bbe165aff131a8d9f982286f8804e136 100644 (file)
@@ -101,7 +101,7 @@ void __init fill_ebus_child(struct device_node *dp,
                        prom_printf("UGH: property for %s was %d, need < %d\n",
                                    dev->prom_node->name, len,
                                    dev->parent->num_addrs);
-                       panic(__FUNCTION__);
+                       panic(__func__);
                }
 
                /* XXX resource */
@@ -162,7 +162,7 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d
                prom_printf("UGH: proplen for %s was %d, need multiple of %d\n",
                            dev->prom_node->name, len,
                            (int)sizeof(struct linux_prom_registers));
-               panic(__FUNCTION__);
+               panic(__func__);
        }
        dev->num_addrs = len / sizeof(struct linux_prom_registers);
 
@@ -324,7 +324,7 @@ void __init ebus_init(void)
                regs = of_get_property(dp, "reg", &len);
                if (!regs) {
                        prom_printf("%s: can't find reg property\n",
-                                   __FUNCTION__);
+                                   __func__);
                        prom_halt();
                }
                nreg = len / sizeof(struct linux_prom_pci_registers);
index 0bd69d0b5cd7f75ee293d06ff4ab3c81a0ec48dd..70c0dd22491d2a5e4d3e4aaf1ebdc72ec7ca855f 100644 (file)
@@ -139,8 +139,6 @@ void cpu_idle(void)
 
 #endif
 
-extern char reboot_command [];
-
 /* XXX cli/sti -> local_irq_xxx here, check this works once SMP is fixed. */
 void machine_halt(void)
 {
diff --git a/arch/sparc/kernel/una_asm.S b/arch/sparc/kernel/una_asm.S
new file mode 100644 (file)
index 0000000..8cc0345
--- /dev/null
@@ -0,0 +1,153 @@
+/* una_asm.S: Kernel unaligned trap assembler helpers.
+ *
+ * Copyright (C) 1996,2005,2008 David S. Miller (davem@davemloft.net)
+ * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
+ */
+
+#include <linux/errno.h>
+
+       .text
+
+retl_efault:
+       retl
+        mov    -EFAULT, %o0
+
+       /* int __do_int_store(unsigned long *dst_addr, int size,
+        *                    unsigned long *src_val)
+        *
+        * %o0 = dest_addr
+        * %o1 = size
+        * %o2 = src_val
+        *
+        * Return '0' on success, -EFAULT on failure.
+        */
+       .globl  __do_int_store
+__do_int_store:
+       ld      [%o2], %g1
+       cmp     %1, 2
+       be      2f
+        cmp    %1, 4
+       be      1f
+        srl    %g1, 24, %g2
+       srl     %g1, 16, %g7
+4:     stb     %g2, [%o0]
+       srl     %g1, 8, %g2
+5:     stb     %g7, [%o0 + 1]
+       ld      [%o2 + 4], %g7
+6:     stb     %g2, [%o0 + 2]
+       srl     %g7, 24, %g2
+7:     stb     %g1, [%o0 + 3]
+       srl     %g7, 16, %g1
+8:     stb     %g2, [%o0 + 4]
+       srl     %g7, 8, %g2
+9:     stb     %g1, [%o0 + 5]
+10:    stb     %g2, [%o0 + 6]
+       b       0f
+11:     stb    %g7, [%o0 + 7]
+1:     srl     %g1, 16, %g7
+12:    stb     %g2, [%o0]
+       srl     %g1, 8, %g2
+13:    stb     %g7, [%o0 + 1]
+14:    stb     %g2, [%o0 + 2]
+       b       0f
+15:     stb    %g1, [%o0 + 3]
+2:     srl     %g1, 8, %g2
+16:    stb     %g2, [%o0]
+17:    stb     %g1, [%o0 + 1]
+0:     retl
+        mov    0, %o0
+
+       .section __ex_table,#alloc
+       .word   4b, retl_efault
+       .word   5b, retl_efault
+       .word   6b, retl_efault
+       .word   7b, retl_efault
+       .word   8b, retl_efault
+       .word   9b, retl_efault
+       .word   10b, retl_efault
+       .word   11b, retl_efault
+       .word   12b, retl_efault
+       .word   13b, retl_efault
+       .word   14b, retl_efault
+       .word   15b, retl_efault
+       .word   16b, retl_efault
+       .word   17b, retl_efault
+       .previous
+
+       /* int do_int_load(unsigned long *dest_reg, int size,
+        *                 unsigned long *saddr, int is_signed)
+        *
+        * %o0 = dest_reg
+        * %o1 = size
+        * %o2 = saddr
+        * %o3 = is_signed
+        *
+        * Return '0' on success, -EFAULT on failure.
+        */
+       .globl  do_int_load
+do_int_load:
+       cmp     %o1, 8
+       be      9f
+        cmp    %o1, 4
+       be      6f
+4:      ldub   [%o2], %g1
+5:     ldub    [%o2 + 1], %g2
+       sll     %g1, 8, %g1
+       tst     %o3
+       be      3f
+        or     %g1, %g2, %g1
+       sll     %g1, 16, %g1
+       sra     %g1, 16, %g1
+3:     b       0f
+        st     %g1, [%o0]
+6:     ldub    [%o2 + 1], %g2
+       sll     %g1, 24, %g1
+7:     ldub    [%o2 + 2], %g7
+       sll     %g2, 16, %g2
+8:     ldub    [%o2 + 3], %g3
+       sll     %g7, 8, %g7
+       or      %g3, %g2, %g3
+       or      %g7, %g3, %g7
+       or      %g1, %g7, %g1
+       b       0f
+        st     %g1, [%o0]
+9:     ldub    [%o2], %g1
+10:    ldub    [%o2 + 1], %g2
+       sll     %g1, 24, %g1
+11:    ldub    [%o2 + 2], %g7
+       sll     %g2, 16, %g2
+12:    ldub    [%o2 + 3], %g3
+       sll     %g7, 8, %g7
+       or      %g1, %g2, %g1
+       or      %g7, %g3, %g7
+       or      %g1, %g7, %g7
+13:    ldub    [%o2 + 4], %g1
+       st      %g7, [%o0]
+14:    ldub    [%o2 + 5], %g2
+       sll     %g1, 24, %g1
+15:    ldub    [%o2 + 6], %g7
+       sll     %g2, 16, %g2
+16:    ldub    [%o2 + 7], %g3
+       sll     %g7, 8, %g7
+       or      %g1, %g2, %g1
+       or      %g7, %g3, %g7
+       or      %g1, %g7, %g7
+       st      %g7, [%o0 + 4]
+0:     retl
+        mov    0, %o0
+
+       .section __ex_table,#alloc
+       .word   4b, retl_efault
+       .word   5b, retl_efault
+       .word   6b, retl_efault
+       .word   7b, retl_efault
+       .word   8b, retl_efault
+       .word   9b, retl_efault
+       .word   10b, retl_efault
+       .word   11b, retl_efault
+       .word   12b, retl_efault
+       .word   13b, retl_efault
+       .word   14b, retl_efault
+       .word   15b, retl_efault
+       .word   16b, retl_efault
+       .previous
index a6330fbc9dd935a805aa7b9f05f12dbfe605579a..33857be16661a53e7b2c1741eb51ab02a5fee020 100644 (file)
@@ -175,157 +175,31 @@ static void unaligned_panic(char *str)
        panic(str);
 }
 
-#define do_integer_load(dest_reg, size, saddr, is_signed, errh) ({             \
-__asm__ __volatile__ (                                                         \
-       "cmp    %1, 8\n\t"                                                      \
-       "be     9f\n\t"                                                         \
-       " cmp   %1, 4\n\t"                                                      \
-       "be     6f\n"                                                           \
-"4:\t" " ldub  [%2], %%l1\n"                                                   \
-"5:\t" "ldub   [%2 + 1], %%l2\n\t"                                             \
-       "sll    %%l1, 8, %%l1\n\t"                                              \
-       "tst    %3\n\t"                                                         \
-       "be     3f\n\t"                                                         \
-       " add   %%l1, %%l2, %%l1\n\t"                                           \
-       "sll    %%l1, 16, %%l1\n\t"                                             \
-       "sra    %%l1, 16, %%l1\n"                                               \
-"3:\t" "b      0f\n\t"                                                         \
-       " st    %%l1, [%0]\n"                                                   \
-"6:\t" "ldub   [%2 + 1], %%l2\n\t"                                             \
-       "sll    %%l1, 24, %%l1\n"                                               \
-"7:\t" "ldub   [%2 + 2], %%g7\n\t"                                             \
-       "sll    %%l2, 16, %%l2\n"                                               \
-"8:\t" "ldub   [%2 + 3], %%g1\n\t"                                             \
-       "sll    %%g7, 8, %%g7\n\t"                                              \
-       "or     %%l1, %%l2, %%l1\n\t"                                           \
-       "or     %%g7, %%g1, %%g7\n\t"                                           \
-       "or     %%l1, %%g7, %%l1\n\t"                                           \
-       "b      0f\n\t"                                                         \
-       " st    %%l1, [%0]\n"                                                   \
-"9:\t" "ldub   [%2], %%l1\n"                                                   \
-"10:\t"        "ldub   [%2 + 1], %%l2\n\t"                                             \
-       "sll    %%l1, 24, %%l1\n"                                               \
-"11:\t"        "ldub   [%2 + 2], %%g7\n\t"                                             \
-       "sll    %%l2, 16, %%l2\n"                                               \
-"12:\t"        "ldub   [%2 + 3], %%g1\n\t"                                             \
-       "sll    %%g7, 8, %%g7\n\t"                                              \
-       "or     %%l1, %%l2, %%l1\n\t"                                           \
-       "or     %%g7, %%g1, %%g7\n\t"                                           \
-       "or     %%l1, %%g7, %%g7\n"                                             \
-"13:\t"        "ldub   [%2 + 4], %%l1\n\t"                                             \
-       "st     %%g7, [%0]\n"                                                   \
-"14:\t"        "ldub   [%2 + 5], %%l2\n\t"                                             \
-       "sll    %%l1, 24, %%l1\n"                                               \
-"15:\t"        "ldub   [%2 + 6], %%g7\n\t"                                             \
-       "sll    %%l2, 16, %%l2\n"                                               \
-"16:\t"        "ldub   [%2 + 7], %%g1\n\t"                                             \
-       "sll    %%g7, 8, %%g7\n\t"                                              \
-       "or     %%l1, %%l2, %%l1\n\t"                                           \
-       "or     %%g7, %%g1, %%g7\n\t"                                           \
-       "or     %%l1, %%g7, %%g7\n\t"                                           \
-       "st     %%g7, [%0 + 4]\n"                                               \
-"0:\n\n\t"                                                                     \
-       ".section __ex_table,#alloc\n\t"                                        \
-       ".word  4b, " #errh "\n\t"                                              \
-       ".word  5b, " #errh "\n\t"                                              \
-       ".word  6b, " #errh "\n\t"                                              \
-       ".word  7b, " #errh "\n\t"                                              \
-       ".word  8b, " #errh "\n\t"                                              \
-       ".word  9b, " #errh "\n\t"                                              \
-       ".word  10b, " #errh "\n\t"                                             \
-       ".word  11b, " #errh "\n\t"                                             \
-       ".word  12b, " #errh "\n\t"                                             \
-       ".word  13b, " #errh "\n\t"                                             \
-       ".word  14b, " #errh "\n\t"                                             \
-       ".word  15b, " #errh "\n\t"                                             \
-       ".word  16b, " #errh "\n\n\t"                                           \
-       ".previous\n\t"                                                         \
-       : : "r" (dest_reg), "r" (size), "r" (saddr), "r" (is_signed)            \
-       : "l1", "l2", "g7", "g1", "cc");                                        \
-})
-       
-#define store_common(dst_addr, size, src_val, errh) ({                         \
-__asm__ __volatile__ (                                                         \
-       "ld     [%2], %%l1\n"                                                   \
-       "cmp    %1, 2\n\t"                                                      \
-       "be     2f\n\t"                                                         \
-       " cmp   %1, 4\n\t"                                                      \
-       "be     1f\n\t"                                                         \
-       " srl   %%l1, 24, %%l2\n\t"                                             \
-       "srl    %%l1, 16, %%g7\n"                                               \
-"4:\t" "stb    %%l2, [%0]\n\t"                                                 \
-       "srl    %%l1, 8, %%l2\n"                                                \
-"5:\t" "stb    %%g7, [%0 + 1]\n\t"                                             \
-       "ld     [%2 + 4], %%g7\n"                                               \
-"6:\t" "stb    %%l2, [%0 + 2]\n\t"                                             \
-       "srl    %%g7, 24, %%l2\n"                                               \
-"7:\t" "stb    %%l1, [%0 + 3]\n\t"                                             \
-       "srl    %%g7, 16, %%l1\n"                                               \
-"8:\t" "stb    %%l2, [%0 + 4]\n\t"                                             \
-       "srl    %%g7, 8, %%l2\n"                                                \
-"9:\t" "stb    %%l1, [%0 + 5]\n"                                               \
-"10:\t"        "stb    %%l2, [%0 + 6]\n\t"                                             \
-       "b      0f\n"                                                           \
-"11:\t"        " stb   %%g7, [%0 + 7]\n"                                               \
-"1:\t" "srl    %%l1, 16, %%g7\n"                                               \
-"12:\t"        "stb    %%l2, [%0]\n\t"                                                 \
-       "srl    %%l1, 8, %%l2\n"                                                \
-"13:\t"        "stb    %%g7, [%0 + 1]\n"                                               \
-"14:\t"        "stb    %%l2, [%0 + 2]\n\t"                                             \
-       "b      0f\n"                                                           \
-"15:\t"        " stb   %%l1, [%0 + 3]\n"                                               \
-"2:\t" "srl    %%l1, 8, %%l2\n"                                                \
-"16:\t"        "stb    %%l2, [%0]\n"                                                   \
-"17:\t"        "stb    %%l1, [%0 + 1]\n"                                               \
-"0:\n\n\t"                                                                     \
-       ".section __ex_table,#alloc\n\t"                                        \
-       ".word  4b, " #errh "\n\t"                                              \
-       ".word  5b, " #errh "\n\t"                                              \
-       ".word  6b, " #errh "\n\t"                                              \
-       ".word  7b, " #errh "\n\t"                                              \
-       ".word  8b, " #errh "\n\t"                                              \
-       ".word  9b, " #errh "\n\t"                                              \
-       ".word  10b, " #errh "\n\t"                                             \
-       ".word  11b, " #errh "\n\t"                                             \
-       ".word  12b, " #errh "\n\t"                                             \
-       ".word  13b, " #errh "\n\t"                                             \
-       ".word  14b, " #errh "\n\t"                                             \
-       ".word  15b, " #errh "\n\t"                                             \
-       ".word  16b, " #errh "\n\t"                                             \
-       ".word  17b, " #errh "\n\n\t"                                           \
-       ".previous\n\t"                                                         \
-       : : "r" (dst_addr), "r" (size), "r" (src_val)                           \
-       : "l1", "l2", "g7", "g1", "cc");                                        \
-})
-
-#define do_integer_store(reg_num, size, dst_addr, regs, errh) ({               \
-       unsigned long *src_val;                                                 \
-       static unsigned long zero[2] = { 0, };                                  \
-                                                                               \
-       if (reg_num) src_val = fetch_reg_addr(reg_num, regs);                   \
-       else {                                                                  \
-               src_val = &zero[0];                                             \
-               if (size == 8)                                                  \
-                       zero[1] = fetch_reg(1, regs);                           \
-       }                                                                       \
-       store_common(dst_addr, size, src_val, errh);                            \
-})
+/* una_asm.S */
+extern int do_int_load(unsigned long *dest_reg, int size,
+                      unsigned long *saddr, int is_signed);
+extern int __do_int_store(unsigned long *dst_addr, int size,
+                         unsigned long *src_val);
+
+static int do_int_store(int reg_num, int size, unsigned long *dst_addr,
+                       struct pt_regs *regs)
+{
+       unsigned long zero[2] = { 0, 0 };
+       unsigned long *src_val;
+
+       if (reg_num)
+               src_val = fetch_reg_addr(reg_num, regs);
+       else {
+               src_val = &zero[0];
+               if (size == 8)
+                       zero[1] = fetch_reg(1, regs);
+       }
+       return __do_int_store(dst_addr, size, src_val);
+}
 
 extern void smp_capture(void);
 extern void smp_release(void);
 
-#define do_atomic(srcdest_reg, mem, errh) ({                                   \
-       unsigned long flags, tmp;                                               \
-                                                                               \
-       smp_capture();                                                          \
-       local_irq_save(flags);                                                  \
-       tmp = *srcdest_reg;                                                     \
-       do_integer_load(srcdest_reg, 4, mem, 0, errh);                          \
-       store_common(mem, 4, &tmp, errh);                                       \
-       local_irq_restore(flags);                                               \
-       smp_release();                                                          \
-})
-
 static inline void advance(struct pt_regs *regs)
 {
        regs->pc   = regs->npc;
@@ -342,9 +216,7 @@ static inline int ok_for_kernel(unsigned int insn)
        return !floating_point_load_or_store_p(insn);
 }
 
-void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("kernel_mna_trap_fault");
-
-void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
+static void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
 {
        unsigned long g2 = regs->u_regs [UREG_G2];
        unsigned long fixup = search_extables_range(regs->pc, &g2);
@@ -379,48 +251,34 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)
                printk("Unsupported unaligned load/store trap for kernel at <%08lx>.\n",
                       regs->pc);
                unaligned_panic("Wheee. Kernel does fpu/atomic unaligned load/store.");
-
-               __asm__ __volatile__ ("\n"
-"kernel_unaligned_trap_fault:\n\t"
-               "mov    %0, %%o0\n\t"
-               "call   kernel_mna_trap_fault\n\t"
-               " mov   %1, %%o1\n\t"
-               :
-               : "r" (regs), "r" (insn)
-               : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
-                 "g1", "g2", "g3", "g4", "g5", "g7", "cc");
        } else {
                unsigned long addr = compute_effective_address(regs, insn);
+               int err;
 
 #ifdef DEBUG_MNA
                printk("KMNA: pc=%08lx [dir=%s addr=%08lx size=%d] retpc[%08lx]\n",
                       regs->pc, dirstrings[dir], addr, size, regs->u_regs[UREG_RETPC]);
 #endif
-               switch(dir) {
+               switch (dir) {
                case load:
-                       do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
-                                       size, (unsigned long *) addr,
-                                       decode_signedness(insn),
-                                       kernel_unaligned_trap_fault);
+                       err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),
+                                                        regs),
+                                         size, (unsigned long *) addr,
+                                         decode_signedness(insn));
                        break;
 
                case store:
-                       do_integer_store(((insn>>25)&0x1f), size,
-                                        (unsigned long *) addr, regs,
-                                        kernel_unaligned_trap_fault);
+                       err = do_int_store(((insn>>25)&0x1f), size,
+                                          (unsigned long *) addr, regs);
                        break;
-#if 0 /* unsupported */
-               case both:
-                       do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs),
-                                 (unsigned long *) addr,
-                                 kernel_unaligned_trap_fault);
-                       break;
-#endif
                default:
                        panic("Impossible kernel unaligned trap.");
                        /* Not reached... */
                }
-               advance(regs);
+               if (err)
+                       kernel_mna_trap_fault(regs, insn);
+               else
+                       advance(regs);
        }
 }
 
@@ -459,9 +317,7 @@ static inline int ok_for_user(struct pt_regs *regs, unsigned int insn,
        return 0;
 }
 
-void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("user_mna_trap_fault");
-
-void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
+static void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
 {
        siginfo_t info;
 
@@ -485,7 +341,7 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)
        if(!ok_for_user(regs, insn, dir)) {
                goto kill_user;
        } else {
-               int size = decode_access_size(insn);
+               int err, size = decode_access_size(insn);
                unsigned long addr;
 
                if(floating_point_load_or_store_p(insn)) {
@@ -496,48 +352,34 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)
                addr = compute_effective_address(regs, insn);
                switch(dir) {
                case load:
-                       do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
-                                       size, (unsigned long *) addr,
-                                       decode_signedness(insn),
-                                       user_unaligned_trap_fault);
+                       err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),
+                                                        regs),
+                                         size, (unsigned long *) addr,
+                                         decode_signedness(insn));
                        break;
 
                case store:
-                       do_integer_store(((insn>>25)&0x1f), size,
-                                        (unsigned long *) addr, regs,
-                                        user_unaligned_trap_fault);
+                       err = do_int_store(((insn>>25)&0x1f), size,
+                                          (unsigned long *) addr, regs);
                        break;
 
                case both:
-#if 0 /* unsupported */
-                       do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs),
-                                 (unsigned long *) addr,
-                                 user_unaligned_trap_fault);
-#else
                        /*
                         * This was supported in 2.4. However, we question
                         * the value of SWAP instruction across word boundaries.
                         */
                        printk("Unaligned SWAP unsupported.\n");
-                       goto kill_user;
-#endif
+                       err = -EFAULT;
                        break;
 
                default:
                        unaligned_panic("Impossible user unaligned trap.");
-
-                       __asm__ __volatile__ ("\n"
-"user_unaligned_trap_fault:\n\t"
-                       "mov    %0, %%o0\n\t"
-                       "call   user_mna_trap_fault\n\t"
-                       " mov   %1, %%o1\n\t"
-                       :
-                       : "r" (regs), "r" (insn)
-                       : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
-                         "g1", "g2", "g3", "g4", "g5", "g7", "cc");
                        goto out;
                }
-               advance(regs);
+               if (err)
+                       goto kill_user;
+               else
+                       advance(regs);
                goto out;
        }
 
index 3af378ddb6ae8008db5619074414b489165370a6..463d1be32c98614cea3fc98cb31154895a5858eb 100644 (file)
@@ -10,6 +10,7 @@ config SPARC
        default y
        select HAVE_OPROFILE
        select HAVE_KPROBES
+       select HAVE_KRETPROBES
 
 config SPARC64
        bool
index e43db73f2b911151b1e0194b5a7595c8945474b9..dd5d28e3d79899df97342266e79c1372a9c79707 100644 (file)
@@ -30,7 +30,7 @@ struct cpu_fp_info {
   char* fp_name;
 };
 
-struct cpu_fp_info linux_sparc_fpu[] = {
+static struct cpu_fp_info linux_sparc_fpu[] = {
   { 0x17, 0x10, 0, "UltraSparc I integrated FPU"},
   { 0x22, 0x10, 0, "UltraSparc I integrated FPU"},
   { 0x17, 0x11, 0, "UltraSparc II integrated FPU"},
@@ -46,7 +46,7 @@ struct cpu_fp_info linux_sparc_fpu[] = {
 
 #define NSPARCFPU  ARRAY_SIZE(linux_sparc_fpu)
 
-struct cpu_iu_info linux_sparc_chips[] = {
+static struct cpu_iu_info linux_sparc_chips[] = {
   { 0x17, 0x10, "TI UltraSparc I   (SpitFire)"},
   { 0x22, 0x10, "TI UltraSparc I   (SpitFire)"},
   { 0x17, 0x11, "TI UltraSparc II  (BlackBird)"},
index 2aafce7dfc0ecf31b42ba94f422032208553220e..e116e38b160ec3cd9a9b8a5aaecfef2ff2d659db 100644 (file)
@@ -114,8 +114,6 @@ void cpu_idle(void)
        }
 }
 
-extern char reboot_command [];
-
 void machine_halt(void)
 {
        sstate_halt();
index 5faf59a9de399e33eb6a07592b768b5904658bca..50e58232cf2b014c128ee9148761c121f947e11b 100644 (file)
@@ -28,7 +28,7 @@ extern unsigned sunos_sys_table[];
 #define SUNOS(x) ((long)sunos_sys_table[x])
 
 #ifdef DEBUG_SOLARIS
-#define SOLD(s) printk("%s,%d,%s(): %s\n",__FILE__,__LINE__,__FUNCTION__,(s))
+#define SOLD(s) printk("%s,%d,%s(): %s\n",__FILE__,__LINE__,__func__,(s))
 #define SOLDD(s) printk("solaris: "); printk s
 #else
 #define SOLD(s)
index f53123c02c2b6b76f9b687bd1f675753d1342633..15234fcd191a209041a6dd6712cdfae9c7fd3000 100644 (file)
@@ -81,7 +81,7 @@ void mykfree(void *p)
 #define MKCTL_MAGIC    0xDEADBABEBADC0DEDL
 #define PUT_MAGIC(a,m) do{(*(u64*)(a))=(m);}while(0)
 #define SCHECK_MAGIC(a,m)      do{if((*(u64*)(a))!=(m))printk("%s,%u,%s(): magic %08x at %p corrupted!\n",\
-                               __FILE__,__LINE__,__FUNCTION__,(m),(a));}while(0)
+                               __FILE__,__LINE__,__func__,(m),(a));}while(0)
 #define BUF_OFFSET     sizeof(u64)
 #define MKCTL_TRAILER  sizeof(u64)
 
index 4a88cf7695b418927c61ce760259db85bbd68cfe..f41c9538ca303f2fdb5b231cc9c9592b72024e23 100644 (file)
@@ -21,7 +21,8 @@ config X86
        select HAVE_IDE
        select HAVE_OPROFILE
        select HAVE_KPROBES
-       select HAVE_KVM
+       select HAVE_KRETPROBES
+       select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
 
 
 config GENERIC_LOCKBREAK
index 6d50064db182303dd27402b2e6c1c84d4502971b..9304bfba7d450fae5dc61ffa627a49fe1fdfeae6 100644 (file)
@@ -388,7 +388,7 @@ config X86_OOSTORE
 #
 config X86_P6_NOP
        def_bool y
-       depends on (X86_64 || !X86_GENERIC) && (M686 || MPENTIUMII || MPENTIUMIII || MPENTIUMM || MCORE2 || PENTIUM4)
+       depends on (X86_64 || !X86_GENERIC) && (M686 || MPENTIUMII || MPENTIUMIII || MPENTIUMM || MCORE2 || MPENTIUM4)
 
 config X86_TSC
        def_bool y
index 39f8cb18296c68fc74fa999a195f0d1fa20a9787..c2f930d8664091932c1a7b614d860f8f365b7f10 100644 (file)
@@ -55,7 +55,6 @@ static int eps_set_state(struct eps_cpu_data *centaur,
 {
        struct cpufreq_freqs freqs;
        u32 lo, hi;
-       u8 current_multiplier, current_voltage;
        int err = 0;
        int i;
 
@@ -95,6 +94,10 @@ postchange:
        rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
        freqs.new = centaur->fsb * ((lo >> 8) & 0xff);
 
+#ifdef DEBUG
+       {
+       u8 current_multiplier, current_voltage;
+
        /* Print voltage and multiplier */
        rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
        current_voltage = lo & 0xff;
@@ -103,7 +106,8 @@ postchange:
        current_multiplier = (lo >> 8) & 0xff;
        printk(KERN_INFO "eps: Current multiplier = %d\n",
                current_multiplier);
-
+       }
+#endif
        cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
        return err;
 }
index 763dfc407232b0133750f3f61898a120f0685ebc..60fe8015756961fa44851f7ad5d701337e4c9a87 100644 (file)
@@ -132,7 +132,7 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
        if (!cpu_has_fxsr)
                return -ENODEV;
 
-       unlazy_fpu(target);
+       init_fpu(target);
 
        return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
                                   &target->thread.i387.fxsave, 0, -1);
@@ -147,7 +147,7 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
        if (!cpu_has_fxsr)
                return -ENODEV;
 
-       unlazy_fpu(target);
+       init_fpu(target);
        set_stopped_child_used_math(target);
 
        ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
@@ -307,7 +307,7 @@ int fpregs_get(struct task_struct *target, const struct user_regset *regset,
        if (!HAVE_HWFP)
                return fpregs_soft_get(target, regset, pos, count, kbuf, ubuf);
 
-       unlazy_fpu(target);
+       init_fpu(target);
 
        if (!cpu_has_fxsr)
                return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
@@ -332,7 +332,7 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
        if (!HAVE_HWFP)
                return fpregs_soft_set(target, regset, pos, count, kbuf, ubuf);
 
-       unlazy_fpu(target);
+       init_fpu(target);
        set_stopped_child_used_math(target);
 
        if (!cpu_has_fxsr)
index 2cbee9479ce423850a99df39290e3efbbe51ae48..68a6b1511934760e97117080166f78b9a7d5ab72 100644 (file)
@@ -647,6 +647,10 @@ static void start_apic_timer(struct kvm_lapic *apic)
        apic->timer.period = apic_get_reg(apic, APIC_TMICT) *
                    APIC_BUS_CYCLE_NS * apic->timer.divide_count;
        atomic_set(&apic->timer.pending, 0);
+
+       if (!apic->timer.period)
+               return;
+
        hrtimer_start(&apic->timer.dev,
                      ktime_add_ns(now, apic->timer.period),
                      HRTIMER_MODE_ABS);
index 8efdcdbebb0356483816de769856fd57c20944ea..d8172aabc660de7503c43b697fea470d81f7eb9a 100644 (file)
@@ -681,8 +681,7 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
                                             unsigned level,
                                             int metaphysical,
                                             unsigned access,
-                                            u64 *parent_pte,
-                                            bool *new_page)
+                                            u64 *parent_pte)
 {
        union kvm_mmu_page_role role;
        unsigned index;
@@ -722,8 +721,6 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
        vcpu->arch.mmu.prefetch_page(vcpu, sp);
        if (!metaphysical)
                rmap_write_protect(vcpu->kvm, gfn);
-       if (new_page)
-               *new_page = 1;
        return sp;
 }
 
@@ -876,11 +873,18 @@ static void page_header_update_slot(struct kvm *kvm, void *pte, gfn_t gfn)
 
 struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva)
 {
+       struct page *page;
+
        gpa_t gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, gva);
 
        if (gpa == UNMAPPED_GVA)
                return NULL;
-       return gfn_to_page(vcpu->kvm, gpa >> PAGE_SHIFT);
+
+       down_read(&current->mm->mmap_sem);
+       page = gfn_to_page(vcpu->kvm, gpa >> PAGE_SHIFT);
+       up_read(&current->mm->mmap_sem);
+
+       return page;
 }
 
 static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
@@ -999,8 +1003,7 @@ static int __nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, int write,
                                >> PAGE_SHIFT;
                        new_table = kvm_mmu_get_page(vcpu, pseudo_gfn,
                                                     v, level - 1,
-                                                    1, ACC_ALL, &table[index],
-                                                    NULL);
+                                                    1, ACC_ALL, &table[index]);
                        if (!new_table) {
                                pgprintk("nonpaging_map: ENOMEM\n");
                                kvm_release_page_clean(page);
@@ -1020,15 +1023,18 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, int write, gfn_t gfn)
 
        struct page *page;
 
+       down_read(&vcpu->kvm->slots_lock);
+
        down_read(&current->mm->mmap_sem);
        page = gfn_to_page(vcpu->kvm, gfn);
+       up_read(&current->mm->mmap_sem);
 
        spin_lock(&vcpu->kvm->mmu_lock);
        kvm_mmu_free_some_pages(vcpu);
        r = __nonpaging_map(vcpu, v, write, gfn, page);
        spin_unlock(&vcpu->kvm->mmu_lock);
 
-       up_read(&current->mm->mmap_sem);
+       up_read(&vcpu->kvm->slots_lock);
 
        return r;
 }
@@ -1090,7 +1096,7 @@ static void mmu_alloc_roots(struct kvm_vcpu *vcpu)
 
                ASSERT(!VALID_PAGE(root));
                sp = kvm_mmu_get_page(vcpu, root_gfn, 0,
-                                     PT64_ROOT_LEVEL, 0, ACC_ALL, NULL, NULL);
+                                     PT64_ROOT_LEVEL, 0, ACC_ALL, NULL);
                root = __pa(sp->spt);
                ++sp->root_count;
                vcpu->arch.mmu.root_hpa = root;
@@ -1111,7 +1117,7 @@ static void mmu_alloc_roots(struct kvm_vcpu *vcpu)
                        root_gfn = 0;
                sp = kvm_mmu_get_page(vcpu, root_gfn, i << 30,
                                      PT32_ROOT_LEVEL, !is_paging(vcpu),
-                                     ACC_ALL, NULL, NULL);
+                                     ACC_ALL, NULL);
                root = __pa(sp->spt);
                ++sp->root_count;
                vcpu->arch.mmu.pae_root[i] = root | PT_PRESENT_MASK;
@@ -1172,7 +1178,7 @@ void kvm_mmu_flush_tlb(struct kvm_vcpu *vcpu)
 
 static void paging_new_cr3(struct kvm_vcpu *vcpu)
 {
-       pgprintk("%s: cr3 %lx\n", __FUNCTION__, vcpu->cr3);
+       pgprintk("%s: cr3 %lx\n", __FUNCTION__, vcpu->arch.cr3);
        mmu_free_roots(vcpu);
 }
 
@@ -1362,6 +1368,7 @@ static void mmu_guess_page_from_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
        gfn_t gfn;
        int r;
        u64 gpte = 0;
+       struct page *page;
 
        if (bytes != 4 && bytes != 8)
                return;
@@ -1389,6 +1396,11 @@ static void mmu_guess_page_from_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
        if (!is_present_pte(gpte))
                return;
        gfn = (gpte & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT;
+
+       down_read(&current->mm->mmap_sem);
+       page = gfn_to_page(vcpu->kvm, gfn);
+       up_read(&current->mm->mmap_sem);
+
        vcpu->arch.update_pte.gfn = gfn;
        vcpu->arch.update_pte.page = gfn_to_page(vcpu->kvm, gfn);
 }
@@ -1496,9 +1508,9 @@ int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva)
        gpa_t gpa;
        int r;
 
-       down_read(&current->mm->mmap_sem);
+       down_read(&vcpu->kvm->slots_lock);
        gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, gva);
-       up_read(&current->mm->mmap_sem);
+       up_read(&vcpu->kvm->slots_lock);
 
        spin_lock(&vcpu->kvm->mmu_lock);
        r = kvm_mmu_unprotect_page(vcpu->kvm, gpa >> PAGE_SHIFT);
index 03ba8608fe0f43816c91fc2bdc77b1c22725d7bb..ecc0856268c47c8c7a5c5773ac0d239d37dbc58e 100644 (file)
@@ -91,7 +91,10 @@ static bool FNAME(cmpxchg_gpte)(struct kvm *kvm,
        pt_element_t *table;
        struct page *page;
 
+       down_read(&current->mm->mmap_sem);
        page = gfn_to_page(kvm, table_gfn);
+       up_read(&current->mm->mmap_sem);
+
        table = kmap_atomic(page, KM_USER0);
 
        ret = CMPXCHG(&table[index], orig_pte, new_pte);
@@ -140,7 +143,7 @@ walk:
        }
 #endif
        ASSERT((!is_long_mode(vcpu) && is_pae(vcpu)) ||
-              (vcpu->cr3 & CR3_NONPAE_RESERVED_BITS) == 0);
+              (vcpu->arch.cr3 & CR3_NONPAE_RESERVED_BITS) == 0);
 
        pt_access = ACC_ALL;
 
@@ -297,7 +300,6 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
                u64 shadow_pte;
                int metaphysical;
                gfn_t table_gfn;
-               bool new_page = 0;
 
                shadow_ent = ((u64 *)__va(shadow_addr)) + index;
                if (level == PT_PAGE_TABLE_LEVEL)
@@ -319,8 +321,8 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
                }
                shadow_page = kvm_mmu_get_page(vcpu, table_gfn, addr, level-1,
                                               metaphysical, access,
-                                              shadow_ent, &new_page);
-               if (new_page && !metaphysical) {
+                                              shadow_ent);
+               if (!metaphysical) {
                        int r;
                        pt_element_t curr_pte;
                        r = kvm_read_guest_atomic(vcpu->kvm,
@@ -378,7 +380,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
        if (r)
                return r;
 
-       down_read(&current->mm->mmap_sem);
+       down_read(&vcpu->kvm->slots_lock);
        /*
         * Look up the shadow pte for the faulting address.
         */
@@ -392,11 +394,13 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
                pgprintk("%s: guest page fault\n", __FUNCTION__);
                inject_page_fault(vcpu, addr, walker.error_code);
                vcpu->arch.last_pt_write_count = 0; /* reset fork detector */
-               up_read(&current->mm->mmap_sem);
+               up_read(&vcpu->kvm->slots_lock);
                return 0;
        }
 
+       down_read(&current->mm->mmap_sem);
        page = gfn_to_page(vcpu->kvm, walker.gfn);
+       up_read(&current->mm->mmap_sem);
 
        spin_lock(&vcpu->kvm->mmu_lock);
        kvm_mmu_free_some_pages(vcpu);
@@ -413,14 +417,14 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
         */
        if (shadow_pte && is_io_pte(*shadow_pte)) {
                spin_unlock(&vcpu->kvm->mmu_lock);
-               up_read(&current->mm->mmap_sem);
+               up_read(&vcpu->kvm->slots_lock);
                return 1;
        }
 
        ++vcpu->stat.pf_fixed;
        kvm_mmu_audit(vcpu, "post page fault (fixed)");
        spin_unlock(&vcpu->kvm->mmu_lock);
-       up_read(&current->mm->mmap_sem);
+       up_read(&vcpu->kvm->slots_lock);
 
        return write_pt;
 }
index de755cb1431dcef84617b04e29eacb5a06fc59d0..1a582f1090e895aaa19634aa21d02ccf6c1584f0 100644 (file)
@@ -792,6 +792,10 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
        vcpu->arch.cr0 = cr0;
        cr0 |= X86_CR0_PG | X86_CR0_WP;
        cr0 &= ~(X86_CR0_CD | X86_CR0_NW);
+       if (!vcpu->fpu_active) {
+               svm->vmcb->control.intercept_exceptions |= (1 << NM_VECTOR);
+               cr0 |= X86_CR0_TS;
+       }
        svm->vmcb->save.cr0 = cr0;
 }
 
@@ -1096,6 +1100,24 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data)
        case MSR_IA32_SYSENTER_ESP:
                *data = svm->vmcb->save.sysenter_esp;
                break;
+       /* Nobody will change the following 5 values in the VMCB so
+          we can safely return them on rdmsr. They will always be 0
+          until LBRV is implemented. */
+       case MSR_IA32_DEBUGCTLMSR:
+               *data = svm->vmcb->save.dbgctl;
+               break;
+       case MSR_IA32_LASTBRANCHFROMIP:
+               *data = svm->vmcb->save.br_from;
+               break;
+       case MSR_IA32_LASTBRANCHTOIP:
+               *data = svm->vmcb->save.br_to;
+               break;
+       case MSR_IA32_LASTINTFROMIP:
+               *data = svm->vmcb->save.last_excp_from;
+               break;
+       case MSR_IA32_LASTINTTOIP:
+               *data = svm->vmcb->save.last_excp_to;
+               break;
        default:
                return kvm_get_msr_common(vcpu, ecx, data);
        }
@@ -1156,6 +1178,10 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data)
        case MSR_IA32_SYSENTER_ESP:
                svm->vmcb->save.sysenter_esp = data;
                break;
+       case MSR_IA32_DEBUGCTLMSR:
+               pr_unimpl(vcpu, "%s: MSR_IA32_DEBUGCTLMSR 0x%llx, nop\n",
+                               __FUNCTION__, data);
+               break;
        case MSR_K7_EVNTSEL0:
        case MSR_K7_EVNTSEL1:
        case MSR_K7_EVNTSEL2:
index ad36447e696e6c80bbf70ce53e0b88a7e2c2bbe8..94ea724638fda63b87ec248c2c3b40783ad93e08 100644 (file)
@@ -638,6 +638,7 @@ static void setup_msrs(struct vcpu_vmx *vmx)
 {
        int save_nmsrs;
 
+       vmx_load_host_state(vmx);
        save_nmsrs = 0;
 #ifdef CONFIG_X86_64
        if (is_long_mode(&vmx->vcpu)) {
@@ -1477,7 +1478,7 @@ static int alloc_apic_access_page(struct kvm *kvm)
        struct kvm_userspace_memory_region kvm_userspace_mem;
        int r = 0;
 
-       down_write(&current->mm->mmap_sem);
+       down_write(&kvm->slots_lock);
        if (kvm->arch.apic_access_page)
                goto out;
        kvm_userspace_mem.slot = APIC_ACCESS_PAGE_PRIVATE_MEMSLOT;
@@ -1487,9 +1488,12 @@ static int alloc_apic_access_page(struct kvm *kvm)
        r = __kvm_set_memory_region(kvm, &kvm_userspace_mem, 0);
        if (r)
                goto out;
+
+       down_read(&current->mm->mmap_sem);
        kvm->arch.apic_access_page = gfn_to_page(kvm, 0xfee00);
+       up_read(&current->mm->mmap_sem);
 out:
-       up_write(&current->mm->mmap_sem);
+       up_write(&kvm->slots_lock);
        return r;
 }
 
@@ -1602,9 +1606,6 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
        vmcs_writel(CR0_GUEST_HOST_MASK, ~0UL);
        vmcs_writel(CR4_GUEST_HOST_MASK, KVM_GUEST_CR4_MASK);
 
-       if (vm_need_virtualize_apic_accesses(vmx->vcpu.kvm))
-               if (alloc_apic_access_page(vmx->vcpu.kvm) != 0)
-                       return -ENOMEM;
 
        return 0;
 }
@@ -2534,6 +2535,9 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id)
        put_cpu();
        if (err)
                goto free_vmcs;
+       if (vm_need_virtualize_apic_accesses(kvm))
+               if (alloc_apic_access_page(kvm) != 0)
+                       goto free_vmcs;
 
        return &vmx->vcpu;
 
index cf530814868957a9de8058849538405ca493dcc5..6b01552bd1f1cb91c64af4fdf9f3124e734d4d19 100644 (file)
@@ -46,6 +46,9 @@
 #define VM_STAT(x) offsetof(struct kvm, stat.x), KVM_STAT_VM
 #define VCPU_STAT(x) offsetof(struct kvm_vcpu, stat.x), KVM_STAT_VCPU
 
+static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
+                                   struct kvm_cpuid_entry2 __user *entries);
+
 struct kvm_x86_ops *kvm_x86_ops;
 
 struct kvm_stats_debugfs_item debugfs_entries[] = {
@@ -181,7 +184,7 @@ int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3)
        int ret;
        u64 pdpte[ARRAY_SIZE(vcpu->arch.pdptrs)];
 
-       down_read(&current->mm->mmap_sem);
+       down_read(&vcpu->kvm->slots_lock);
        ret = kvm_read_guest_page(vcpu->kvm, pdpt_gfn, pdpte,
                                  offset * sizeof(u64), sizeof(pdpte));
        if (ret < 0) {
@@ -198,7 +201,7 @@ int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3)
 
        memcpy(vcpu->arch.pdptrs, pdpte, sizeof(vcpu->arch.pdptrs));
 out:
-       up_read(&current->mm->mmap_sem);
+       up_read(&vcpu->kvm->slots_lock);
 
        return ret;
 }
@@ -212,13 +215,13 @@ static bool pdptrs_changed(struct kvm_vcpu *vcpu)
        if (is_long_mode(vcpu) || !is_pae(vcpu))
                return false;
 
-       down_read(&current->mm->mmap_sem);
+       down_read(&vcpu->kvm->slots_lock);
        r = kvm_read_guest(vcpu->kvm, vcpu->arch.cr3 & ~31u, pdpte, sizeof(pdpte));
        if (r < 0)
                goto out;
        changed = memcmp(pdpte, vcpu->arch.pdptrs, sizeof(pdpte)) != 0;
 out:
-       up_read(&current->mm->mmap_sem);
+       up_read(&vcpu->kvm->slots_lock);
 
        return changed;
 }
@@ -356,7 +359,7 @@ void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
                 */
        }
 
-       down_read(&current->mm->mmap_sem);
+       down_read(&vcpu->kvm->slots_lock);
        /*
         * Does the new cr3 value map to physical memory? (Note, we
         * catch an invalid cr3 even in real-mode, because it would
@@ -372,7 +375,7 @@ void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
                vcpu->arch.cr3 = cr3;
                vcpu->arch.mmu.new_cr3(vcpu);
        }
-       up_read(&current->mm->mmap_sem);
+       up_read(&vcpu->kvm->slots_lock);
 }
 EXPORT_SYMBOL_GPL(set_cr3);
 
@@ -484,6 +487,10 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
                pr_unimpl(vcpu, "%s: MSR_IA32_MCG_STATUS 0x%llx, nop\n",
                        __FUNCTION__, data);
                break;
+       case MSR_IA32_MCG_CTL:
+               pr_unimpl(vcpu, "%s: MSR_IA32_MCG_CTL 0x%llx, nop\n",
+                       __FUNCTION__, data);
+               break;
        case MSR_IA32_UCODE_REV:
        case MSR_IA32_UCODE_WRITE:
        case 0x200 ... 0x2ff: /* MTRRs */
@@ -526,6 +533,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
        case MSR_IA32_MC0_CTL:
        case MSR_IA32_MCG_STATUS:
        case MSR_IA32_MCG_CAP:
+       case MSR_IA32_MCG_CTL:
        case MSR_IA32_MC0_MISC:
        case MSR_IA32_MC0_MISC+4:
        case MSR_IA32_MC0_MISC+8:
@@ -727,6 +735,24 @@ long kvm_arch_dev_ioctl(struct file *filp,
                r = 0;
                break;
        }
+       case KVM_GET_SUPPORTED_CPUID: {
+               struct kvm_cpuid2 __user *cpuid_arg = argp;
+               struct kvm_cpuid2 cpuid;
+
+               r = -EFAULT;
+               if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid))
+                       goto out;
+               r = kvm_dev_ioctl_get_supported_cpuid(&cpuid,
+                       cpuid_arg->entries);
+               if (r)
+                       goto out;
+
+               r = -EFAULT;
+               if (copy_to_user(cpuid_arg, &cpuid, sizeof cpuid))
+                       goto out;
+               r = 0;
+               break;
+       }
        default:
                r = -EINVAL;
        }
@@ -974,8 +1000,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
        put_cpu();
 }
 
-static int kvm_vm_ioctl_get_supported_cpuid(struct kvm *kvm,
-                                   struct kvm_cpuid2 *cpuid,
+static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
                                    struct kvm_cpuid_entry2 __user *entries)
 {
        struct kvm_cpuid_entry2 *cpuid_entries;
@@ -1207,12 +1232,12 @@ static int kvm_vm_ioctl_set_nr_mmu_pages(struct kvm *kvm,
        if (kvm_nr_mmu_pages < KVM_MIN_ALLOC_MMU_PAGES)
                return -EINVAL;
 
-       down_write(&current->mm->mmap_sem);
+       down_write(&kvm->slots_lock);
 
        kvm_mmu_change_mmu_pages(kvm, kvm_nr_mmu_pages);
        kvm->arch.n_requested_mmu_pages = kvm_nr_mmu_pages;
 
-       up_write(&current->mm->mmap_sem);
+       up_write(&kvm->slots_lock);
        return 0;
 }
 
@@ -1261,7 +1286,7 @@ static int kvm_vm_ioctl_set_memory_alias(struct kvm *kvm,
            < alias->target_phys_addr)
                goto out;
 
-       down_write(&current->mm->mmap_sem);
+       down_write(&kvm->slots_lock);
 
        p = &kvm->arch.aliases[alias->slot];
        p->base_gfn = alias->guest_phys_addr >> PAGE_SHIFT;
@@ -1275,7 +1300,7 @@ static int kvm_vm_ioctl_set_memory_alias(struct kvm *kvm,
 
        kvm_mmu_zap_all(kvm);
 
-       up_write(&current->mm->mmap_sem);
+       up_write(&kvm->slots_lock);
 
        return 0;
 
@@ -1351,7 +1376,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
        struct kvm_memory_slot *memslot;
        int is_dirty = 0;
 
-       down_write(&current->mm->mmap_sem);
+       down_write(&kvm->slots_lock);
 
        r = kvm_get_dirty_log(kvm, log, &is_dirty);
        if (r)
@@ -1367,7 +1392,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
        }
        r = 0;
 out:
-       up_write(&current->mm->mmap_sem);
+       up_write(&kvm->slots_lock);
        return r;
 }
 
@@ -1487,24 +1512,6 @@ long kvm_arch_vm_ioctl(struct file *filp,
                r = 0;
                break;
        }
-       case KVM_GET_SUPPORTED_CPUID: {
-               struct kvm_cpuid2 __user *cpuid_arg = argp;
-               struct kvm_cpuid2 cpuid;
-
-               r = -EFAULT;
-               if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid))
-                       goto out;
-               r = kvm_vm_ioctl_get_supported_cpuid(kvm, &cpuid,
-                       cpuid_arg->entries);
-               if (r)
-                       goto out;
-
-               r = -EFAULT;
-               if (copy_to_user(cpuid_arg, &cpuid, sizeof cpuid))
-                       goto out;
-               r = 0;
-               break;
-       }
        default:
                ;
        }
@@ -1563,7 +1570,7 @@ int emulator_read_std(unsigned long addr,
        void *data = val;
        int r = X86EMUL_CONTINUE;
 
-       down_read(&current->mm->mmap_sem);
+       down_read(&vcpu->kvm->slots_lock);
        while (bytes) {
                gpa_t gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, addr);
                unsigned offset = addr & (PAGE_SIZE-1);
@@ -1585,7 +1592,7 @@ int emulator_read_std(unsigned long addr,
                addr += tocopy;
        }
 out:
-       up_read(&current->mm->mmap_sem);
+       up_read(&vcpu->kvm->slots_lock);
        return r;
 }
 EXPORT_SYMBOL_GPL(emulator_read_std);
@@ -1604,9 +1611,9 @@ static int emulator_read_emulated(unsigned long addr,
                return X86EMUL_CONTINUE;
        }
 
-       down_read(&current->mm->mmap_sem);
+       down_read(&vcpu->kvm->slots_lock);
        gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, addr);
-       up_read(&current->mm->mmap_sem);
+       up_read(&vcpu->kvm->slots_lock);
 
        /* For APIC access vmexit */
        if ((gpa & PAGE_MASK) == APIC_DEFAULT_PHYS_BASE)
@@ -1644,14 +1651,14 @@ static int emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa,
 {
        int ret;
 
-       down_read(&current->mm->mmap_sem);
+       down_read(&vcpu->kvm->slots_lock);
        ret = kvm_write_guest(vcpu->kvm, gpa, val, bytes);
        if (ret < 0) {
-               up_read(&current->mm->mmap_sem);
+               up_read(&vcpu->kvm->slots_lock);
                return 0;
        }
        kvm_mmu_pte_write(vcpu, gpa, val, bytes);
-       up_read(&current->mm->mmap_sem);
+       up_read(&vcpu->kvm->slots_lock);
        return 1;
 }
 
@@ -1663,9 +1670,9 @@ static int emulator_write_emulated_onepage(unsigned long addr,
        struct kvm_io_device *mmio_dev;
        gpa_t                 gpa;
 
-       down_read(&current->mm->mmap_sem);
+       down_read(&vcpu->kvm->slots_lock);
        gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, addr);
-       up_read(&current->mm->mmap_sem);
+       up_read(&vcpu->kvm->slots_lock);
 
        if (gpa == UNMAPPED_GVA) {
                kvm_inject_page_fault(vcpu, addr, 2);
@@ -1742,7 +1749,7 @@ static int emulator_cmpxchg_emulated(unsigned long addr,
                char *kaddr;
                u64 val;
 
-               down_read(&current->mm->mmap_sem);
+               down_read(&vcpu->kvm->slots_lock);
                gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, addr);
 
                if (gpa == UNMAPPED_GVA ||
@@ -1753,13 +1760,17 @@ static int emulator_cmpxchg_emulated(unsigned long addr,
                        goto emul_write;
 
                val = *(u64 *)new;
+
+               down_read(&current->mm->mmap_sem);
                page = gfn_to_page(vcpu->kvm, gpa >> PAGE_SHIFT);
+               up_read(&current->mm->mmap_sem);
+
                kaddr = kmap_atomic(page, KM_USER0);
                set_64bit((u64 *)(kaddr + offset_in_page(gpa)), val);
                kunmap_atomic(kaddr, KM_USER0);
                kvm_release_page_dirty(page);
        emul_write:
-               up_read(&current->mm->mmap_sem);
+               up_read(&vcpu->kvm->slots_lock);
        }
 #endif
 
@@ -2152,10 +2163,10 @@ int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
                kvm_x86_ops->skip_emulated_instruction(vcpu);
 
        for (i = 0; i < nr_pages; ++i) {
-               down_read(&current->mm->mmap_sem);
+               down_read(&vcpu->kvm->slots_lock);
                page = gva_to_page(vcpu, address + i * PAGE_SIZE);
                vcpu->arch.pio.guest_pages[i] = page;
-               up_read(&current->mm->mmap_sem);
+               up_read(&vcpu->kvm->slots_lock);
                if (!page) {
                        kvm_inject_gp(vcpu, 0);
                        free_pio_guest_pages(vcpu);
@@ -2478,8 +2489,9 @@ static void vapic_enter(struct kvm_vcpu *vcpu)
 
        down_read(&current->mm->mmap_sem);
        page = gfn_to_page(vcpu->kvm, apic->vapic_addr >> PAGE_SHIFT);
-       vcpu->arch.apic->vapic_page = page;
        up_read(&current->mm->mmap_sem);
+
+       vcpu->arch.apic->vapic_page = page;
 }
 
 static void vapic_exit(struct kvm_vcpu *vcpu)
@@ -2861,8 +2873,8 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
        kvm_x86_ops->decache_cr4_guest_bits(vcpu);
 
        mmu_reset_needed |= vcpu->arch.cr0 != sregs->cr0;
-       vcpu->arch.cr0 = sregs->cr0;
        kvm_x86_ops->set_cr0(vcpu, sregs->cr0);
+       vcpu->arch.cr0 = sregs->cr0;
 
        mmu_reset_needed |= vcpu->arch.cr4 != sregs->cr4;
        kvm_x86_ops->set_cr4(vcpu, sregs->cr4);
@@ -2952,9 +2964,9 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
        gpa_t gpa;
 
        vcpu_load(vcpu);
-       down_read(&current->mm->mmap_sem);
+       down_read(&vcpu->kvm->slots_lock);
        gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, vaddr);
-       up_read(&current->mm->mmap_sem);
+       up_read(&vcpu->kvm->slots_lock);
        tr->physical_address = gpa;
        tr->valid = gpa != UNMAPPED_GVA;
        tr->writeable = 1;
@@ -3227,11 +3239,13 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
         */
        if (!user_alloc) {
                if (npages && !old.rmap) {
+                       down_write(&current->mm->mmap_sem);
                        memslot->userspace_addr = do_mmap(NULL, 0,
                                                     npages * PAGE_SIZE,
                                                     PROT_READ | PROT_WRITE,
                                                     MAP_SHARED | MAP_ANONYMOUS,
                                                     0);
+                       up_write(&current->mm->mmap_sem);
 
                        if (IS_ERR((void *)memslot->userspace_addr))
                                return PTR_ERR((void *)memslot->userspace_addr);
@@ -3239,8 +3253,10 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
                        if (!old.user_alloc && old.rmap) {
                                int ret;
 
+                               down_write(&current->mm->mmap_sem);
                                ret = do_munmap(current->mm, old.userspace_addr,
                                                old.npages * PAGE_SIZE);
+                               up_write(&current->mm->mmap_sem);
                                if (ret < 0)
                                        printk(KERN_WARNING
                                       "kvm_vm_ioctl_set_memory_region: "
index 59898fb0a4aa1edc115858e10de10fc9004c820e..8ccfee10f5b52258526a2942a238b135f3d75743 100644 (file)
@@ -622,13 +622,17 @@ void __init init_cpu_to_node(void)
        int i;
 
        for (i = 0; i < NR_CPUS; i++) {
+               int node;
                u16 apicid = x86_cpu_to_apicid_init[i];
 
                if (apicid == BAD_APICID)
                        continue;
-               if (apicid_to_node[apicid] == NUMA_NO_NODE)
+               node = apicid_to_node[apicid];
+               if (node == NUMA_NO_NODE)
                        continue;
-               numa_set_node(i, apicid_to_node[apicid]);
+               if (!node_online(node))
+                       continue;
+               numa_set_node(i, node);
        }
 }
 
index 7049294fb469b0a66e3a21ecc13d5f4c56b01524..14e48b5a94ba193c1cb4acc667482e05905d373e 100644 (file)
@@ -26,7 +26,6 @@ struct cpa_data {
        pgprot_t        mask_set;
        pgprot_t        mask_clr;
        int             numpages;
-       int             processed;
        int             flushtlb;
        unsigned long   pfn;
 };
@@ -291,8 +290,8 @@ try_preserve_large_page(pte_t *kpte, unsigned long address,
         */
        nextpage_addr = (address + psize) & pmask;
        numpages = (nextpage_addr - address) >> PAGE_SHIFT;
-       if (numpages < cpa->processed)
-               cpa->processed = numpages;
+       if (numpages < cpa->numpages)
+               cpa->numpages = numpages;
 
        /*
         * We are safe now. Check whether the new pgprot is the same:
@@ -319,7 +318,7 @@ try_preserve_large_page(pte_t *kpte, unsigned long address,
         */
        addr = address + PAGE_SIZE;
        pfn++;
-       for (i = 1; i < cpa->processed; i++, addr += PAGE_SIZE, pfn++) {
+       for (i = 1; i < cpa->numpages; i++, addr += PAGE_SIZE, pfn++) {
                pgprot_t chk_prot = static_protections(new_prot, addr, pfn);
 
                if (pgprot_val(chk_prot) != pgprot_val(new_prot))
@@ -343,7 +342,7 @@ try_preserve_large_page(pte_t *kpte, unsigned long address,
         * that we limited the number of possible pages already to
         * the number of pages in the large page.
         */
-       if (address == (nextpage_addr - psize) && cpa->processed == numpages) {
+       if (address == (nextpage_addr - psize) && cpa->numpages == numpages) {
                /*
                 * The address is aligned and the number of pages
                 * covers the full page.
@@ -573,7 +572,7 @@ repeat:
                        set_pte_atomic(kpte, new_pte);
                        cpa->flushtlb = 1;
                }
-               cpa->processed = 1;
+               cpa->numpages = 1;
                return 0;
        }
 
@@ -584,7 +583,7 @@ repeat:
        do_split = try_preserve_large_page(kpte, address, cpa);
        /*
         * When the range fits into the existing large page,
-        * return. cp->processed and cpa->tlbflush have been updated in
+        * return. cp->numpages and cpa->tlbflush have been updated in
         * try_large_page:
         */
        if (do_split <= 0)
@@ -663,7 +662,7 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
                 * Store the remaining nr of pages for the large page
                 * preservation check.
                 */
-               cpa->numpages = cpa->processed = numpages;
+               cpa->numpages = numpages;
 
                ret = __change_page_attr(cpa, checkalias);
                if (ret)
@@ -680,9 +679,9 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
                 * CPA operation. Either a large page has been
                 * preserved or a single page update happened.
                 */
-               BUG_ON(cpa->processed > numpages);
-               numpages -= cpa->processed;
-               cpa->vaddr += cpa->processed * PAGE_SIZE;
+               BUG_ON(cpa->numpages > numpages);
+               numpages -= cpa->numpages;
+               cpa->vaddr += cpa->numpages * PAGE_SIZE;
        }
        return 0;
 }
index 3bad4773a2f3c36ff0eb8694014a010cfd903fb8..2341492bf7a056743097e06bfabd0b8c01f7436f 100644 (file)
@@ -38,7 +38,8 @@ char * __init xen_memory_setup(void)
        unsigned long max_pfn = xen_start_info->nr_pages;
 
        e820.nr_map = 0;
-       add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM);
+       add_memory_region(0, LOWMEMSIZE(), E820_RAM);
+       add_memory_region(HIGH_MEMORY, PFN_PHYS(max_pfn)-HIGH_MEMORY, E820_RAM);
 
        return "Xen";
 }
index 6901eedeffce83bd3db09b3d0b802da6486994b4..55c5f1fc4f1fcd90c1f119a9bc0f58b46f446e83 100644 (file)
@@ -259,8 +259,11 @@ int blk_do_ordered(struct request_queue *q, struct request **rqp)
 
 static void bio_end_empty_barrier(struct bio *bio, int err)
 {
-       if (err)
+       if (err) {
+               if (err == -EOPNOTSUPP)
+                       set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
                clear_bit(BIO_UPTODATE, &bio->bi_flags);
+       }
 
        complete(bio->bi_private);
 }
@@ -309,7 +312,9 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector)
                *error_sector = bio->bi_sector;
 
        ret = 0;
-       if (!bio_flagged(bio, BIO_UPTODATE))
+       if (bio_flagged(bio, BIO_EOPNOTSUPP))
+               ret = -EOPNOTSUPP;
+       else if (!bio_flagged(bio, BIO_UPTODATE))
                ret = -EIO;
 
        bio_put(bio);
index 775c8516abf5fe5b083416e3be5f07e969ec6f93..2a438a93f7233d8bc2033956f23e3f436f0e1f44 100644 (file)
@@ -127,7 +127,6 @@ void rq_init(struct request_queue *q, struct request *rq)
        rq->nr_hw_segments = 0;
        rq->ioprio = 0;
        rq->special = NULL;
-       rq->raw_data_len = 0;
        rq->buffer = NULL;
        rq->tag = -1;
        rq->errors = 0;
@@ -135,6 +134,7 @@ void rq_init(struct request_queue *q, struct request *rq)
        rq->cmd_len = 0;
        memset(rq->cmd, 0, sizeof(rq->cmd));
        rq->data_len = 0;
+       rq->extra_len = 0;
        rq->sense_len = 0;
        rq->data = NULL;
        rq->sense = NULL;
@@ -424,7 +424,6 @@ void blk_put_queue(struct request_queue *q)
 {
        kobject_put(&q->kobj);
 }
-EXPORT_SYMBOL(blk_put_queue);
 
 void blk_cleanup_queue(struct request_queue *q)
 {
@@ -592,7 +591,6 @@ int blk_get_queue(struct request_queue *q)
 
        return 1;
 }
-EXPORT_SYMBOL(blk_get_queue);
 
 static inline void blk_free_request(struct request_queue *q, struct request *rq)
 {
@@ -1768,6 +1766,7 @@ static inline void __end_request(struct request *rq, int uptodate,
 
 /**
  * blk_rq_bytes - Returns bytes left to complete in the entire request
+ * @rq: the request being processed
  **/
 unsigned int blk_rq_bytes(struct request *rq)
 {
@@ -1780,6 +1779,7 @@ EXPORT_SYMBOL_GPL(blk_rq_bytes);
 
 /**
  * blk_rq_cur_bytes - Returns bytes left to complete in the current segment
+ * @rq: the request being processed
  **/
 unsigned int blk_rq_cur_bytes(struct request *rq)
 {
@@ -2016,7 +2016,6 @@ void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
        rq->hard_cur_sectors = rq->current_nr_sectors;
        rq->hard_nr_sectors = rq->nr_sectors = bio_sectors(bio);
        rq->buffer = bio_data(bio);
-       rq->raw_data_len = bio->bi_size;
        rq->data_len = bio->bi_size;
 
        rq->bio = rq->biotail = bio;
index 09f7fd0bcb73000d4899f2b96dc088d852d41aab..c07d9c8317f4c055d3821302c22df20cf2627195 100644 (file)
@@ -19,7 +19,6 @@ int blk_rq_append_bio(struct request_queue *q, struct request *rq,
                rq->biotail->bi_next = bio;
                rq->biotail = bio;
 
-               rq->raw_data_len += bio->bi_size;
                rq->data_len += bio->bi_size;
        }
        return 0;
@@ -44,6 +43,7 @@ static int __blk_rq_map_user(struct request_queue *q, struct request *rq,
                             void __user *ubuf, unsigned int len)
 {
        unsigned long uaddr;
+       unsigned int alignment;
        struct bio *bio, *orig_bio;
        int reading, ret;
 
@@ -54,8 +54,8 @@ static int __blk_rq_map_user(struct request_queue *q, struct request *rq,
         * direct dma. else, set up kernel bounce buffers
         */
        uaddr = (unsigned long) ubuf;
-       if (!(uaddr & queue_dma_alignment(q)) &&
-           !(len & queue_dma_alignment(q)))
+       alignment = queue_dma_alignment(q) | q->dma_pad_mask;
+       if (!(uaddr & alignment) && !(len & alignment))
                bio = bio_map_user(q, NULL, uaddr, len, reading);
        else
                bio = bio_copy_user(q, uaddr, len, reading);
@@ -142,20 +142,22 @@ int blk_rq_map_user(struct request_queue *q, struct request *rq,
 
        /*
         * __blk_rq_map_user() copies the buffers if starting address
-        * or length isn't aligned.  As the copied buffer is always
-        * page aligned, we know that there's enough room for padding.
-        * Extend the last bio and update rq->data_len accordingly.
+        * or length isn't aligned to dma_pad_mask.  As the copied
+        * buffer is always page aligned, we know that there's enough
+        * room for padding.  Extend the last bio and update
+        * rq->data_len accordingly.
         *
         * On unmap, bio_uncopy_user() will use unmodified
         * bio_map_data pointed to by bio->bi_private.
         */
-       if (len & queue_dma_alignment(q)) {
-               unsigned int pad_len = (queue_dma_alignment(q) & ~len) + 1;
-               struct bio *bio = rq->biotail;
+       if (len & q->dma_pad_mask) {
+               unsigned int pad_len = (q->dma_pad_mask & ~len) + 1;
+               struct bio *tail = rq->biotail;
 
-               bio->bi_io_vec[bio->bi_vcnt - 1].bv_len += pad_len;
-               bio->bi_size += pad_len;
-               rq->data_len += pad_len;
+               tail->bi_io_vec[tail->bi_vcnt - 1].bv_len += pad_len;
+               tail->bi_size += pad_len;
+
+               rq->extra_len += pad_len;
        }
 
        rq->buffer = rq->data = NULL;
@@ -215,7 +217,6 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
        rq->buffer = rq->data = NULL;
        return 0;
 }
-EXPORT_SYMBOL(blk_rq_map_user_iov);
 
 /**
  * blk_rq_unmap_user - unmap a request with user data
index 7506c4fe0264bd6038d24108f5438fea42478508..0f58616bcd7f183514c43eb913f0e0c23c855215 100644 (file)
@@ -231,7 +231,7 @@ new_segment:
                            ((unsigned long)q->dma_drain_buffer) &
                            (PAGE_SIZE - 1));
                nsegs++;
-               rq->data_len += q->dma_drain_size;
+               rq->extra_len += q->dma_drain_size;
        }
 
        if (sg)
index 9a8ffdd0ce3d4a570deac27111b5559ccf6b1714..1344a0ea5cc6c00a89ef9536cbbfda7183d2b28b 100644 (file)
@@ -140,7 +140,7 @@ void blk_queue_bounce_limit(struct request_queue *q, u64 dma_addr)
        /* Assume anything <= 4GB can be handled by IOMMU.
           Actually some IOMMUs can handle everything, but I don't
           know of a way to test this here. */
-       if (b_pfn < (min_t(u64, 0xffffffff, BLK_BOUNCE_HIGH) >> PAGE_SHIFT))
+       if (b_pfn <= (min_t(u64, 0xffffffff, BLK_BOUNCE_HIGH) >> PAGE_SHIFT))
                dma = 1;
        q->bounce_pfn = max_low_pfn;
 #else
@@ -293,8 +293,24 @@ void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b)
 EXPORT_SYMBOL(blk_queue_stack_limits);
 
 /**
- * blk_queue_dma_drain - Set up a drain buffer for excess dma.
+ * blk_queue_dma_pad - set pad mask
+ * @q:     the request queue for the device
+ * @mask:  pad mask
+ *
+ * Set pad mask.  Direct IO requests are padded to the mask specified.
  *
+ * Appending pad buffer to a request modifies ->data_len such that it
+ * includes the pad buffer.  The original requested data length can be
+ * obtained using blk_rq_raw_data_len().
+ **/
+void blk_queue_dma_pad(struct request_queue *q, unsigned int mask)
+{
+       q->dma_pad_mask = mask;
+}
+EXPORT_SYMBOL(blk_queue_dma_pad);
+
+/**
+ * blk_queue_dma_drain - Set up a drain buffer for excess dma.
  * @q:  the request queue for the device
  * @dma_drain_needed: fn which returns non-zero if drain is necessary
  * @buf:       physically contiguous buffer
@@ -316,7 +332,7 @@ EXPORT_SYMBOL(blk_queue_stack_limits);
  * device can support otherwise there won't be room for the drain
  * buffer.
  */
-extern int blk_queue_dma_drain(struct request_queue *q,
+int blk_queue_dma_drain(struct request_queue *q,
                               dma_drain_needed_fn *dma_drain_needed,
                               void *buf, unsigned int size)
 {
index a8c37d4bbb32064f8a7f4dcd39734ccb403c2fae..4780a46ce2346898953085a6f4079c7734dcbaf7 100644 (file)
@@ -6,6 +6,8 @@
 #include <linux/bio.h>
 #include <linux/blkdev.h>
 
+#include "blk.h"
+
 /**
  * blk_queue_find_tag - find a request by its tag and queue
  * @q:  The request queue for the device
index ec898dd0c65c466ca2854ee987d7f178a83458d5..ec9120fb789a67c560df9c12e38dc8e0cc46a008 100644 (file)
@@ -32,6 +32,8 @@ void blk_recalc_rq_sectors(struct request *rq, int nsect);
 
 void blk_queue_congestion_threshold(struct request_queue *q);
 
+int blk_dev_init(void);
+
 /*
  * Return the threshold (number of used requests) at which the queue is
  * considered to be congested.  It include a little hysteresis to keep the
index 7f3c09549e4be7364be012d834450215bcd7096f..8917c5174dc2646c5ad8d4d67eb67529a98783f5 100644 (file)
@@ -437,14 +437,14 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
        }
 
        if (rq->next_rq) {
-               hdr->dout_resid = rq->raw_data_len;
-               hdr->din_resid = rq->next_rq->raw_data_len;
+               hdr->dout_resid = rq->data_len;
+               hdr->din_resid = rq->next_rq->data_len;
                blk_rq_unmap_user(bidi_bio);
                blk_put_request(rq->next_rq);
        } else if (rq_data_dir(rq) == READ)
-               hdr->din_resid = rq->raw_data_len;
+               hdr->din_resid = rq->data_len;
        else
-               hdr->dout_resid = rq->raw_data_len;
+               hdr->dout_resid = rq->data_len;
 
        /*
         * If the request generated a negative error number, return it
index 53f2238e69c8494997ad8660a9f9fbdb298ab33a..c44527d16c52d66058ca434e8c6e5af05b8874c6 100644 (file)
 #include <linux/buffer_head.h>
 #include <linux/mutex.h>
 
+#include "blk.h"
+
 static DEFINE_MUTEX(block_class_lock);
 #ifndef CONFIG_SYSFS_DEPRECATED
 struct kobject *block_depr;
 #endif
 
+static struct device_type disk_type;
+
 /*
  * Can be deleted altogether. Later.
  *
@@ -346,8 +350,6 @@ const struct seq_operations partitions_op = {
 #endif
 
 
-extern int blk_dev_init(void);
-
 static struct kobject *base_probe(dev_t devt, int *part, void *data)
 {
        if (request_module("block-major-%d-%d", MAJOR(devt), MINOR(devt)) > 0)
@@ -502,7 +504,7 @@ struct class block_class = {
        .name           = "block",
 };
 
-struct device_type disk_type = {
+static struct device_type disk_type = {
        .name           = "disk",
        .groups         = disk_attr_groups,
        .release        = disk_release,
@@ -632,12 +634,14 @@ static void media_change_notify_thread(struct work_struct *work)
        put_device(gd->driverfs_dev);
 }
 
+#if 0
 void genhd_media_change_notify(struct gendisk *disk)
 {
        get_device(disk->driverfs_dev);
        schedule_work(&disk->async_notify);
 }
 EXPORT_SYMBOL_GPL(genhd_media_change_notify);
+#endif  /*  0  */
 
 dev_t blk_lookup_devt(const char *name)
 {
index e993cac4911dbc9f3d3c0249f3912285ea61e581..a2c3a936ebf98e1481346e76a7ef268b803c76ea 100644 (file)
@@ -266,7 +266,7 @@ static int blk_complete_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr,
        hdr->info = 0;
        if (hdr->masked_status || hdr->host_status || hdr->driver_status)
                hdr->info |= SG_INFO_CHECK;
-       hdr->resid = rq->raw_data_len;
+       hdr->resid = rq->data_len;
        hdr->sb_len_wr = 0;
 
        if (rq->sense_len && hdr->sbp) {
@@ -528,8 +528,8 @@ static int __blk_send_generic(struct request_queue *q, struct gendisk *bd_disk,
        rq = blk_get_request(q, WRITE, __GFP_WAIT);
        rq->cmd_type = REQ_TYPE_BLOCK_PC;
        rq->data = NULL;
-       rq->raw_data_len = 0;
        rq->data_len = 0;
+       rq->extra_len = 0;
        rq->timeout = BLK_DEFAULT_SG_TIMEOUT;
        memset(rq->cmd, 0, sizeof(rq->cmd));
        rq->cmd[0] = cmd;
index 898acc5c1967b5d700901a8acf9a15b00f079049..69f1be6816f7cc6740ff206cf173e12feac7450e 100644 (file)
@@ -575,6 +575,7 @@ config CRYPTO_TEST
 config CRYPTO_AUTHENC
        tristate "Authenc support"
        select CRYPTO_AEAD
+       select CRYPTO_BLKCIPHER
        select CRYPTO_MANAGER
        select CRYPTO_HASH
        help
index 48c7583799541045751655aa6de6af80fed70ae9..7cf36253a75ee3b898e61c24a7a9c524cb524495 100644 (file)
@@ -12,9 +12,9 @@ obj-$(CONFIG_CRYPTO_AEAD) += aead.o
 
 crypto_blkcipher-objs := ablkcipher.o
 crypto_blkcipher-objs += blkcipher.o
+crypto_blkcipher-objs += chainiv.o
+crypto_blkcipher-objs += eseqiv.o
 obj-$(CONFIG_CRYPTO_BLKCIPHER) += crypto_blkcipher.o
-obj-$(CONFIG_CRYPTO_BLKCIPHER) += chainiv.o
-obj-$(CONFIG_CRYPTO_BLKCIPHER) += eseqiv.o
 obj-$(CONFIG_CRYPTO_SEQIV) += seqiv.o
 
 crypto_hash-objs := hash.o
index 3bcb099b4a85bd779d752f7d42868c48cb07d87a..94140b3756fcd598d49179deac34ed5a80a83ed5 100644 (file)
@@ -341,6 +341,3 @@ err:
        return ERR_PTR(err);
 }
 EXPORT_SYMBOL_GPL(crypto_alloc_ablkcipher);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Asynchronous block chaining cipher type");
index 4a7e65c4df4dc3ac6af007efa1d136e1232be053..185f955fb0d7f79770b7765660bd1a9cbbcfab2e 100644 (file)
@@ -696,5 +696,34 @@ void skcipher_geniv_exit(struct crypto_tfm *tfm)
 }
 EXPORT_SYMBOL_GPL(skcipher_geniv_exit);
 
+static int __init blkcipher_module_init(void)
+{
+       int err;
+
+       err = chainiv_module_init();
+       if (err)
+               goto out;
+
+       err = eseqiv_module_init();
+       if (err)
+               goto eseqiv_err;
+
+out:
+       return err;
+
+eseqiv_err:
+       chainiv_module_exit();
+       goto out;
+}
+
+static void __exit blkcipher_module_exit(void)
+{
+       eseqiv_module_exit();
+       chainiv_module_exit();
+}
+
+module_init(blkcipher_module_init);
+module_exit(blkcipher_module_exit);
+
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Generic block chaining cipher type");
index d17fa0454dc30259baa69a111ff60f929311894e..0a7cac6e90891c3f7e77a5b2645e160f4fc7b1b2 100644 (file)
@@ -314,18 +314,14 @@ static struct crypto_template chainiv_tmpl = {
        .module = THIS_MODULE,
 };
 
-static int __init chainiv_module_init(void)
+int __init chainiv_module_init(void)
 {
        return crypto_register_template(&chainiv_tmpl);
 }
+EXPORT_SYMBOL_GPL(chainiv_module_init);
 
-static void __exit chainiv_module_exit(void)
+void __exit chainiv_module_exit(void)
 {
        crypto_unregister_template(&chainiv_tmpl);
 }
-
-module_init(chainiv_module_init);
-module_exit(chainiv_module_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Chain IV Generator");
+EXPORT_SYMBOL_GPL(chainiv_module_exit);
index 6fd43bddd545e788546d868b097e3ad811867e76..b526cc348b79313e21bea12808976f392b5505a8 100644 (file)
@@ -21,6 +21,8 @@
 #include <linux/module.h>
 #include <linux/scatterlist.h>
 
+#include "internal.h"
+
 static int init(struct hash_desc *desc)
 {
        struct crypto_tfm *tfm = crypto_hash_tfm(desc->tfm);
index eb90d27ae118e0b79bc2d24daf94b476a4f89075..6f2cd063b6fef51e636cd5f55aef02902b800aea 100644 (file)
@@ -247,18 +247,14 @@ static struct crypto_template eseqiv_tmpl = {
        .module = THIS_MODULE,
 };
 
-static int __init eseqiv_module_init(void)
+int __init eseqiv_module_init(void)
 {
        return crypto_register_template(&eseqiv_tmpl);
 }
+EXPORT_SYMBOL_GPL(eseqiv_module_init);
 
-static void __exit eseqiv_module_exit(void)
+void __exit eseqiv_module_exit(void)
 {
        crypto_unregister_template(&eseqiv_tmpl);
 }
-
-module_init(eseqiv_module_init);
-module_exit(eseqiv_module_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Encrypted Sequence Number IV Generator");
+EXPORT_SYMBOL_GPL(eseqiv_module_exit);
index 86727403e5ab1f0e5e7bbd15f3703046f4390548..2feb0f239c38179c579cbead01e7fe168d4ea0dd 100644 (file)
@@ -124,6 +124,11 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
                unsigned int offset = sg[i].offset;
                unsigned int slen = sg[i].length;
 
+               if (unlikely(slen > nbytes))
+                       slen = nbytes;
+
+               nbytes -= slen;
+
                while (slen > 0) {
                        unsigned int len = min(slen, ((unsigned int)(PAGE_SIZE)) - offset);
                        char *p = crypto_kmap(pg, 0) + offset;
@@ -177,7 +182,6 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
                        offset = 0;
                        pg++;
                }
-               nbytes-=sg[i].length;
                i++;
        } while (nbytes>0);
 
index 8eb08bfaf7c099cc5b4dd0e06cbd48eb4f381c26..d87b0f3102c322337e38a8c67b8d7b0f0a69e661 100644 (file)
@@ -77,16 +77,16 @@ static int setkey(struct crypto_tfm *parent, const u8 *key,
 }
 
 struct sinfo {
-       be128 t;
+       be128 *t;
        struct crypto_tfm *tfm;
        void (*fn)(struct crypto_tfm *, u8 *, const u8 *);
 };
 
 static inline void xts_round(struct sinfo *s, void *dst, const void *src)
 {
-       be128_xor(dst, &s->t, src);             /* PP <- T xor P */
+       be128_xor(dst, s->t, src);              /* PP <- T xor P */
        s->fn(s->tfm, dst, dst);                /* CC <- E(Key1,PP) */
-       be128_xor(dst, dst, &s->t);             /* C <- T xor CC */
+       be128_xor(dst, dst, s->t);              /* C <- T xor CC */
 }
 
 static int crypt(struct blkcipher_desc *d,
@@ -101,7 +101,6 @@ static int crypt(struct blkcipher_desc *d,
                .tfm = crypto_cipher_tfm(ctx->child),
                .fn = fn
        };
-       be128 *iv;
        u8 *wsrc;
        u8 *wdst;
 
@@ -109,20 +108,20 @@ static int crypt(struct blkcipher_desc *d,
        if (!w->nbytes)
                return err;
 
+       s.t = (be128 *)w->iv;
        avail = w->nbytes;
 
        wsrc = w->src.virt.addr;
        wdst = w->dst.virt.addr;
 
        /* calculate first value of T */
-       iv = (be128 *)w->iv;
-       tw(crypto_cipher_tfm(ctx->tweak), (void *)&s.t, w->iv);
+       tw(crypto_cipher_tfm(ctx->tweak), w->iv, w->iv);
 
        goto first;
 
        for (;;) {
                do {
-                       gf128mul_x_ble(&s.t, &s.t);
+                       gf128mul_x_ble(s.t, s.t);
 
 first:
                        xts_round(&s, wdst, wsrc);
index 28a5fbc6aa1a456d335852914aa24ea48880c74b..93d80a1c36f994d4a98fcdba821acd142fe6d07b 100644 (file)
@@ -347,40 +347,40 @@ char *func_table[MAX_NR_FUNC] = {
 };
 
 struct kbdiacruc accent_table[MAX_DIACR] = {
-       {'`', 'A', '\300'},     {'`', 'a', '\340'},
-       {'\'', 'A', '\301'},    {'\'', 'a', '\341'},
-       {'^', 'A', '\302'},     {'^', 'a', '\342'},
-       {'~', 'A', '\303'},     {'~', 'a', '\343'},
-       {'"', 'A', '\304'},     {'"', 'a', '\344'},
-       {'O', 'A', '\305'},     {'o', 'a', '\345'},
-       {'0', 'A', '\305'},     {'0', 'a', '\345'},
-       {'A', 'A', '\305'},     {'a', 'a', '\345'},
-       {'A', 'E', '\306'},     {'a', 'e', '\346'},
-       {',', 'C', '\307'},     {',', 'c', '\347'},
-       {'`', 'E', '\310'},     {'`', 'e', '\350'},
-       {'\'', 'E', '\311'},    {'\'', 'e', '\351'},
-       {'^', 'E', '\312'},     {'^', 'e', '\352'},
-       {'"', 'E', '\313'},     {'"', 'e', '\353'},
-       {'`', 'I', '\314'},     {'`', 'i', '\354'},
-       {'\'', 'I', '\315'},    {'\'', 'i', '\355'},
-       {'^', 'I', '\316'},     {'^', 'i', '\356'},
-       {'"', 'I', '\317'},     {'"', 'i', '\357'},
-       {'-', 'D', '\320'},     {'-', 'd', '\360'},
-       {'~', 'N', '\321'},     {'~', 'n', '\361'},
-       {'`', 'O', '\322'},     {'`', 'o', '\362'},
-       {'\'', 'O', '\323'},    {'\'', 'o', '\363'},
-       {'^', 'O', '\324'},     {'^', 'o', '\364'},
-       {'~', 'O', '\325'},     {'~', 'o', '\365'},
-       {'"', 'O', '\326'},     {'"', 'o', '\366'},
-       {'/', 'O', '\330'},     {'/', 'o', '\370'},
-       {'`', 'U', '\331'},     {'`', 'u', '\371'},
-       {'\'', 'U', '\332'},    {'\'', 'u', '\372'},
-       {'^', 'U', '\333'},     {'^', 'u', '\373'},
-       {'"', 'U', '\334'},     {'"', 'u', '\374'},
-       {'\'', 'Y', '\335'},    {'\'', 'y', '\375'},
-       {'T', 'H', '\336'},     {'t', 'h', '\376'},
-       {'s', 's', '\337'},     {'"', 'y', '\377'},
-       {'s', 'z', '\337'},     {'i', 'j', '\377'},
+       {'`', 'A', 0300},       {'`', 'a', 0340},
+       {'\'', 'A', 0301},      {'\'', 'a', 0341},
+       {'^', 'A', 0302},       {'^', 'a', 0342},
+       {'~', 'A', 0303},       {'~', 'a', 0343},
+       {'"', 'A', 0304},       {'"', 'a', 0344},
+       {'O', 'A', 0305},       {'o', 'a', 0345},
+       {'0', 'A', 0305},       {'0', 'a', 0345},
+       {'A', 'A', 0305},       {'a', 'a', 0345},
+       {'A', 'E', 0306},       {'a', 'e', 0346},
+       {',', 'C', 0307},       {',', 'c', 0347},
+       {'`', 'E', 0310},       {'`', 'e', 0350},
+       {'\'', 'E', 0311},      {'\'', 'e', 0351},
+       {'^', 'E', 0312},       {'^', 'e', 0352},
+       {'"', 'E', 0313},       {'"', 'e', 0353},
+       {'`', 'I', 0314},       {'`', 'i', 0354},
+       {'\'', 'I', 0315},      {'\'', 'i', 0355},
+       {'^', 'I', 0316},       {'^', 'i', 0356},
+       {'"', 'I', 0317},       {'"', 'i', 0357},
+       {'-', 'D', 0320},       {'-', 'd', 0360},
+       {'~', 'N', 0321},       {'~', 'n', 0361},
+       {'`', 'O', 0322},       {'`', 'o', 0362},
+       {'\'', 'O', 0323},      {'\'', 'o', 0363},
+       {'^', 'O', 0324},       {'^', 'o', 0364},
+       {'~', 'O', 0325},       {'~', 'o', 0365},
+       {'"', 'O', 0326},       {'"', 'o', 0366},
+       {'/', 'O', 0330},       {'/', 'o', 0370},
+       {'`', 'U', 0331},       {'`', 'u', 0371},
+       {'\'', 'U', 0332},      {'\'', 'u', 0372},
+       {'^', 'U', 0333},       {'^', 'u', 0373},
+       {'"', 'U', 0334},       {'"', 'u', 0374},
+       {'\'', 'Y', 0335},      {'\'', 'y', 0375},
+       {'T', 'H', 0336},       {'t', 'h', 0376},
+       {'s', 's', 0337},       {'"', 'y', 0377},
+       {'s', 'z', 0337},       {'i', 'j', 0377},
 };
 
 unsigned int accent_table_size = 68;
index 1db93b6190744015e251c5d428b58a762cf3c39a..8a49835bd0f85b141b53507e73b78cab945ef6ff 100644 (file)
@@ -186,6 +186,7 @@ enum {
        AHCI_HFLAG_NO_MSI               = (1 << 5), /* no PCI MSI */
        AHCI_HFLAG_NO_PMP               = (1 << 6), /* no PMP */
        AHCI_HFLAG_NO_HOTPLUG           = (1 << 7), /* ignore PxSERR.DIAG.N */
+       AHCI_HFLAG_SECT255              = (1 << 8), /* max 255 sectors */
 
        /* ap->flags bits */
 
@@ -255,6 +256,7 @@ static void ahci_vt8251_error_handler(struct ata_port *ap);
 static void ahci_p5wdh_error_handler(struct ata_port *ap);
 static void ahci_post_internal_cmd(struct ata_queued_cmd *qc);
 static int ahci_port_resume(struct ata_port *ap);
+static void ahci_dev_config(struct ata_device *dev);
 static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl);
 static void ahci_fill_cmd_slot(struct ahci_port_priv *pp, unsigned int tag,
                               u32 opts);
@@ -294,6 +296,8 @@ static const struct ata_port_operations ahci_ops = {
        .check_altstatus        = ahci_check_status,
        .dev_select             = ata_noop_dev_select,
 
+       .dev_config             = ahci_dev_config,
+
        .tf_read                = ahci_tf_read,
 
        .qc_defer               = sata_pmp_qc_defer_cmd_switch,
@@ -425,7 +429,7 @@ static const struct ata_port_info ahci_port_info[] = {
        /* board_ahci_sb600 */
        {
                AHCI_HFLAGS     (AHCI_HFLAG_IGN_SERR_INTERNAL |
-                                AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_PMP),
+                                AHCI_HFLAG_SECT255 | AHCI_HFLAG_NO_PMP),
                .flags          = AHCI_FLAG_COMMON,
                .link_flags     = AHCI_LFLAG_COMMON,
                .pio_mask       = 0x1f, /* pio0-4 */
@@ -1176,6 +1180,14 @@ static void ahci_init_controller(struct ata_host *host)
        VPRINTK("HOST_CTL 0x%x\n", tmp);
 }
 
+static void ahci_dev_config(struct ata_device *dev)
+{
+       struct ahci_host_priv *hpriv = dev->link->ap->host->private_data;
+
+       if (hpriv->flags & AHCI_HFLAG_SECT255)
+               dev->max_sectors = 255;
+}
+
 static unsigned int ahci_dev_classify(struct ata_port *ap)
 {
        void __iomem *port_mmio = ahci_port_base(ap);
index 7b1f1ee8131d2cb511989f4838bcad4eb832d4c7..8f0e8f2bc628a283c0000b5cab3e43287aa4bb58 100644 (file)
@@ -862,9 +862,10 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
                struct request_queue *q = sdev->request_queue;
                void *buf;
 
-               /* set the min alignment */
+               /* set the min alignment and padding */
                blk_queue_update_dma_alignment(sdev->request_queue,
                                               ATA_DMA_PAD_SZ - 1);
+               blk_queue_dma_pad(sdev->request_queue, ATA_DMA_PAD_SZ - 1);
 
                /* configure draining */
                buf = kmalloc(ATAPI_MAX_DRAIN, q->bounce_gfp | GFP_KERNEL);
@@ -2538,7 +2539,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
        }
 
        qc->tf.command = ATA_CMD_PACKET;
-       qc->nbytes = scsi_bufflen(scmd);
+       qc->nbytes = scsi_bufflen(scmd) + scmd->request->extra_len;
 
        /* check whether ATAPI DMA is safe */
        if (!using_pio && ata_check_atapi_dma(qc))
@@ -2549,7 +2550,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
         * want to set it properly, and for DMA where it is
         * effectively meaningless.
         */
-       nbytes = min(scmd->request->raw_data_len, (unsigned int)63 * 1024);
+       nbytes = min(scmd->request->data_len, (unsigned int)63 * 1024);
 
        /* Most ATAPI devices which honor transfer chunk size don't
         * behave according to the spec when odd chunk size which
@@ -2875,7 +2876,7 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
         * TODO: find out if we need to do more here to
         *       cover scatter/gather case.
         */
-       qc->nbytes = scsi_bufflen(scmd);
+       qc->nbytes = scsi_bufflen(scmd) + scmd->request->extra_len;
 
        /* request result TF and be quiet about device error */
        qc->flags |= ATA_QCFLAG_RESULT_TF | ATA_QCFLAG_QUIET;
index 0713872cf65c64c936c14a15aacda6c7f851f640..a742efa0da2b53cbde8409e87a6a57c01b503c76 100644 (file)
@@ -27,7 +27,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "pata_hpt366"
-#define DRV_VERSION    "0.6.1"
+#define DRV_VERSION    "0.6.2"
 
 struct hpt_clock {
        u8      xfer_speed;
@@ -180,9 +180,9 @@ static unsigned long hpt366_filter(struct ata_device *adev, unsigned long mask)
                if (hpt_dma_blacklisted(adev, "UDMA",  bad_ata33))
                        mask &= ~ATA_MASK_UDMA;
                if (hpt_dma_blacklisted(adev, "UDMA3", bad_ata66_3))
-                       mask &= ~(0x07 << ATA_SHIFT_UDMA);
+                       mask &= ~(0xF8 << ATA_SHIFT_UDMA);
                if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4))
-                       mask &= ~(0x0F << ATA_SHIFT_UDMA);
+                       mask &= ~(0xF0 << ATA_SHIFT_UDMA);
        }
        return ata_pci_default_filter(adev, mask);
 }
index 68eb34929cecde9c7ed149f3fa5e1dc15c65fd3a..9a10878b2ad870049cbd0341dee7b30adacbf44c 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "pata_hpt37x"
-#define DRV_VERSION    "0.6.9"
+#define DRV_VERSION    "0.6.11"
 
 struct hpt_clock {
        u8      xfer_speed;
@@ -281,7 +281,7 @@ static unsigned long hpt370_filter(struct ata_device *adev, unsigned long mask)
                if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
                        mask &= ~ATA_MASK_UDMA;
                if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
-                       mask &= ~(0x1F << ATA_SHIFT_UDMA);
+                       mask &= ~(0xE0 << ATA_SHIFT_UDMA);
        }
        return ata_pci_default_filter(adev, mask);
 }
@@ -297,7 +297,7 @@ static unsigned long hpt370a_filter(struct ata_device *adev, unsigned long mask)
 {
        if (adev->class == ATA_DEV_ATA) {
                if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
-                       mask &= ~ (0x1F << ATA_SHIFT_UDMA);
+                       mask &= ~(0xE0 << ATA_SHIFT_UDMA);
        }
        return ata_pci_default_filter(adev, mask);
 }
index 9c523fbf529ead0d92fe8c8d60356be5f0c5cbbd..a589c0fa0dbb699d3e1108f59b577cc645f4bfad 100644 (file)
@@ -226,7 +226,7 @@ static unsigned long serverworks_csb_filter(struct ata_device *adev, unsigned lo
 
        for (i = 0; (p = csb_bad_ata100[i]) != NULL; i++) {
                if (!strcmp(p, model_num))
-                       mask &= ~(0x1F << ATA_SHIFT_UDMA);
+                       mask &= ~(0xE0 << ATA_SHIFT_UDMA);
        }
        return ata_pci_default_filter(adev, mask);
 }
index 9c0070b5bd3e75d828a44d405dca4695b70e6ef6..7de543d1d0b4337328f95c502915d99b3a4fa871 100644 (file)
@@ -621,7 +621,8 @@ static struct kobject *get_device_parent(struct device *dev,
 static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
 {
        /* see if we live in a "glue" directory */
-       if (!dev->class || glue_dir->kset != &dev->class->class_dirs)
+       if (!glue_dir || !dev->class ||
+           glue_dir->kset != &dev->class->class_dirs)
                return;
 
        kobject_put(glue_dir);
@@ -770,17 +771,10 @@ int device_add(struct device *dev)
        struct class_interface *class_intf;
        int error;
 
-       error = pm_sleep_lock();
-       if (error) {
-               dev_warn(dev, "Suspicious %s during suspend\n", __FUNCTION__);
-               dump_stack();
-               return error;
-       }
-
        dev = get_device(dev);
        if (!dev || !strlen(dev->bus_id)) {
                error = -EINVAL;
-               goto Error;
+               goto Done;
        }
 
        pr_debug("device: '%s': %s\n", dev->bus_id, __FUNCTION__);
@@ -843,11 +837,9 @@ int device_add(struct device *dev)
        }
  Done:
        put_device(dev);
-       pm_sleep_unlock();
        return error;
  BusError:
        device_pm_remove(dev);
-       dpm_sysfs_remove(dev);
  PMError:
        if (dev->bus)
                blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
index ee9d1c8db0d6215c407a18d4a015e3e0ebb56c53..d887d5cb5bef74496f323a84d94b691ab24a2550 100644 (file)
@@ -48,7 +48,6 @@
  */
 
 LIST_HEAD(dpm_active);
-static LIST_HEAD(dpm_locked);
 static LIST_HEAD(dpm_off);
 static LIST_HEAD(dpm_off_irq);
 static LIST_HEAD(dpm_destroy);
@@ -81,28 +80,6 @@ void device_pm_add(struct device *dev)
  */
 void device_pm_remove(struct device *dev)
 {
-       /*
-        * If this function is called during a suspend, it will be blocked,
-        * because we're holding the device's semaphore at that time, which may
-        * lead to a deadlock.  In that case we want to print a warning.
-        * However, it may also be called by unregister_dropped_devices() with
-        * the device's semaphore released, in which case the warning should
-        * not be printed.
-        */
-       if (down_trylock(&dev->sem)) {
-               if (down_read_trylock(&pm_sleep_rwsem)) {
-                       /* No suspend in progress, wait on dev->sem */
-                       down(&dev->sem);
-                       up_read(&pm_sleep_rwsem);
-               } else {
-                       /* Suspend in progress, we may deadlock */
-                       dev_warn(dev, "Suspicious %s during suspend\n",
-                               __FUNCTION__);
-                       dump_stack();
-                       /* The user has been warned ... */
-                       down(&dev->sem);
-               }
-       }
        pr_debug("PM: Removing info for %s:%s\n",
                 dev->bus ? dev->bus->name : "No Bus",
                 kobject_name(&dev->kobj));
@@ -110,7 +87,6 @@ void device_pm_remove(struct device *dev)
        dpm_sysfs_remove(dev);
        list_del_init(&dev->power.entry);
        mutex_unlock(&dpm_list_mtx);
-       up(&dev->sem);
 }
 
 /**
@@ -230,6 +206,8 @@ static int resume_device(struct device *dev)
        TRACE_DEVICE(dev);
        TRACE_RESUME(0);
 
+       down(&dev->sem);
+
        if (dev->bus && dev->bus->resume) {
                dev_dbg(dev,"resuming\n");
                error = dev->bus->resume(dev);
@@ -245,6 +223,8 @@ static int resume_device(struct device *dev)
                error = dev->class->resume(dev);
        }
 
+       up(&dev->sem);
+
        TRACE_RESUME(error);
        return error;
 }
@@ -266,7 +246,7 @@ static void dpm_resume(void)
                struct list_head *entry = dpm_off.next;
                struct device *dev = to_device(entry);
 
-               list_move_tail(entry, &dpm_locked);
+               list_move_tail(entry, &dpm_active);
                mutex_unlock(&dpm_list_mtx);
                resume_device(dev);
                mutex_lock(&dpm_list_mtx);
@@ -274,25 +254,6 @@ static void dpm_resume(void)
        mutex_unlock(&dpm_list_mtx);
 }
 
-/**
- *     unlock_all_devices - Release each device's semaphore
- *
- *     Go through the dpm_off list.  Put each device on the dpm_active
- *     list and unlock it.
- */
-static void unlock_all_devices(void)
-{
-       mutex_lock(&dpm_list_mtx);
-       while (!list_empty(&dpm_locked)) {
-               struct list_head *entry = dpm_locked.prev;
-               struct device *dev = to_device(entry);
-
-               list_move(entry, &dpm_active);
-               up(&dev->sem);
-       }
-       mutex_unlock(&dpm_list_mtx);
-}
-
 /**
  *     unregister_dropped_devices - Unregister devices scheduled for removal
  *
@@ -305,7 +266,6 @@ static void unregister_dropped_devices(void)
                struct list_head *entry = dpm_destroy.next;
                struct device *dev = to_device(entry);
 
-               up(&dev->sem);
                mutex_unlock(&dpm_list_mtx);
                /* This also removes the device from the list */
                device_unregister(dev);
@@ -324,7 +284,6 @@ void device_resume(void)
 {
        might_sleep();
        dpm_resume();
-       unlock_all_devices();
        unregister_dropped_devices();
        up_write(&pm_sleep_rwsem);
 }
@@ -388,18 +347,15 @@ int device_power_down(pm_message_t state)
                struct list_head *entry = dpm_off.prev;
                struct device *dev = to_device(entry);
 
-               list_del_init(&dev->power.entry);
                error = suspend_device_late(dev, state);
                if (error) {
                        printk(KERN_ERR "Could not power down device %s: "
                                        "error %d\n",
                                        kobject_name(&dev->kobj), error);
-                       if (list_empty(&dev->power.entry))
-                               list_add(&dev->power.entry, &dpm_off);
                        break;
                }
-               if (list_empty(&dev->power.entry))
-                       list_add(&dev->power.entry, &dpm_off_irq);
+               if (!list_empty(&dev->power.entry))
+                       list_move(&dev->power.entry, &dpm_off_irq);
        }
 
        if (!error)
@@ -419,6 +375,8 @@ static int suspend_device(struct device *dev, pm_message_t state)
 {
        int error = 0;
 
+       down(&dev->sem);
+
        if (dev->power.power_state.event) {
                dev_dbg(dev, "PM: suspend %d-->%d\n",
                        dev->power.power_state.event, state.event);
@@ -441,6 +399,9 @@ static int suspend_device(struct device *dev, pm_message_t state)
                error = dev->bus->suspend(dev, state);
                suspend_report_result(dev->bus->suspend, error);
        }
+
+       up(&dev->sem);
+
        return error;
 }
 
@@ -461,13 +422,13 @@ static int dpm_suspend(pm_message_t state)
        int error = 0;
 
        mutex_lock(&dpm_list_mtx);
-       while (!list_empty(&dpm_locked)) {
-               struct list_head *entry = dpm_locked.prev;
+       while (!list_empty(&dpm_active)) {
+               struct list_head *entry = dpm_active.prev;
                struct device *dev = to_device(entry);
 
-               list_del_init(&dev->power.entry);
                mutex_unlock(&dpm_list_mtx);
                error = suspend_device(dev, state);
+               mutex_lock(&dpm_list_mtx);
                if (error) {
                        printk(KERN_ERR "Could not suspend device %s: "
                                        "error %d%s\n",
@@ -476,50 +437,16 @@ static int dpm_suspend(pm_message_t state)
                                        (error == -EAGAIN ?
                                        " (please convert to suspend_late)" :
                                        ""));
-                       mutex_lock(&dpm_list_mtx);
-                       if (list_empty(&dev->power.entry))
-                               list_add(&dev->power.entry, &dpm_locked);
                        break;
                }
-               mutex_lock(&dpm_list_mtx);
-               if (list_empty(&dev->power.entry))
-                       list_add(&dev->power.entry, &dpm_off);
+               if (!list_empty(&dev->power.entry))
+                       list_move(&dev->power.entry, &dpm_off);
        }
        mutex_unlock(&dpm_list_mtx);
 
        return error;
 }
 
-/**
- *     lock_all_devices - Acquire every device's semaphore
- *
- *     Go through the dpm_active list. Carefully lock each device's
- *     semaphore and put it in on the dpm_locked list.
- */
-static void lock_all_devices(void)
-{
-       mutex_lock(&dpm_list_mtx);
-       while (!list_empty(&dpm_active)) {
-               struct list_head *entry = dpm_active.next;
-               struct device *dev = to_device(entry);
-
-               /* Required locking order is dev->sem first,
-                * then dpm_list_mutex.  Hence this awkward code.
-                */
-               get_device(dev);
-               mutex_unlock(&dpm_list_mtx);
-               down(&dev->sem);
-               mutex_lock(&dpm_list_mtx);
-
-               if (list_empty(entry))
-                       up(&dev->sem);          /* Device was removed */
-               else
-                       list_move_tail(entry, &dpm_locked);
-               put_device(dev);
-       }
-       mutex_unlock(&dpm_list_mtx);
-}
-
 /**
  *     device_suspend - Save state and stop all devices in system.
  *     @state: new power management state
@@ -533,7 +460,6 @@ int device_suspend(pm_message_t state)
 
        might_sleep();
        down_write(&pm_sleep_rwsem);
-       lock_all_devices();
        error = dpm_suspend(state);
        if (error)
                device_resume();
index f25e7c6b2d27301990eb6bc133015b5889a754e9..40bca48abc12dcfa18de9e92c8e4327fb1bf6845 100644 (file)
@@ -126,9 +126,7 @@ static int transport_setup_classdev(struct attribute_container *cont,
 }
 
 /**
- * transport_setup_device - declare a new dev for transport class association
- *                         but don't make it visible yet.
- *
+ * transport_setup_device - declare a new dev for transport class association but don't make it visible yet.
  * @dev: the generic device representing the entity being added
  *
  * Usually, dev represents some component in the HBA system (either
index 9715be3f2487c161493f231ee2ef739806cdddc4..55bd35c0f082344a1d33822d081fcd7f9a104663 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/blkpg.h>
 #include <linux/timer.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 #include <linux/init.h>
 #include <linux/hdreg.h>
 #include <linux/spinlock.h>
@@ -131,7 +132,6 @@ static struct board_type products[] = {
 /*define how many times we will try a command because of bus resets */
 #define MAX_CMD_RETRIES 3
 
-#define READ_AHEAD      1024
 #define MAX_CTLR       32
 
 /* Originally cciss driver only supports 8 major numbers */
@@ -174,8 +174,6 @@ static int sendcmd_withirq(__u8 cmd, int ctlr, void *buff, size_t size,
 static void fail_all_cmds(unsigned long ctlr);
 
 #ifdef CONFIG_PROC_FS
-static int cciss_proc_get_info(char *buffer, char **start, off_t offset,
-                              int length, int *eof, void *data);
 static void cciss_procinit(int i);
 #else
 static void cciss_procinit(int i)
@@ -240,24 +238,46 @@ static inline CommandList_struct *removeQ(CommandList_struct **Qptr,
  */
 #define ENG_GIG 1000000000
 #define ENG_GIG_FACTOR (ENG_GIG/512)
+#define ENGAGE_SCSI    "engage scsi"
 static const char *raid_label[] = { "0", "4", "1(1+0)", "5", "5+1", "ADG",
        "UNKNOWN"
 };
 
 static struct proc_dir_entry *proc_cciss;
 
-static int cciss_proc_get_info(char *buffer, char **start, off_t offset,
-                              int length, int *eof, void *data)
+static void cciss_seq_show_header(struct seq_file *seq)
 {
-       off_t pos = 0;
-       off_t len = 0;
-       int size, i, ctlr;
-       ctlr_info_t *h = (ctlr_info_t *) data;
-       drive_info_struct *drv;
-       unsigned long flags;
-       sector_t vol_sz, vol_sz_frac;
+       ctlr_info_t *h = seq->private;
+
+       seq_printf(seq, "%s: HP %s Controller\n"
+               "Board ID: 0x%08lx\n"
+               "Firmware Version: %c%c%c%c\n"
+               "IRQ: %d\n"
+               "Logical drives: %d\n"
+               "Current Q depth: %d\n"
+               "Current # commands on controller: %d\n"
+               "Max Q depth since init: %d\n"
+               "Max # commands on controller since init: %d\n"
+               "Max SG entries since init: %d\n",
+               h->devname,
+               h->product_name,
+               (unsigned long)h->board_id,
+               h->firm_ver[0], h->firm_ver[1], h->firm_ver[2],
+               h->firm_ver[3], (unsigned int)h->intr[SIMPLE_MODE_INT],
+               h->num_luns,
+               h->Qdepth, h->commands_outstanding,
+               h->maxQsinceinit, h->max_outstanding, h->maxSG);
 
-       ctlr = h->ctlr;
+#ifdef CONFIG_CISS_SCSI_TAPE
+       cciss_seq_tape_report(seq, h->ctlr);
+#endif /* CONFIG_CISS_SCSI_TAPE */
+}
+
+static void *cciss_seq_start(struct seq_file *seq, loff_t *pos)
+{
+       ctlr_info_t *h = seq->private;
+       unsigned ctlr = h->ctlr;
+       unsigned long flags;
 
        /* prevent displaying bogus info during configuration
         * or deconfiguration of a logical volume
@@ -265,115 +285,155 @@ static int cciss_proc_get_info(char *buffer, char **start, off_t offset,
        spin_lock_irqsave(CCISS_LOCK(ctlr), flags);
        if (h->busy_configuring) {
                spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags);
-               return -EBUSY;
+               return ERR_PTR(-EBUSY);
        }
        h->busy_configuring = 1;
        spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags);
 
-       size = sprintf(buffer, "%s: HP %s Controller\n"
-                      "Board ID: 0x%08lx\n"
-                      "Firmware Version: %c%c%c%c\n"
-                      "IRQ: %d\n"
-                      "Logical drives: %d\n"
-                      "Max sectors: %d\n"
-                      "Current Q depth: %d\n"
-                      "Current # commands on controller: %d\n"
-                      "Max Q depth since init: %d\n"
-                      "Max # commands on controller since init: %d\n"
-                      "Max SG entries since init: %d\n\n",
-                      h->devname,
-                      h->product_name,
-                      (unsigned long)h->board_id,
-                      h->firm_ver[0], h->firm_ver[1], h->firm_ver[2],
-                      h->firm_ver[3], (unsigned int)h->intr[SIMPLE_MODE_INT],
-                      h->num_luns,
-                      h->cciss_max_sectors,
-                      h->Qdepth, h->commands_outstanding,
-                      h->maxQsinceinit, h->max_outstanding, h->maxSG);
-
-       pos += size;
-       len += size;
-       cciss_proc_tape_report(ctlr, buffer, &pos, &len);
-       for (i = 0; i <= h->highest_lun; i++) {
-
-               drv = &h->drv[i];
-               if (drv->heads == 0)
-                       continue;
+       if (*pos == 0)
+               cciss_seq_show_header(seq);
 
-               vol_sz = drv->nr_blocks;
-               vol_sz_frac = sector_div(vol_sz, ENG_GIG_FACTOR);
-               vol_sz_frac *= 100;
-               sector_div(vol_sz_frac, ENG_GIG_FACTOR);
+       return pos;
+}
+
+static int cciss_seq_show(struct seq_file *seq, void *v)
+{
+       sector_t vol_sz, vol_sz_frac;
+       ctlr_info_t *h = seq->private;
+       unsigned ctlr = h->ctlr;
+       loff_t *pos = v;
+       drive_info_struct *drv = &h->drv[*pos];
+
+       if (*pos > h->highest_lun)
+               return 0;
+
+       if (drv->heads == 0)
+               return 0;
+
+       vol_sz = drv->nr_blocks;
+       vol_sz_frac = sector_div(vol_sz, ENG_GIG_FACTOR);
+       vol_sz_frac *= 100;
+       sector_div(vol_sz_frac, ENG_GIG_FACTOR);
+
+       if (drv->raid_level > 5)
+               drv->raid_level = RAID_UNKNOWN;
+       seq_printf(seq, "cciss/c%dd%d:"
+                       "\t%4u.%02uGB\tRAID %s\n",
+                       ctlr, (int) *pos, (int)vol_sz, (int)vol_sz_frac,
+                       raid_label[drv->raid_level]);
+       return 0;
+}
+
+static void *cciss_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+       ctlr_info_t *h = seq->private;
+
+       if (*pos > h->highest_lun)
+               return NULL;
+       *pos += 1;
+
+       return pos;
+}
+
+static void cciss_seq_stop(struct seq_file *seq, void *v)
+{
+       ctlr_info_t *h = seq->private;
+
+       /* Only reset h->busy_configuring if we succeeded in setting
+        * it during cciss_seq_start. */
+       if (v == ERR_PTR(-EBUSY))
+               return;
 
-               if (drv->raid_level > 5)
-                       drv->raid_level = RAID_UNKNOWN;
-               size = sprintf(buffer + len, "cciss/c%dd%d:"
-                              "\t%4u.%02uGB\tRAID %s\n",
-                              ctlr, i, (int)vol_sz, (int)vol_sz_frac,
-                              raid_label[drv->raid_level]);
-               pos += size;
-               len += size;
-       }
-
-       *eof = 1;
-       *start = buffer + offset;
-       len -= offset;
-       if (len > length)
-               len = length;
        h->busy_configuring = 0;
-       return len;
 }
 
-static int
-cciss_proc_write(struct file *file, const char __user *buffer,
-                unsigned long count, void *data)
+static struct seq_operations cciss_seq_ops = {
+       .start = cciss_seq_start,
+       .show  = cciss_seq_show,
+       .next  = cciss_seq_next,
+       .stop  = cciss_seq_stop,
+};
+
+static int cciss_seq_open(struct inode *inode, struct file *file)
 {
-       unsigned char cmd[80];
-       int len;
-#ifdef CONFIG_CISS_SCSI_TAPE
-       ctlr_info_t *h = (ctlr_info_t *) data;
-       int rc;
+       int ret = seq_open(file, &cciss_seq_ops);
+       struct seq_file *seq = file->private_data;
+
+       if (!ret)
+               seq->private = PDE(inode)->data;
+
+       return ret;
+}
+
+static ssize_t
+cciss_proc_write(struct file *file, const char __user *buf,
+                size_t length, loff_t *ppos)
+{
+       int err;
+       char *buffer;
+
+#ifndef CONFIG_CISS_SCSI_TAPE
+       return -EINVAL;
 #endif
 
-       if (count > sizeof(cmd) - 1)
+       if (!buf || length > PAGE_SIZE - 1)
                return -EINVAL;
-       if (copy_from_user(cmd, buffer, count))
-               return -EFAULT;
-       cmd[count] = '\0';
-       len = strlen(cmd);      // above 3 lines ensure safety
-       if (len && cmd[len - 1] == '\n')
-               cmd[--len] = '\0';
-#      ifdef CONFIG_CISS_SCSI_TAPE
-       if (strcmp("engage scsi", cmd) == 0) {
+
+       buffer = (char *)__get_free_page(GFP_KERNEL);
+       if (!buffer)
+               return -ENOMEM;
+
+       err = -EFAULT;
+       if (copy_from_user(buffer, buf, length))
+               goto out;
+       buffer[length] = '\0';
+
+#ifdef CONFIG_CISS_SCSI_TAPE
+       if (strncmp(ENGAGE_SCSI, buffer, sizeof ENGAGE_SCSI - 1) == 0) {
+               struct seq_file *seq = file->private_data;
+               ctlr_info_t *h = seq->private;
+               int rc;
+
                rc = cciss_engage_scsi(h->ctlr);
                if (rc != 0)
-                       return -rc;
-               return count;
-       }
+                       err = -rc;
+               else
+                       err = length;
+       } else
+#endif /* CONFIG_CISS_SCSI_TAPE */
+               err = -EINVAL;
        /* might be nice to have "disengage" too, but it's not
           safely possible. (only 1 module use count, lock issues.) */
-#      endif
-       return -EINVAL;
+
+out:
+       free_page((unsigned long)buffer);
+       return err;
 }
 
-/*
- * Get us a file in /proc/cciss that says something about each controller.
- * Create /proc/cciss if it doesn't exist yet.
- */
+static struct file_operations cciss_proc_fops = {
+       .owner   = THIS_MODULE,
+       .open    = cciss_seq_open,
+       .read    = seq_read,
+       .llseek  = seq_lseek,
+       .release = seq_release,
+       .write   = cciss_proc_write,
+};
+
 static void __devinit cciss_procinit(int i)
 {
        struct proc_dir_entry *pde;
 
-       if (proc_cciss == NULL) {
+       if (proc_cciss == NULL)
                proc_cciss = proc_mkdir("cciss", proc_root_driver);
-               if (!proc_cciss)
-                       return;
-       }
+       if (!proc_cciss)
+               return;
+       pde = proc_create(hba[i]->devname, S_IWUSR | S_IRUSR | S_IRGRP |
+                                       S_IROTH, proc_cciss,
+                                       &cciss_proc_fops);
+       if (!pde)
+               return;
 
-       pde = create_proc_read_entry(hba[i]->devname,
-                                    S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH,
-                                    proc_cciss, cciss_proc_get_info, hba[i]);
-       pde->write_proc = cciss_proc_write;
+       pde->data = hba[i];
 }
 #endif                         /* CONFIG_PROC_FS */
 
@@ -1341,7 +1401,6 @@ geo_inq:
                disk->private_data = &h->drv[drv_index];
 
                /* Set up queue information */
-               disk->queue->backing_dev_info.ra_pages = READ_AHEAD;
                blk_queue_bounce_limit(disk->queue, hba[ctlr]->pdev->dma_mask);
 
                /* This is a hardware imposed limit. */
@@ -3434,7 +3493,6 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
                }
                drv->queue = q;
 
-               q->backing_dev_info.ra_pages = READ_AHEAD;
                blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask);
 
                /* This is a hardware imposed limit. */
index 55178e9973a094fe08fd23bf040c237e58695a02..45ac09300eb338c50f372bd51f2532e8bdec8d1b 100644 (file)
@@ -1404,21 +1404,18 @@ cciss_engage_scsi(int ctlr)
 }
 
 static void
-cciss_proc_tape_report(int ctlr, unsigned char *buffer, off_t *pos, off_t *len)
+cciss_seq_tape_report(struct seq_file *seq, int ctlr)
 {
        unsigned long flags;
-       int size;
-
-       *pos = *pos -1; *len = *len - 1; // cut off the last trailing newline
 
        CPQ_TAPE_LOCK(ctlr, flags);
-       size = sprintf(buffer + *len, 
+       seq_printf(seq,
                "Sequential access devices: %d\n\n",
                        ccissscsi[ctlr].ndevices);
        CPQ_TAPE_UNLOCK(ctlr, flags);
-       *pos += size; *len += size;
 }
 
+
 /* Need at least one of these error handlers to keep ../scsi/hosts.c from 
  * complaining.  Doing a host- or bus-reset can't do anything good here. 
  * Despite what it might say in scsi_error.c, there may well be commands
@@ -1498,6 +1495,5 @@ static int  cciss_eh_abort_handler(struct scsi_cmnd *scsicmd)
 #define cciss_scsi_setup(cntl_num)
 #define cciss_unregister_scsi(ctlr)
 #define cciss_register_scsi(ctlr)
-#define cciss_proc_tape_report(ctlr, buffer, pos, len)
 
 #endif /* CONFIG_CISS_SCSI_TAPE */
index 674cd66dcabaae261ca0e97c5ab61a1f272b2db5..18feb1c7c33b1b03ec0d394767e252b466000876 100644 (file)
@@ -849,7 +849,8 @@ static int pkt_flush_cache(struct pktcdvd_device *pd)
 /*
  * speed is given as the normal factor, e.g. 4 for 4x
  */
-static int pkt_set_speed(struct pktcdvd_device *pd, unsigned write_speed, unsigned read_speed)
+static noinline_for_stack int pkt_set_speed(struct pktcdvd_device *pd,
+                               unsigned write_speed, unsigned read_speed)
 {
        struct packet_command cgc;
        struct request_sense sense;
@@ -1776,7 +1777,8 @@ static int pkt_get_track_info(struct pktcdvd_device *pd, __u16 track, __u8 type,
        return pkt_generic_packet(pd, &cgc);
 }
 
-static int pkt_get_last_written(struct pktcdvd_device *pd, long *last_written)
+static noinline_for_stack int pkt_get_last_written(struct pktcdvd_device *pd,
+                                               long *last_written)
 {
        disc_information di;
        track_information ti;
@@ -1813,7 +1815,7 @@ static int pkt_get_last_written(struct pktcdvd_device *pd, long *last_written)
 /*
  * write mode select package based on pd->settings
  */
-static int pkt_set_write_settings(struct pktcdvd_device *pd)
+static noinline_for_stack int pkt_set_write_settings(struct pktcdvd_device *pd)
 {
        struct packet_command cgc;
        struct request_sense sense;
@@ -1972,7 +1974,7 @@ static int pkt_writable_disc(struct pktcdvd_device *pd, disc_information *di)
        return 1;
 }
 
-static int pkt_probe_settings(struct pktcdvd_device *pd)
+static noinline_for_stack int pkt_probe_settings(struct pktcdvd_device *pd)
 {
        struct packet_command cgc;
        unsigned char buf[12];
@@ -2071,7 +2073,8 @@ static int pkt_probe_settings(struct pktcdvd_device *pd)
 /*
  * enable/disable write caching on drive
  */
-static int pkt_write_caching(struct pktcdvd_device *pd, int set)
+static noinline_for_stack int pkt_write_caching(struct pktcdvd_device *pd,
+                                               int set)
 {
        struct packet_command cgc;
        struct request_sense sense;
@@ -2116,7 +2119,8 @@ static int pkt_lock_door(struct pktcdvd_device *pd, int lockflag)
 /*
  * Returns drive maximum write speed
  */
-static int pkt_get_max_speed(struct pktcdvd_device *pd, unsigned *write_speed)
+static noinline_for_stack int pkt_get_max_speed(struct pktcdvd_device *pd,
+                                               unsigned *write_speed)
 {
        struct packet_command cgc;
        struct request_sense sense;
@@ -2177,7 +2181,8 @@ static char us_clv_to_speed[16] = {
 /*
  * reads the maximum media speed from ATIP
  */
-static int pkt_media_speed(struct pktcdvd_device *pd, unsigned *speed)
+static noinline_for_stack int pkt_media_speed(struct pktcdvd_device *pd,
+                                               unsigned *speed)
 {
        struct packet_command cgc;
        struct request_sense sense;
@@ -2249,7 +2254,7 @@ static int pkt_media_speed(struct pktcdvd_device *pd, unsigned *speed)
        }
 }
 
-static int pkt_perform_opc(struct pktcdvd_device *pd)
+static noinline_for_stack int pkt_perform_opc(struct pktcdvd_device *pd)
 {
        struct packet_command cgc;
        struct request_sense sense;
index db259e60289b51ca84b46f56f67a741b0c473c16..12f5baea439bbf8a85874188b4e2dbeb4d79459a 100644 (file)
@@ -1152,8 +1152,8 @@ clean_up_and_return:
 /* This code is similar to that in open_for_data. The routine is called
    whenever an audio play operation is requested.
 */
-int check_for_audio_disc(struct cdrom_device_info * cdi,
-                        struct cdrom_device_ops * cdo)
+static int check_for_audio_disc(struct cdrom_device_info * cdi,
+                               struct cdrom_device_ops * cdo)
 {
         int ret;
        tracktype tracks;
index 0aa419a617674dfe20bb6d8dfe09aa706ad5cf18..d2208dfe3f678443bf7e8547e89ff0c9445b03c4 100644 (file)
@@ -223,40 +223,40 @@ char *func_table[MAX_NR_FUNC] = {
 };
 
 struct kbdiacruc accent_table[MAX_DIACR] = {
-       {'`', 'A', '\300'},     {'`', 'a', '\340'},
-       {'\'', 'A', '\301'},    {'\'', 'a', '\341'},
-       {'^', 'A', '\302'},     {'^', 'a', '\342'},
-       {'~', 'A', '\303'},     {'~', 'a', '\343'},
-       {'"', 'A', '\304'},     {'"', 'a', '\344'},
-       {'O', 'A', '\305'},     {'o', 'a', '\345'},
-       {'0', 'A', '\305'},     {'0', 'a', '\345'},
-       {'A', 'A', '\305'},     {'a', 'a', '\345'},
-       {'A', 'E', '\306'},     {'a', 'e', '\346'},
-       {',', 'C', '\307'},     {',', 'c', '\347'},
-       {'`', 'E', '\310'},     {'`', 'e', '\350'},
-       {'\'', 'E', '\311'},    {'\'', 'e', '\351'},
-       {'^', 'E', '\312'},     {'^', 'e', '\352'},
-       {'"', 'E', '\313'},     {'"', 'e', '\353'},
-       {'`', 'I', '\314'},     {'`', 'i', '\354'},
-       {'\'', 'I', '\315'},    {'\'', 'i', '\355'},
-       {'^', 'I', '\316'},     {'^', 'i', '\356'},
-       {'"', 'I', '\317'},     {'"', 'i', '\357'},
-       {'-', 'D', '\320'},     {'-', 'd', '\360'},
-       {'~', 'N', '\321'},     {'~', 'n', '\361'},
-       {'`', 'O', '\322'},     {'`', 'o', '\362'},
-       {'\'', 'O', '\323'},    {'\'', 'o', '\363'},
-       {'^', 'O', '\324'},     {'^', 'o', '\364'},
-       {'~', 'O', '\325'},     {'~', 'o', '\365'},
-       {'"', 'O', '\326'},     {'"', 'o', '\366'},
-       {'/', 'O', '\330'},     {'/', 'o', '\370'},
-       {'`', 'U', '\331'},     {'`', 'u', '\371'},
-       {'\'', 'U', '\332'},    {'\'', 'u', '\372'},
-       {'^', 'U', '\333'},     {'^', 'u', '\373'},
-       {'"', 'U', '\334'},     {'"', 'u', '\374'},
-       {'\'', 'Y', '\335'},    {'\'', 'y', '\375'},
-       {'T', 'H', '\336'},     {'t', 'h', '\376'},
-       {'s', 's', '\337'},     {'"', 'y', '\377'},
-       {'s', 'z', '\337'},     {'i', 'j', '\377'},
+       {'`', 'A', 0300},       {'`', 'a', 0340},
+       {'\'', 'A', 0301},      {'\'', 'a', 0341},
+       {'^', 'A', 0302},       {'^', 'a', 0342},
+       {'~', 'A', 0303},       {'~', 'a', 0343},
+       {'"', 'A', 0304},       {'"', 'a', 0344},
+       {'O', 'A', 0305},       {'o', 'a', 0345},
+       {'0', 'A', 0305},       {'0', 'a', 0345},
+       {'A', 'A', 0305},       {'a', 'a', 0345},
+       {'A', 'E', 0306},       {'a', 'e', 0346},
+       {',', 'C', 0307},       {',', 'c', 0347},
+       {'`', 'E', 0310},       {'`', 'e', 0350},
+       {'\'', 'E', 0311},      {'\'', 'e', 0351},
+       {'^', 'E', 0312},       {'^', 'e', 0352},
+       {'"', 'E', 0313},       {'"', 'e', 0353},
+       {'`', 'I', 0314},       {'`', 'i', 0354},
+       {'\'', 'I', 0315},      {'\'', 'i', 0355},
+       {'^', 'I', 0316},       {'^', 'i', 0356},
+       {'"', 'I', 0317},       {'"', 'i', 0357},
+       {'-', 'D', 0320},       {'-', 'd', 0360},
+       {'~', 'N', 0321},       {'~', 'n', 0361},
+       {'`', 'O', 0322},       {'`', 'o', 0362},
+       {'\'', 'O', 0323},      {'\'', 'o', 0363},
+       {'^', 'O', 0324},       {'^', 'o', 0364},
+       {'~', 'O', 0325},       {'~', 'o', 0365},
+       {'"', 'O', 0326},       {'"', 'o', 0366},
+       {'/', 'O', 0330},       {'/', 'o', 0370},
+       {'`', 'U', 0331},       {'`', 'u', 0371},
+       {'\'', 'U', 0332},      {'\'', 'u', 0372},
+       {'^', 'U', 0333},       {'^', 'u', 0373},
+       {'"', 'U', 0334},       {'"', 'u', 0374},
+       {'\'', 'Y', 0335},      {'\'', 'y', 0375},
+       {'T', 'H', 0336},       {'t', 'h', 0376},
+       {'s', 's', 0337},       {'"', 'y', 0377},
+       {'s', 'z', 0337},       {'i', 'j', 0377},
 };
 
 unsigned int accent_table_size = 68;
index 85d596a3c18c35b7248b4ee98fcaba65c60abcf0..eba2883b630ede817677c54a7cfe3e94f1582be1 100644 (file)
@@ -1527,7 +1527,7 @@ static int __devinit reset_card(struct pci_dev *pdev,
        msleep(10);
 
        portcount = inw(base + 0x2);
-       if (!inw(base + 0xe) & 0x1 || (portcount != 0 && portcount != 4 &&
+       if (!(inw(base + 0xe) & 0x1) || (portcount != 0 && portcount != 4 &&
                                portcount != 8 && portcount != 16)) {
                dev_err(&pdev->dev, "ISILoad:PCI Card%d reset failure.\n",
                        card + 1);
index ff35230058d36e7fd235b73b8884f2bb799f497c..d793e68b3e0d913030402978e46a05eedd8abf40 100644 (file)
@@ -377,13 +377,16 @@ void ipwireless_network_packet_received(struct ipw_network *network,
        for (i = 0; i < MAX_ASSOCIATED_TTYS; i++) {
                struct ipw_tty *tty = network->associated_ttys[channel_idx][i];
 
+               if (!tty)
+                       continue;
+
                /*
                 * If it's associated with a tty (other than the RAS channel
                 * when we're online), then send the data to that tty.  The RAS
                 * channel's data is handled above - it always goes through
                 * ppp_generic.
                 */
-               if (tty && channel_idx == IPW_CHANNEL_RAS
+               if (channel_idx == IPW_CHANNEL_RAS
                                && (network->ras_control_lines &
                                        IPW_CONTROL_LINE_DCD) != 0
                                && ipwireless_tty_is_modem(tty)) {
index c0e08c7bca2f4ef713c966eeed532164d33282e6..5ff83df67b447d18054bf45359c183d18fdb9e5a 100644 (file)
@@ -2109,7 +2109,6 @@ static void sx_throttle(struct tty_struct * tty)
        sx_out(bp, CD186x_CAR, port_No(port));
        spin_unlock_irqrestore(&bp->lock, flags);
        if (I_IXOFF(tty)) {
-               spin_unlock_irqrestore(&bp->lock, flags);
                sx_wait_CCR(bp);
                spin_lock_irqsave(&bp->lock, flags);
                sx_out(bp, CD186x_CCR, CCR_SSCH2);
index 367be917506117b08d2407b7f74beb55432701d4..9b58b894f823764ac9c0e3d3620b4a2080404fba 100644 (file)
@@ -702,6 +702,7 @@ void redraw_screen(struct vc_data *vc, int is_switch)
        if (is_switch) {
                set_leds();
                compute_shiftstate();
+               notify_update(vc);
        }
 }
 
index 89a29cd9378379a00f80e6899eadbac949f03fde..35a26a3e5f6804d977563ddd5ef03db8e8ea5f5c 100644 (file)
@@ -671,13 +671,13 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr ,char * buf)
 {
        struct cpufreq_policy * policy = to_policy(kobj);
        struct freq_attr * fattr = to_attr(attr);
-       ssize_t ret;
+       ssize_t ret = -EINVAL;
        policy = cpufreq_cpu_get(policy->cpu);
        if (!policy)
-               return -EINVAL;
+               goto no_policy;
 
        if (lock_policy_rwsem_read(policy->cpu) < 0)
-               return -EINVAL;
+               goto fail;
 
        if (fattr->show)
                ret = fattr->show(policy, buf);
@@ -685,8 +685,9 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr ,char * buf)
                ret = -EIO;
 
        unlock_policy_rwsem_read(policy->cpu);
-
+fail:
        cpufreq_cpu_put(policy);
+no_policy:
        return ret;
 }
 
@@ -695,13 +696,13 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr,
 {
        struct cpufreq_policy * policy = to_policy(kobj);
        struct freq_attr * fattr = to_attr(attr);
-       ssize_t ret;
+       ssize_t ret = -EINVAL;
        policy = cpufreq_cpu_get(policy->cpu);
        if (!policy)
-               return -EINVAL;
+               goto no_policy;
 
        if (lock_policy_rwsem_write(policy->cpu) < 0)
-               return -EINVAL;
+               goto fail;
 
        if (fattr->store)
                ret = fattr->store(policy, buf, count);
@@ -709,8 +710,9 @@ static ssize_t store(struct kobject * kobj, struct attribute * attr,
                ret = -EIO;
 
        unlock_policy_rwsem_write(policy->cpu);
-
+fail:
        cpufreq_cpu_put(policy);
+no_policy:
        return ret;
 }
 
@@ -1775,7 +1777,7 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb,
        return NOTIFY_OK;
 }
 
-static struct notifier_block __cpuinitdata cpufreq_cpu_notifier =
+static struct notifier_block __refdata cpufreq_cpu_notifier =
 {
     .notifier_call = cpufreq_cpu_callback,
 };
index 1b8312b0200675e81722def6d6b51134594e1250..070421a5480e731116ed58845e5ac424cfaf0aba 100644 (file)
@@ -323,7 +323,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
        return NOTIFY_OK;
 }
 
-static struct notifier_block cpufreq_stat_cpu_notifier __cpuinitdata =
+static struct notifier_block cpufreq_stat_cpu_notifier __refdata =
 {
        .notifier_call = cpufreq_stat_cpu_callback,
 };
index a703deffb7954cd3a1fd4831adaa48403b1b06ba..27340a7b19dddb8129f8ca85e8c24cc90075b6c3 100644 (file)
@@ -4,7 +4,7 @@
 
 menuconfig DMADEVICES
        bool "DMA Engine support"
-       depends on (PCI && X86) || ARCH_IOP32X || ARCH_IOP33X || ARCH_IOP13XX
+       depends on (PCI && X86) || ARCH_IOP32X || ARCH_IOP33X || ARCH_IOP13XX || PPC
        depends on !HIGHMEM64G
        help
          DMA engines can do asynchronous data transfers without
@@ -37,6 +37,23 @@ config INTEL_IOP_ADMA
        help
          Enable support for the Intel(R) IOP Series RAID engines.
 
+config FSL_DMA
+       bool "Freescale MPC85xx/MPC83xx DMA support"
+       depends on PPC
+       select DMA_ENGINE
+       ---help---
+         Enable support for the Freescale DMA engine. Now, it support
+         MPC8560/40, MPC8555, MPC8548 and MPC8641 processors.
+         The MPC8349, MPC8360 is also supported.
+
+config FSL_DMA_SELFTEST
+       bool "Enable the self test for each DMA channel"
+       depends on FSL_DMA
+       default y
+       ---help---
+         Enable the self test for each DMA channel. A self test will be
+         performed after the channel probed to ensure the DMA works well.
+
 config DMA_ENGINE
        bool
 
index b152cd84e123653b8ecb2f4fe58ea45f3459ce4b..c8036d94590277d24f994a82c61fccbe51a89f07 100644 (file)
@@ -3,3 +3,4 @@ obj-$(CONFIG_NET_DMA) += iovlock.o
 obj-$(CONFIG_INTEL_IOATDMA) += ioatdma.o
 ioatdma-objs := ioat.o ioat_dma.o ioat_dca.o
 obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o
+obj-$(CONFIG_FSL_DMA) += fsldma.o
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
new file mode 100644 (file)
index 0000000..cc9a681
--- /dev/null
@@ -0,0 +1,1067 @@
+/*
+ * Freescale MPC85xx, MPC83xx DMA Engine support
+ *
+ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ *
+ * Author:
+ *   Zhang Wei <wei.zhang@freescale.com>, Jul 2007
+ *   Ebony Zhu <ebony.zhu@freescale.com>, May 2007
+ *
+ * Description:
+ *   DMA engine driver for Freescale MPC8540 DMA controller, which is
+ *   also fit for MPC8560, MPC8555, MPC8548, MPC8641, and etc.
+ *   The support for MPC8349 DMA contorller is also added.
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/interrupt.h>
+#include <linux/dmaengine.h>
+#include <linux/delay.h>
+#include <linux/dma-mapping.h>
+#include <linux/dmapool.h>
+#include <linux/of_platform.h>
+
+#include "fsldma.h"
+
+static void dma_init(struct fsl_dma_chan *fsl_chan)
+{
+       /* Reset the channel */
+       DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr, 0, 32);
+
+       switch (fsl_chan->feature & FSL_DMA_IP_MASK) {
+       case FSL_DMA_IP_85XX:
+               /* Set the channel to below modes:
+                * EIE - Error interrupt enable
+                * EOSIE - End of segments interrupt enable (basic mode)
+                * EOLNIE - End of links interrupt enable
+                */
+               DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr, FSL_DMA_MR_EIE
+                               | FSL_DMA_MR_EOLNIE | FSL_DMA_MR_EOSIE, 32);
+               break;
+       case FSL_DMA_IP_83XX:
+               /* Set the channel to below modes:
+                * EOTIE - End-of-transfer interrupt enable
+                */
+               DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr, FSL_DMA_MR_EOTIE,
+                               32);
+               break;
+       }
+
+}
+
+static void set_sr(struct fsl_dma_chan *fsl_chan, dma_addr_t val)
+{
+       DMA_OUT(fsl_chan, &fsl_chan->reg_base->sr, val, 32);
+}
+
+static dma_addr_t get_sr(struct fsl_dma_chan *fsl_chan)
+{
+       return DMA_IN(fsl_chan, &fsl_chan->reg_base->sr, 32);
+}
+
+static void set_desc_cnt(struct fsl_dma_chan *fsl_chan,
+                               struct fsl_dma_ld_hw *hw, u32 count)
+{
+       hw->count = CPU_TO_DMA(fsl_chan, count, 32);
+}
+
+static void set_desc_src(struct fsl_dma_chan *fsl_chan,
+                               struct fsl_dma_ld_hw *hw, dma_addr_t src)
+{
+       u64 snoop_bits;
+
+       snoop_bits = ((fsl_chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX)
+               ? ((u64)FSL_DMA_SATR_SREADTYPE_SNOOP_READ << 32) : 0;
+       hw->src_addr = CPU_TO_DMA(fsl_chan, snoop_bits | src, 64);
+}
+
+static void set_desc_dest(struct fsl_dma_chan *fsl_chan,
+                               struct fsl_dma_ld_hw *hw, dma_addr_t dest)
+{
+       u64 snoop_bits;
+
+       snoop_bits = ((fsl_chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX)
+               ? ((u64)FSL_DMA_DATR_DWRITETYPE_SNOOP_WRITE << 32) : 0;
+       hw->dst_addr = CPU_TO_DMA(fsl_chan, snoop_bits | dest, 64);
+}
+
+static void set_desc_next(struct fsl_dma_chan *fsl_chan,
+                               struct fsl_dma_ld_hw *hw, dma_addr_t next)
+{
+       u64 snoop_bits;
+
+       snoop_bits = ((fsl_chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_83XX)
+               ? FSL_DMA_SNEN : 0;
+       hw->next_ln_addr = CPU_TO_DMA(fsl_chan, snoop_bits | next, 64);
+}
+
+static void set_cdar(struct fsl_dma_chan *fsl_chan, dma_addr_t addr)
+{
+       DMA_OUT(fsl_chan, &fsl_chan->reg_base->cdar, addr | FSL_DMA_SNEN, 64);
+}
+
+static dma_addr_t get_cdar(struct fsl_dma_chan *fsl_chan)
+{
+       return DMA_IN(fsl_chan, &fsl_chan->reg_base->cdar, 64) & ~FSL_DMA_SNEN;
+}
+
+static void set_ndar(struct fsl_dma_chan *fsl_chan, dma_addr_t addr)
+{
+       DMA_OUT(fsl_chan, &fsl_chan->reg_base->ndar, addr, 64);
+}
+
+static dma_addr_t get_ndar(struct fsl_dma_chan *fsl_chan)
+{
+       return DMA_IN(fsl_chan, &fsl_chan->reg_base->ndar, 64);
+}
+
+static int dma_is_idle(struct fsl_dma_chan *fsl_chan)
+{
+       u32 sr = get_sr(fsl_chan);
+       return (!(sr & FSL_DMA_SR_CB)) || (sr & FSL_DMA_SR_CH);
+}
+
+static void dma_start(struct fsl_dma_chan *fsl_chan)
+{
+       u32 mr_set = 0;;
+
+       if (fsl_chan->feature & FSL_DMA_CHAN_PAUSE_EXT) {
+               DMA_OUT(fsl_chan, &fsl_chan->reg_base->bcr, 0, 32);
+               mr_set |= FSL_DMA_MR_EMP_EN;
+       } else
+               DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr,
+                       DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32)
+                               & ~FSL_DMA_MR_EMP_EN, 32);
+
+       if (fsl_chan->feature & FSL_DMA_CHAN_START_EXT)
+               mr_set |= FSL_DMA_MR_EMS_EN;
+       else
+               mr_set |= FSL_DMA_MR_CS;
+
+       DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr,
+                       DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32)
+                       | mr_set, 32);
+}
+
+static void dma_halt(struct fsl_dma_chan *fsl_chan)
+{
+       int i = 0;
+       DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr,
+               DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) | FSL_DMA_MR_CA,
+               32);
+       DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr,
+               DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) & ~(FSL_DMA_MR_CS
+               | FSL_DMA_MR_EMS_EN | FSL_DMA_MR_CA), 32);
+
+       while (!dma_is_idle(fsl_chan) && (i++ < 100))
+               udelay(10);
+       if (i >= 100 && !dma_is_idle(fsl_chan))
+               dev_err(fsl_chan->dev, "DMA halt timeout!\n");
+}
+
+static void set_ld_eol(struct fsl_dma_chan *fsl_chan,
+                       struct fsl_desc_sw *desc)
+{
+       desc->hw.next_ln_addr = CPU_TO_DMA(fsl_chan,
+               DMA_TO_CPU(fsl_chan, desc->hw.next_ln_addr, 64) | FSL_DMA_EOL,
+               64);
+}
+
+static void append_ld_queue(struct fsl_dma_chan *fsl_chan,
+               struct fsl_desc_sw *new_desc)
+{
+       struct fsl_desc_sw *queue_tail = to_fsl_desc(fsl_chan->ld_queue.prev);
+
+       if (list_empty(&fsl_chan->ld_queue))
+               return;
+
+       /* Link to the new descriptor physical address and
+        * Enable End-of-segment interrupt for
+        * the last link descriptor.
+        * (the previous node's next link descriptor)
+        *
+        * For FSL_DMA_IP_83xx, the snoop enable bit need be set.
+        */
+       queue_tail->hw.next_ln_addr = CPU_TO_DMA(fsl_chan,
+                       new_desc->async_tx.phys | FSL_DMA_EOSIE |
+                       (((fsl_chan->feature & FSL_DMA_IP_MASK)
+                               == FSL_DMA_IP_83XX) ? FSL_DMA_SNEN : 0), 64);
+}
+
+/**
+ * fsl_chan_set_src_loop_size - Set source address hold transfer size
+ * @fsl_chan : Freescale DMA channel
+ * @size     : Address loop size, 0 for disable loop
+ *
+ * The set source address hold transfer size. The source
+ * address hold or loop transfer size is when the DMA transfer
+ * data from source address (SA), if the loop size is 4, the DMA will
+ * read data from SA, SA + 1, SA + 2, SA + 3, then loop back to SA,
+ * SA + 1 ... and so on.
+ */
+static void fsl_chan_set_src_loop_size(struct fsl_dma_chan *fsl_chan, int size)
+{
+       switch (size) {
+       case 0:
+               DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr,
+                       DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) &
+                       (~FSL_DMA_MR_SAHE), 32);
+               break;
+       case 1:
+       case 2:
+       case 4:
+       case 8:
+               DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr,
+                       DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) |
+                       FSL_DMA_MR_SAHE | (__ilog2(size) << 14),
+                       32);
+               break;
+       }
+}
+
+/**
+ * fsl_chan_set_dest_loop_size - Set destination address hold transfer size
+ * @fsl_chan : Freescale DMA channel
+ * @size     : Address loop size, 0 for disable loop
+ *
+ * The set destination address hold transfer size. The destination
+ * address hold or loop transfer size is when the DMA transfer
+ * data to destination address (TA), if the loop size is 4, the DMA will
+ * write data to TA, TA + 1, TA + 2, TA + 3, then loop back to TA,
+ * TA + 1 ... and so on.
+ */
+static void fsl_chan_set_dest_loop_size(struct fsl_dma_chan *fsl_chan, int size)
+{
+       switch (size) {
+       case 0:
+               DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr,
+                       DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) &
+                       (~FSL_DMA_MR_DAHE), 32);
+               break;
+       case 1:
+       case 2:
+       case 4:
+       case 8:
+               DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr,
+                       DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) |
+                       FSL_DMA_MR_DAHE | (__ilog2(size) << 16),
+                       32);
+               break;
+       }
+}
+
+/**
+ * fsl_chan_toggle_ext_pause - Toggle channel external pause status
+ * @fsl_chan : Freescale DMA channel
+ * @size     : Pause control size, 0 for disable external pause control.
+ *             The maximum is 1024.
+ *
+ * The Freescale DMA channel can be controlled by the external
+ * signal DREQ#. The pause control size is how many bytes are allowed
+ * to transfer before pausing the channel, after which a new assertion
+ * of DREQ# resumes channel operation.
+ */
+static void fsl_chan_toggle_ext_pause(struct fsl_dma_chan *fsl_chan, int size)
+{
+       if (size > 1024)
+               return;
+
+       if (size) {
+               DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr,
+                       DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32)
+                               | ((__ilog2(size) << 24) & 0x0f000000),
+                       32);
+               fsl_chan->feature |= FSL_DMA_CHAN_PAUSE_EXT;
+       } else
+               fsl_chan->feature &= ~FSL_DMA_CHAN_PAUSE_EXT;
+}
+
+/**
+ * fsl_chan_toggle_ext_start - Toggle channel external start status
+ * @fsl_chan : Freescale DMA channel
+ * @enable   : 0 is disabled, 1 is enabled.
+ *
+ * If enable the external start, the channel can be started by an
+ * external DMA start pin. So the dma_start() does not start the
+ * transfer immediately. The DMA channel will wait for the
+ * control pin asserted.
+ */
+static void fsl_chan_toggle_ext_start(struct fsl_dma_chan *fsl_chan, int enable)
+{
+       if (enable)
+               fsl_chan->feature |= FSL_DMA_CHAN_START_EXT;
+       else
+               fsl_chan->feature &= ~FSL_DMA_CHAN_START_EXT;
+}
+
+static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx)
+{
+       struct fsl_desc_sw *desc = tx_to_fsl_desc(tx);
+       struct fsl_dma_chan *fsl_chan = to_fsl_chan(tx->chan);
+       unsigned long flags;
+       dma_cookie_t cookie;
+
+       /* cookie increment and adding to ld_queue must be atomic */
+       spin_lock_irqsave(&fsl_chan->desc_lock, flags);
+
+       cookie = fsl_chan->common.cookie;
+       cookie++;
+       if (cookie < 0)
+               cookie = 1;
+       desc->async_tx.cookie = cookie;
+       fsl_chan->common.cookie = desc->async_tx.cookie;
+
+       append_ld_queue(fsl_chan, desc);
+       list_splice_init(&desc->async_tx.tx_list, fsl_chan->ld_queue.prev);
+
+       spin_unlock_irqrestore(&fsl_chan->desc_lock, flags);
+
+       return cookie;
+}
+
+/**
+ * fsl_dma_alloc_descriptor - Allocate descriptor from channel's DMA pool.
+ * @fsl_chan : Freescale DMA channel
+ *
+ * Return - The descriptor allocated. NULL for failed.
+ */
+static struct fsl_desc_sw *fsl_dma_alloc_descriptor(
+                                       struct fsl_dma_chan *fsl_chan)
+{
+       dma_addr_t pdesc;
+       struct fsl_desc_sw *desc_sw;
+
+       desc_sw = dma_pool_alloc(fsl_chan->desc_pool, GFP_ATOMIC, &pdesc);
+       if (desc_sw) {
+               memset(desc_sw, 0, sizeof(struct fsl_desc_sw));
+               dma_async_tx_descriptor_init(&desc_sw->async_tx,
+                                               &fsl_chan->common);
+               desc_sw->async_tx.tx_submit = fsl_dma_tx_submit;
+               INIT_LIST_HEAD(&desc_sw->async_tx.tx_list);
+               desc_sw->async_tx.phys = pdesc;
+       }
+
+       return desc_sw;
+}
+
+
+/**
+ * fsl_dma_alloc_chan_resources - Allocate resources for DMA channel.
+ * @fsl_chan : Freescale DMA channel
+ *
+ * This function will create a dma pool for descriptor allocation.
+ *
+ * Return - The number of descriptors allocated.
+ */
+static int fsl_dma_alloc_chan_resources(struct dma_chan *chan)
+{
+       struct fsl_dma_chan *fsl_chan = to_fsl_chan(chan);
+       LIST_HEAD(tmp_list);
+
+       /* We need the descriptor to be aligned to 32bytes
+        * for meeting FSL DMA specification requirement.
+        */
+       fsl_chan->desc_pool = dma_pool_create("fsl_dma_engine_desc_pool",
+                       fsl_chan->dev, sizeof(struct fsl_desc_sw),
+                       32, 0);
+       if (!fsl_chan->desc_pool) {
+               dev_err(fsl_chan->dev, "No memory for channel %d "
+                       "descriptor dma pool.\n", fsl_chan->id);
+               return 0;
+       }
+
+       return 1;
+}
+
+/**
+ * fsl_dma_free_chan_resources - Free all resources of the channel.
+ * @fsl_chan : Freescale DMA channel
+ */
+static void fsl_dma_free_chan_resources(struct dma_chan *chan)
+{
+       struct fsl_dma_chan *fsl_chan = to_fsl_chan(chan);
+       struct fsl_desc_sw *desc, *_desc;
+       unsigned long flags;
+
+       dev_dbg(fsl_chan->dev, "Free all channel resources.\n");
+       spin_lock_irqsave(&fsl_chan->desc_lock, flags);
+       list_for_each_entry_safe(desc, _desc, &fsl_chan->ld_queue, node) {
+#ifdef FSL_DMA_LD_DEBUG
+               dev_dbg(fsl_chan->dev,
+                               "LD %p will be released.\n", desc);
+#endif
+               list_del(&desc->node);
+               /* free link descriptor */
+               dma_pool_free(fsl_chan->desc_pool, desc, desc->async_tx.phys);
+       }
+       spin_unlock_irqrestore(&fsl_chan->desc_lock, flags);
+       dma_pool_destroy(fsl_chan->desc_pool);
+}
+
+static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy(
+       struct dma_chan *chan, dma_addr_t dma_dest, dma_addr_t dma_src,
+       size_t len, unsigned long flags)
+{
+       struct fsl_dma_chan *fsl_chan;
+       struct fsl_desc_sw *first = NULL, *prev = NULL, *new;
+       size_t copy;
+       LIST_HEAD(link_chain);
+
+       if (!chan)
+               return NULL;
+
+       if (!len)
+               return NULL;
+
+       fsl_chan = to_fsl_chan(chan);
+
+       do {
+
+               /* Allocate the link descriptor from DMA pool */
+               new = fsl_dma_alloc_descriptor(fsl_chan);
+               if (!new) {
+                       dev_err(fsl_chan->dev,
+                                       "No free memory for link descriptor\n");
+                       return NULL;
+               }
+#ifdef FSL_DMA_LD_DEBUG
+               dev_dbg(fsl_chan->dev, "new link desc alloc %p\n", new);
+#endif
+
+               copy = min(len, FSL_DMA_BCR_MAX_CNT);
+
+               set_desc_cnt(fsl_chan, &new->hw, copy);
+               set_desc_src(fsl_chan, &new->hw, dma_src);
+               set_desc_dest(fsl_chan, &new->hw, dma_dest);
+
+               if (!first)
+                       first = new;
+               else
+                       set_desc_next(fsl_chan, &prev->hw, new->async_tx.phys);
+
+               new->async_tx.cookie = 0;
+               new->async_tx.ack = 1;
+
+               prev = new;
+               len -= copy;
+               dma_src += copy;
+               dma_dest += copy;
+
+               /* Insert the link descriptor to the LD ring */
+               list_add_tail(&new->node, &first->async_tx.tx_list);
+       } while (len);
+
+       new->async_tx.ack = 0; /* client is in control of this ack */
+       new->async_tx.cookie = -EBUSY;
+
+       /* Set End-of-link to the last link descriptor of new list*/
+       set_ld_eol(fsl_chan, new);
+
+       return first ? &first->async_tx : NULL;
+}
+
+/**
+ * fsl_dma_update_completed_cookie - Update the completed cookie.
+ * @fsl_chan : Freescale DMA channel
+ */
+static void fsl_dma_update_completed_cookie(struct fsl_dma_chan *fsl_chan)
+{
+       struct fsl_desc_sw *cur_desc, *desc;
+       dma_addr_t ld_phy;
+
+       ld_phy = get_cdar(fsl_chan) & FSL_DMA_NLDA_MASK;
+
+       if (ld_phy) {
+               cur_desc = NULL;
+               list_for_each_entry(desc, &fsl_chan->ld_queue, node)
+                       if (desc->async_tx.phys == ld_phy) {
+                               cur_desc = desc;
+                               break;
+                       }
+
+               if (cur_desc && cur_desc->async_tx.cookie) {
+                       if (dma_is_idle(fsl_chan))
+                               fsl_chan->completed_cookie =
+                                       cur_desc->async_tx.cookie;
+                       else
+                               fsl_chan->completed_cookie =
+                                       cur_desc->async_tx.cookie - 1;
+               }
+       }
+}
+
+/**
+ * fsl_chan_ld_cleanup - Clean up link descriptors
+ * @fsl_chan : Freescale DMA channel
+ *
+ * This function clean up the ld_queue of DMA channel.
+ * If 'in_intr' is set, the function will move the link descriptor to
+ * the recycle list. Otherwise, free it directly.
+ */
+static void fsl_chan_ld_cleanup(struct fsl_dma_chan *fsl_chan)
+{
+       struct fsl_desc_sw *desc, *_desc;
+       unsigned long flags;
+
+       spin_lock_irqsave(&fsl_chan->desc_lock, flags);
+
+       fsl_dma_update_completed_cookie(fsl_chan);
+       dev_dbg(fsl_chan->dev, "chan completed_cookie = %d\n",
+                       fsl_chan->completed_cookie);
+       list_for_each_entry_safe(desc, _desc, &fsl_chan->ld_queue, node) {
+               dma_async_tx_callback callback;
+               void *callback_param;
+
+               if (dma_async_is_complete(desc->async_tx.cookie,
+                           fsl_chan->completed_cookie, fsl_chan->common.cookie)
+                               == DMA_IN_PROGRESS)
+                       break;
+
+               callback = desc->async_tx.callback;
+               callback_param = desc->async_tx.callback_param;
+
+               /* Remove from ld_queue list */
+               list_del(&desc->node);
+
+               dev_dbg(fsl_chan->dev, "link descriptor %p will be recycle.\n",
+                               desc);
+               dma_pool_free(fsl_chan->desc_pool, desc, desc->async_tx.phys);
+
+               /* Run the link descriptor callback function */
+               if (callback) {
+                       spin_unlock_irqrestore(&fsl_chan->desc_lock, flags);
+                       dev_dbg(fsl_chan->dev, "link descriptor %p callback\n",
+                                       desc);
+                       callback(callback_param);
+                       spin_lock_irqsave(&fsl_chan->desc_lock, flags);
+               }
+       }
+       spin_unlock_irqrestore(&fsl_chan->desc_lock, flags);
+}
+
+/**
+ * fsl_chan_xfer_ld_queue - Transfer link descriptors in channel ld_queue.
+ * @fsl_chan : Freescale DMA channel
+ */
+static void fsl_chan_xfer_ld_queue(struct fsl_dma_chan *fsl_chan)
+{
+       struct list_head *ld_node;
+       dma_addr_t next_dest_addr;
+       unsigned long flags;
+
+       if (!dma_is_idle(fsl_chan))
+               return;
+
+       dma_halt(fsl_chan);
+
+       /* If there are some link descriptors
+        * not transfered in queue. We need to start it.
+        */
+       spin_lock_irqsave(&fsl_chan->desc_lock, flags);
+
+       /* Find the first un-transfer desciptor */
+       for (ld_node = fsl_chan->ld_queue.next;
+               (ld_node != &fsl_chan->ld_queue)
+                       && (dma_async_is_complete(
+                               to_fsl_desc(ld_node)->async_tx.cookie,
+                               fsl_chan->completed_cookie,
+                               fsl_chan->common.cookie) == DMA_SUCCESS);
+               ld_node = ld_node->next);
+
+       spin_unlock_irqrestore(&fsl_chan->desc_lock, flags);
+
+       if (ld_node != &fsl_chan->ld_queue) {
+               /* Get the ld start address from ld_queue */
+               next_dest_addr = to_fsl_desc(ld_node)->async_tx.phys;
+               dev_dbg(fsl_chan->dev, "xfer LDs staring from 0x%016llx\n",
+                               (u64)next_dest_addr);
+               set_cdar(fsl_chan, next_dest_addr);
+               dma_start(fsl_chan);
+       } else {
+               set_cdar(fsl_chan, 0);
+               set_ndar(fsl_chan, 0);
+       }
+}
+
+/**
+ * fsl_dma_memcpy_issue_pending - Issue the DMA start command
+ * @fsl_chan : Freescale DMA channel
+ */
+static void fsl_dma_memcpy_issue_pending(struct dma_chan *chan)
+{
+       struct fsl_dma_chan *fsl_chan = to_fsl_chan(chan);
+
+#ifdef FSL_DMA_LD_DEBUG
+       struct fsl_desc_sw *ld;
+       unsigned long flags;
+
+       spin_lock_irqsave(&fsl_chan->desc_lock, flags);
+       if (list_empty(&fsl_chan->ld_queue)) {
+               spin_unlock_irqrestore(&fsl_chan->desc_lock, flags);
+               return;
+       }
+
+       dev_dbg(fsl_chan->dev, "--memcpy issue--\n");
+       list_for_each_entry(ld, &fsl_chan->ld_queue, node) {
+               int i;
+               dev_dbg(fsl_chan->dev, "Ch %d, LD %08x\n",
+                               fsl_chan->id, ld->async_tx.phys);
+               for (i = 0; i < 8; i++)
+                       dev_dbg(fsl_chan->dev, "LD offset %d: %08x\n",
+                                       i, *(((u32 *)&ld->hw) + i));
+       }
+       dev_dbg(fsl_chan->dev, "----------------\n");
+       spin_unlock_irqrestore(&fsl_chan->desc_lock, flags);
+#endif
+
+       fsl_chan_xfer_ld_queue(fsl_chan);
+}
+
+static void fsl_dma_dependency_added(struct dma_chan *chan)
+{
+       struct fsl_dma_chan *fsl_chan = to_fsl_chan(chan);
+
+       fsl_chan_ld_cleanup(fsl_chan);
+}
+
+/**
+ * fsl_dma_is_complete - Determine the DMA status
+ * @fsl_chan : Freescale DMA channel
+ */
+static enum dma_status fsl_dma_is_complete(struct dma_chan *chan,
+                                       dma_cookie_t cookie,
+                                       dma_cookie_t *done,
+                                       dma_cookie_t *used)
+{
+       struct fsl_dma_chan *fsl_chan = to_fsl_chan(chan);
+       dma_cookie_t last_used;
+       dma_cookie_t last_complete;
+
+       fsl_chan_ld_cleanup(fsl_chan);
+
+       last_used = chan->cookie;
+       last_complete = fsl_chan->completed_cookie;
+
+       if (done)
+               *done = last_complete;
+
+       if (used)
+               *used = last_used;
+
+       return dma_async_is_complete(cookie, last_complete, last_used);
+}
+
+static irqreturn_t fsl_dma_chan_do_interrupt(int irq, void *data)
+{
+       struct fsl_dma_chan *fsl_chan = (struct fsl_dma_chan *)data;
+       dma_addr_t stat;
+
+       stat = get_sr(fsl_chan);
+       dev_dbg(fsl_chan->dev, "event: channel %d, stat = 0x%x\n",
+                                               fsl_chan->id, stat);
+       set_sr(fsl_chan, stat);         /* Clear the event register */
+
+       stat &= ~(FSL_DMA_SR_CB | FSL_DMA_SR_CH);
+       if (!stat)
+               return IRQ_NONE;
+
+       if (stat & FSL_DMA_SR_TE)
+               dev_err(fsl_chan->dev, "Transfer Error!\n");
+
+       /* If the link descriptor segment transfer finishes,
+        * we will recycle the used descriptor.
+        */
+       if (stat & FSL_DMA_SR_EOSI) {
+               dev_dbg(fsl_chan->dev, "event: End-of-segments INT\n");
+               dev_dbg(fsl_chan->dev, "event: clndar 0x%016llx, "
+                               "nlndar 0x%016llx\n", (u64)get_cdar(fsl_chan),
+                               (u64)get_ndar(fsl_chan));
+               stat &= ~FSL_DMA_SR_EOSI;
+       }
+
+       /* If it current transfer is the end-of-transfer,
+        * we should clear the Channel Start bit for
+        * prepare next transfer.
+        */
+       if (stat & (FSL_DMA_SR_EOLNI | FSL_DMA_SR_EOCDI)) {
+               dev_dbg(fsl_chan->dev, "event: End-of-link INT\n");
+               stat &= ~FSL_DMA_SR_EOLNI;
+               fsl_chan_xfer_ld_queue(fsl_chan);
+       }
+
+       if (stat)
+               dev_dbg(fsl_chan->dev, "event: unhandled sr 0x%02x\n",
+                                       stat);
+
+       dev_dbg(fsl_chan->dev, "event: Exit\n");
+       tasklet_schedule(&fsl_chan->tasklet);
+       return IRQ_HANDLED;
+}
+
+static irqreturn_t fsl_dma_do_interrupt(int irq, void *data)
+{
+       struct fsl_dma_device *fdev = (struct fsl_dma_device *)data;
+       u32 gsr;
+       int ch_nr;
+
+       gsr = (fdev->feature & FSL_DMA_BIG_ENDIAN) ? in_be32(fdev->reg_base)
+                       : in_le32(fdev->reg_base);
+       ch_nr = (32 - ffs(gsr)) / 8;
+
+       return fdev->chan[ch_nr] ? fsl_dma_chan_do_interrupt(irq,
+                       fdev->chan[ch_nr]) : IRQ_NONE;
+}
+
+static void dma_do_tasklet(unsigned long data)
+{
+       struct fsl_dma_chan *fsl_chan = (struct fsl_dma_chan *)data;
+       fsl_chan_ld_cleanup(fsl_chan);
+}
+
+static void fsl_dma_callback_test(struct fsl_dma_chan *fsl_chan)
+{
+       if (fsl_chan)
+               dev_info(fsl_chan->dev, "selftest: callback is ok!\n");
+}
+
+static int fsl_dma_self_test(struct fsl_dma_chan *fsl_chan)
+{
+       struct dma_chan *chan;
+       int err = 0;
+       dma_addr_t dma_dest, dma_src;
+       dma_cookie_t cookie;
+       u8 *src, *dest;
+       int i;
+       size_t test_size;
+       struct dma_async_tx_descriptor *tx1, *tx2, *tx3;
+
+       test_size = 4096;
+
+       src = kmalloc(test_size * 2, GFP_KERNEL);
+       if (!src) {
+               dev_err(fsl_chan->dev,
+                               "selftest: Cannot alloc memory for test!\n");
+               err = -ENOMEM;
+               goto out;
+       }
+
+       dest = src + test_size;
+
+       for (i = 0; i < test_size; i++)
+               src[i] = (u8) i;
+
+       chan = &fsl_chan->common;
+
+       if (fsl_dma_alloc_chan_resources(chan) < 1) {
+               dev_err(fsl_chan->dev,
+                               "selftest: Cannot alloc resources for DMA\n");
+               err = -ENODEV;
+               goto out;
+       }
+
+       /* TX 1 */
+       dma_src = dma_map_single(fsl_chan->dev, src, test_size / 2,
+                                DMA_TO_DEVICE);
+       dma_dest = dma_map_single(fsl_chan->dev, dest, test_size / 2,
+                                 DMA_FROM_DEVICE);
+       tx1 = fsl_dma_prep_memcpy(chan, dma_dest, dma_src, test_size / 2, 0);
+       async_tx_ack(tx1);
+
+       cookie = fsl_dma_tx_submit(tx1);
+       fsl_dma_memcpy_issue_pending(chan);
+       msleep(2);
+
+       if (fsl_dma_is_complete(chan, cookie, NULL, NULL) != DMA_SUCCESS) {
+               dev_err(fsl_chan->dev, "selftest: Time out!\n");
+               err = -ENODEV;
+               goto out;
+       }
+
+       /* Test free and re-alloc channel resources */
+       fsl_dma_free_chan_resources(chan);
+
+       if (fsl_dma_alloc_chan_resources(chan) < 1) {
+               dev_err(fsl_chan->dev,
+                               "selftest: Cannot alloc resources for DMA\n");
+               err = -ENODEV;
+               goto free_resources;
+       }
+
+       /* Continue to test
+        * TX 2
+        */
+       dma_src = dma_map_single(fsl_chan->dev, src + test_size / 2,
+                                       test_size / 4, DMA_TO_DEVICE);
+       dma_dest = dma_map_single(fsl_chan->dev, dest + test_size / 2,
+                                       test_size / 4, DMA_FROM_DEVICE);
+       tx2 = fsl_dma_prep_memcpy(chan, dma_dest, dma_src, test_size / 4, 0);
+       async_tx_ack(tx2);
+
+       /* TX 3 */
+       dma_src = dma_map_single(fsl_chan->dev, src + test_size * 3 / 4,
+                                       test_size / 4, DMA_TO_DEVICE);
+       dma_dest = dma_map_single(fsl_chan->dev, dest + test_size * 3 / 4,
+                                       test_size / 4, DMA_FROM_DEVICE);
+       tx3 = fsl_dma_prep_memcpy(chan, dma_dest, dma_src, test_size / 4, 0);
+       async_tx_ack(tx3);
+
+       /* Test exchanging the prepared tx sort */
+       cookie = fsl_dma_tx_submit(tx3);
+       cookie = fsl_dma_tx_submit(tx2);
+
+#ifdef FSL_DMA_CALLBACKTEST
+       if (dma_has_cap(DMA_INTERRUPT, ((struct fsl_dma_device *)
+           dev_get_drvdata(fsl_chan->dev->parent))->common.cap_mask)) {
+               tx3->callback = fsl_dma_callback_test;
+               tx3->callback_param = fsl_chan;
+       }
+#endif
+       fsl_dma_memcpy_issue_pending(chan);
+       msleep(2);
+
+       if (fsl_dma_is_complete(chan, cookie, NULL, NULL) != DMA_SUCCESS) {
+               dev_err(fsl_chan->dev, "selftest: Time out!\n");
+               err = -ENODEV;
+               goto free_resources;
+       }
+
+       err = memcmp(src, dest, test_size);
+       if (err) {
+               for (i = 0; (*(src + i) == *(dest + i)) && (i < test_size);
+                               i++);
+               dev_err(fsl_chan->dev, "selftest: Test failed, data %d/%d is "
+                               "error! src 0x%x, dest 0x%x\n",
+                               i, test_size, *(src + i), *(dest + i));
+       }
+
+free_resources:
+       fsl_dma_free_chan_resources(chan);
+out:
+       kfree(src);
+       return err;
+}
+
+static int __devinit of_fsl_dma_chan_probe(struct of_device *dev,
+                       const struct of_device_id *match)
+{
+       struct fsl_dma_device *fdev;
+       struct fsl_dma_chan *new_fsl_chan;
+       int err;
+
+       fdev = dev_get_drvdata(dev->dev.parent);
+       BUG_ON(!fdev);
+
+       /* alloc channel */
+       new_fsl_chan = kzalloc(sizeof(struct fsl_dma_chan), GFP_KERNEL);
+       if (!new_fsl_chan) {
+               dev_err(&dev->dev, "No free memory for allocating "
+                               "dma channels!\n");
+               err = -ENOMEM;
+               goto err;
+       }
+
+       /* get dma channel register base */
+       err = of_address_to_resource(dev->node, 0, &new_fsl_chan->reg);
+       if (err) {
+               dev_err(&dev->dev, "Can't get %s property 'reg'\n",
+                               dev->node->full_name);
+               goto err;
+       }
+
+       new_fsl_chan->feature = *(u32 *)match->data;
+
+       if (!fdev->feature)
+               fdev->feature = new_fsl_chan->feature;
+
+       /* If the DMA device's feature is different than its channels',
+        * report the bug.
+        */
+       WARN_ON(fdev->feature != new_fsl_chan->feature);
+
+       new_fsl_chan->dev = &dev->dev;
+       new_fsl_chan->reg_base = ioremap(new_fsl_chan->reg.start,
+                       new_fsl_chan->reg.end - new_fsl_chan->reg.start + 1);
+
+       new_fsl_chan->id = ((new_fsl_chan->reg.start - 0x100) & 0xfff) >> 7;
+       if (new_fsl_chan->id > FSL_DMA_MAX_CHANS_PER_DEVICE) {
+               dev_err(&dev->dev, "There is no %d channel!\n",
+                               new_fsl_chan->id);
+               err = -EINVAL;
+               goto err;
+       }
+       fdev->chan[new_fsl_chan->id] = new_fsl_chan;
+       tasklet_init(&new_fsl_chan->tasklet, dma_do_tasklet,
+                       (unsigned long)new_fsl_chan);
+
+       /* Init the channel */
+       dma_init(new_fsl_chan);
+
+       /* Clear cdar registers */
+       set_cdar(new_fsl_chan, 0);
+
+       switch (new_fsl_chan->feature & FSL_DMA_IP_MASK) {
+       case FSL_DMA_IP_85XX:
+               new_fsl_chan->toggle_ext_start = fsl_chan_toggle_ext_start;
+               new_fsl_chan->toggle_ext_pause = fsl_chan_toggle_ext_pause;
+       case FSL_DMA_IP_83XX:
+               new_fsl_chan->set_src_loop_size = fsl_chan_set_src_loop_size;
+               new_fsl_chan->set_dest_loop_size = fsl_chan_set_dest_loop_size;
+       }
+
+       spin_lock_init(&new_fsl_chan->desc_lock);
+       INIT_LIST_HEAD(&new_fsl_chan->ld_queue);
+
+       new_fsl_chan->common.device = &fdev->common;
+
+       /* Add the channel to DMA device channel list */
+       list_add_tail(&new_fsl_chan->common.device_node,
+                       &fdev->common.channels);
+       fdev->common.chancnt++;
+
+       new_fsl_chan->irq = irq_of_parse_and_map(dev->node, 0);
+       if (new_fsl_chan->irq != NO_IRQ) {
+               err = request_irq(new_fsl_chan->irq,
+                                       &fsl_dma_chan_do_interrupt, IRQF_SHARED,
+                                       "fsldma-channel", new_fsl_chan);
+               if (err) {
+                       dev_err(&dev->dev, "DMA channel %s request_irq error "
+                               "with return %d\n", dev->node->full_name, err);
+                       goto err;
+               }
+       }
+
+#ifdef CONFIG_FSL_DMA_SELFTEST
+       err = fsl_dma_self_test(new_fsl_chan);
+       if (err)
+               goto err;
+#endif
+
+       dev_info(&dev->dev, "#%d (%s), irq %d\n", new_fsl_chan->id,
+                               match->compatible, new_fsl_chan->irq);
+
+       return 0;
+err:
+       dma_halt(new_fsl_chan);
+       iounmap(new_fsl_chan->reg_base);
+       free_irq(new_fsl_chan->irq, new_fsl_chan);
+       list_del(&new_fsl_chan->common.device_node);
+       kfree(new_fsl_chan);
+       return err;
+}
+
+const u32 mpc8540_dma_ip_feature = FSL_DMA_IP_85XX | FSL_DMA_BIG_ENDIAN;
+const u32 mpc8349_dma_ip_feature = FSL_DMA_IP_83XX | FSL_DMA_LITTLE_ENDIAN;
+
+static struct of_device_id of_fsl_dma_chan_ids[] = {
+       {
+               .compatible = "fsl,mpc8540-dma-channel",
+               .data = (void *)&mpc8540_dma_ip_feature,
+       },
+       {
+               .compatible = "fsl,mpc8349-dma-channel",
+               .data = (void *)&mpc8349_dma_ip_feature,
+       },
+       {}
+};
+
+static struct of_platform_driver of_fsl_dma_chan_driver = {
+       .name = "of-fsl-dma-channel",
+       .match_table = of_fsl_dma_chan_ids,
+       .probe = of_fsl_dma_chan_probe,
+};
+
+static __init int of_fsl_dma_chan_init(void)
+{
+       return of_register_platform_driver(&of_fsl_dma_chan_driver);
+}
+
+static int __devinit of_fsl_dma_probe(struct of_device *dev,
+                       const struct of_device_id *match)
+{
+       int err;
+       unsigned int irq;
+       struct fsl_dma_device *fdev;
+
+       fdev = kzalloc(sizeof(struct fsl_dma_device), GFP_KERNEL);
+       if (!fdev) {
+               dev_err(&dev->dev, "No enough memory for 'priv'\n");
+               err = -ENOMEM;
+               goto err;
+       }
+       fdev->dev = &dev->dev;
+       INIT_LIST_HEAD(&fdev->common.channels);
+
+       /* get DMA controller register base */
+       err = of_address_to_resource(dev->node, 0, &fdev->reg);
+       if (err) {
+               dev_err(&dev->dev, "Can't get %s property 'reg'\n",
+                               dev->node->full_name);
+               goto err;
+       }
+
+       dev_info(&dev->dev, "Probe the Freescale DMA driver for %s "
+                       "controller at 0x%08x...\n",
+                       match->compatible, fdev->reg.start);
+       fdev->reg_base = ioremap(fdev->reg.start, fdev->reg.end
+                                               - fdev->reg.start + 1);
+
+       dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask);
+       dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask);
+       fdev->common.device_alloc_chan_resources = fsl_dma_alloc_chan_resources;
+       fdev->common.device_free_chan_resources = fsl_dma_free_chan_resources;
+       fdev->common.device_prep_dma_memcpy = fsl_dma_prep_memcpy;
+       fdev->common.device_is_tx_complete = fsl_dma_is_complete;
+       fdev->common.device_issue_pending = fsl_dma_memcpy_issue_pending;
+       fdev->common.device_dependency_added = fsl_dma_dependency_added;
+       fdev->common.dev = &dev->dev;
+
+       irq = irq_of_parse_and_map(dev->node, 0);
+       if (irq != NO_IRQ) {
+               err = request_irq(irq, &fsl_dma_do_interrupt, IRQF_SHARED,
+                                       "fsldma-device", fdev);
+               if (err) {
+                       dev_err(&dev->dev, "DMA device request_irq error "
+                               "with return %d\n", err);
+                       goto err;
+               }
+       }
+
+       dev_set_drvdata(&(dev->dev), fdev);
+       of_platform_bus_probe(dev->node, of_fsl_dma_chan_ids, &dev->dev);
+
+       dma_async_device_register(&fdev->common);
+       return 0;
+
+err:
+       iounmap(fdev->reg_base);
+       kfree(fdev);
+       return err;
+}
+
+static struct of_device_id of_fsl_dma_ids[] = {
+       { .compatible = "fsl,mpc8540-dma", },
+       { .compatible = "fsl,mpc8349-dma", },
+       {}
+};
+
+static struct of_platform_driver of_fsl_dma_driver = {
+       .name = "of-fsl-dma",
+       .match_table = of_fsl_dma_ids,
+       .probe = of_fsl_dma_probe,
+};
+
+static __init int of_fsl_dma_init(void)
+{
+       return of_register_platform_driver(&of_fsl_dma_driver);
+}
+
+subsys_initcall(of_fsl_dma_chan_init);
+subsys_initcall(of_fsl_dma_init);
diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h
new file mode 100644 (file)
index 0000000..ba78c42
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ *
+ * Author:
+ *   Zhang Wei <wei.zhang@freescale.com>, Jul 2007
+ *   Ebony Zhu <ebony.zhu@freescale.com>, May 2007
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ */
+#ifndef __DMA_FSLDMA_H
+#define __DMA_FSLDMA_H
+
+#include <linux/device.h>
+#include <linux/dmapool.h>
+#include <linux/dmaengine.h>
+
+/* Define data structures needed by Freescale
+ * MPC8540 and MPC8349 DMA controller.
+ */
+#define FSL_DMA_MR_CS          0x00000001
+#define FSL_DMA_MR_CC          0x00000002
+#define FSL_DMA_MR_CA          0x00000008
+#define FSL_DMA_MR_EIE         0x00000040
+#define FSL_DMA_MR_XFE         0x00000020
+#define FSL_DMA_MR_EOLNIE      0x00000100
+#define FSL_DMA_MR_EOLSIE      0x00000080
+#define FSL_DMA_MR_EOSIE       0x00000200
+#define FSL_DMA_MR_CDSM                0x00000010
+#define FSL_DMA_MR_CTM         0x00000004
+#define FSL_DMA_MR_EMP_EN      0x00200000
+#define FSL_DMA_MR_EMS_EN      0x00040000
+#define FSL_DMA_MR_DAHE                0x00002000
+#define FSL_DMA_MR_SAHE                0x00001000
+
+/* Special MR definition for MPC8349 */
+#define FSL_DMA_MR_EOTIE       0x00000080
+
+#define FSL_DMA_SR_CH          0x00000020
+#define FSL_DMA_SR_CB          0x00000004
+#define FSL_DMA_SR_TE          0x00000080
+#define FSL_DMA_SR_EOSI                0x00000002
+#define FSL_DMA_SR_EOLSI       0x00000001
+#define FSL_DMA_SR_EOCDI       0x00000001
+#define FSL_DMA_SR_EOLNI       0x00000008
+
+#define FSL_DMA_SATR_SBPATMU                   0x20000000
+#define FSL_DMA_SATR_STRANSINT_RIO             0x00c00000
+#define FSL_DMA_SATR_SREADTYPE_SNOOP_READ      0x00050000
+#define FSL_DMA_SATR_SREADTYPE_BP_IORH         0x00020000
+#define FSL_DMA_SATR_SREADTYPE_BP_NREAD                0x00040000
+#define FSL_DMA_SATR_SREADTYPE_BP_MREAD                0x00070000
+
+#define FSL_DMA_DATR_DBPATMU                   0x20000000
+#define FSL_DMA_DATR_DTRANSINT_RIO             0x00c00000
+#define FSL_DMA_DATR_DWRITETYPE_SNOOP_WRITE    0x00050000
+#define FSL_DMA_DATR_DWRITETYPE_BP_FLUSH       0x00010000
+
+#define FSL_DMA_EOL            ((u64)0x1)
+#define FSL_DMA_SNEN           ((u64)0x10)
+#define FSL_DMA_EOSIE          0x8
+#define FSL_DMA_NLDA_MASK      (~(u64)0x1f)
+
+#define FSL_DMA_BCR_MAX_CNT    0x03ffffffu
+
+#define FSL_DMA_DGSR_TE                0x80
+#define FSL_DMA_DGSR_CH                0x20
+#define FSL_DMA_DGSR_PE                0x10
+#define FSL_DMA_DGSR_EOLNI     0x08
+#define FSL_DMA_DGSR_CB                0x04
+#define FSL_DMA_DGSR_EOSI      0x02
+#define FSL_DMA_DGSR_EOLSI     0x01
+
+struct fsl_dma_ld_hw {
+       u64 __bitwise   src_addr;
+       u64 __bitwise   dst_addr;
+       u64 __bitwise   next_ln_addr;
+       u32 __bitwise   count;
+       u32 __bitwise   reserve;
+} __attribute__((aligned(32)));
+
+struct fsl_desc_sw {
+       struct fsl_dma_ld_hw hw;
+       struct list_head node;
+       struct dma_async_tx_descriptor async_tx;
+       struct list_head *ld;
+       void *priv;
+} __attribute__((aligned(32)));
+
+struct fsl_dma_chan_regs {
+       u32 __bitwise   mr;     /* 0x00 - Mode Register */
+       u32 __bitwise   sr;     /* 0x04 - Status Register */
+       u64 __bitwise   cdar;   /* 0x08 - Current descriptor address register */
+       u64 __bitwise   sar;    /* 0x10 - Source Address Register */
+       u64 __bitwise   dar;    /* 0x18 - Destination Address Register */
+       u32 __bitwise   bcr;    /* 0x20 - Byte Count Register */
+       u64 __bitwise   ndar;   /* 0x24 - Next Descriptor Address Register */
+};
+
+struct fsl_dma_chan;
+#define FSL_DMA_MAX_CHANS_PER_DEVICE 4
+
+struct fsl_dma_device {
+       void __iomem *reg_base; /* DGSR register base */
+       struct resource reg;    /* Resource for register */
+       struct device *dev;
+       struct dma_device common;
+       struct fsl_dma_chan *chan[FSL_DMA_MAX_CHANS_PER_DEVICE];
+       u32 feature;            /* The same as DMA channels */
+};
+
+/* Define macros for fsl_dma_chan->feature property */
+#define FSL_DMA_LITTLE_ENDIAN  0x00000000
+#define FSL_DMA_BIG_ENDIAN     0x00000001
+
+#define FSL_DMA_IP_MASK                0x00000ff0
+#define FSL_DMA_IP_85XX                0x00000010
+#define FSL_DMA_IP_83XX                0x00000020
+
+#define FSL_DMA_CHAN_PAUSE_EXT 0x00001000
+#define FSL_DMA_CHAN_START_EXT 0x00002000
+
+struct fsl_dma_chan {
+       struct fsl_dma_chan_regs __iomem *reg_base;
+       dma_cookie_t completed_cookie;  /* The maximum cookie completed */
+       spinlock_t desc_lock;           /* Descriptor operation lock */
+       struct list_head ld_queue;      /* Link descriptors queue */
+       struct dma_chan common;         /* DMA common channel */
+       struct dma_pool *desc_pool;     /* Descriptors pool */
+       struct device *dev;             /* Channel device */
+       struct resource reg;            /* Resource for register */
+       int irq;                        /* Channel IRQ */
+       int id;                         /* Raw id of this channel */
+       struct tasklet_struct tasklet;
+       u32 feature;
+
+       void (*toggle_ext_pause)(struct fsl_dma_chan *fsl_chan, int size);
+       void (*toggle_ext_start)(struct fsl_dma_chan *fsl_chan, int enable);
+       void (*set_src_loop_size)(struct fsl_dma_chan *fsl_chan, int size);
+       void (*set_dest_loop_size)(struct fsl_dma_chan *fsl_chan, int size);
+};
+
+#define to_fsl_chan(chan) container_of(chan, struct fsl_dma_chan, common)
+#define to_fsl_desc(lh) container_of(lh, struct fsl_desc_sw, node)
+#define tx_to_fsl_desc(tx) container_of(tx, struct fsl_desc_sw, async_tx)
+
+#ifndef __powerpc64__
+static u64 in_be64(const u64 __iomem *addr)
+{
+       return ((u64)in_be32((u32 *)addr) << 32) | (in_be32((u32 *)addr + 1));
+}
+
+static void out_be64(u64 __iomem *addr, u64 val)
+{
+       out_be32((u32 *)addr, val >> 32);
+       out_be32((u32 *)addr + 1, (u32)val);
+}
+
+/* There is no asm instructions for 64 bits reverse loads and stores */
+static u64 in_le64(const u64 __iomem *addr)
+{
+       return ((u64)in_le32((u32 *)addr + 1) << 32) | (in_le32((u32 *)addr));
+}
+
+static void out_le64(u64 __iomem *addr, u64 val)
+{
+       out_le32((u32 *)addr + 1, val >> 32);
+       out_le32((u32 *)addr, (u32)val);
+}
+#endif
+
+#define DMA_IN(fsl_chan, addr, width)                                  \
+               (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ?           \
+                       in_be##width(addr) : in_le##width(addr))
+#define DMA_OUT(fsl_chan, addr, val, width)                            \
+               (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ?           \
+                       out_be##width(addr, val) : out_le##width(addr, val))
+
+#define DMA_TO_CPU(fsl_chan, d, width)                                 \
+               (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ?           \
+                       be##width##_to_cpu(d) : le##width##_to_cpu(d))
+#define CPU_TO_DMA(fsl_chan, c, width)                                 \
+               (((fsl_chan)->feature & FSL_DMA_BIG_ENDIAN) ?           \
+                       cpu_to_be##width(c) : cpu_to_le##width(c))
+
+#endif /* __DMA_FSLDMA_H */
index dff38accc5c1df47193a73b4fb81e467012d80b6..4017d9e7acd2a2b68020e2584c71dc654dd20cae 100644 (file)
@@ -714,6 +714,7 @@ static struct dma_async_tx_descriptor *ioat1_dma_prep_memcpy(
                new->len = len;
                new->dst = dma_dest;
                new->src = dma_src;
+               new->async_tx.ack = 0;
                return &new->async_tx;
        } else
                return NULL;
@@ -741,6 +742,7 @@ static struct dma_async_tx_descriptor *ioat2_dma_prep_memcpy(
                new->len = len;
                new->dst = dma_dest;
                new->src = dma_src;
+               new->async_tx.ack = 0;
                return &new->async_tx;
        } else
                return NULL;
index 8b10d9f23bef29c7fd3acb8c3cd56566447ee96f..c5263d63aca3a2cc56914f7651f44d56bf8c8a32 100644 (file)
@@ -42,14 +42,14 @@ config INPUT_M68K_BEEP
 
 config INPUT_APANEL
        tristate "Fujitsu Lifebook Application Panel buttons"
-       depends on X86
-       select I2C_I801
+       depends on X86 && I2C && LEDS_CLASS
        select INPUT_POLLDEV
        select CHECK_SIGNATURE
        help
         Say Y here for support of the Application Panel buttons, used on
         Fujitsu Lifebook. These are attached to the mainboard through
-        an SMBus interface managed by the I2C Intel ICH (i801) driver.
+        an SMBus interface managed by the I2C Intel ICH (i801) driver,
+        which you should also build for this kernel.
 
         To compile this driver as a module, choose M here: the module will
         be called apanel.
index 7993e01f9fc5cd08e22e0caac469e7208b2e3930..76043dedba5b442bc0e66e70a59bb1772a63400d 100644 (file)
@@ -723,23 +723,6 @@ static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter)
        if (!request_region(adapter->io, 32, "fcpcipnp"))
                goto err;
 
-       switch (adapter->type) {
-       case AVM_FRITZ_PCIV2:
-               retval = request_irq(adapter->irq, fcpci2_irq, IRQF_SHARED,
-                                    "fcpcipnp", adapter);
-               break;
-       case AVM_FRITZ_PCI:
-               retval = request_irq(adapter->irq, fcpci_irq, IRQF_SHARED,
-                                    "fcpcipnp", adapter);
-               break;
-       case AVM_FRITZ_PNP:
-               retval = request_irq(adapter->irq, fcpci_irq, 0,
-                                    "fcpcipnp", adapter);
-               break;
-       }
-       if (retval)
-               goto err_region;
-
        switch (adapter->type) {
        case AVM_FRITZ_PCIV2:
        case AVM_FRITZ_PCI:
@@ -794,6 +777,23 @@ static int __devinit fcpcipnp_setup(struct fritz_adapter *adapter)
        outb(0, adapter->io + AVM_STATUS0);
        mdelay(10);
 
+       switch (adapter->type) {
+       case AVM_FRITZ_PCIV2:
+               retval = request_irq(adapter->irq, fcpci2_irq, IRQF_SHARED,
+                                    "fcpcipnp", adapter);
+               break;
+       case AVM_FRITZ_PCI:
+               retval = request_irq(adapter->irq, fcpci_irq, IRQF_SHARED,
+                                    "fcpcipnp", adapter);
+               break;
+       case AVM_FRITZ_PNP:
+               retval = request_irq(adapter->irq, fcpci_irq, 0,
+                                    "fcpcipnp", adapter);
+               break;
+       }
+       if (retval)
+               goto err_region;
+
        switch (adapter->type) {
        case AVM_FRITZ_PCIV2:
                fcpci2_init(adapter);
index f93de4a303550afa4ea48b3ca6af7f7e4568a446..78f7660c1d0ea9c66153cfc1a1c1af9515d95580 100644 (file)
@@ -906,7 +906,8 @@ isdn_tty_cmd_FCLASS2(char **p, modem_info * info)
                        sprintf(rs, "\r\n0-2");
                        isdn_tty_at_cout(rs, info);
                } else {
-                       if ((f->phase != ISDN_FAX_PHASE_D) || (!info->faxonline & 1))
+                       if ((f->phase != ISDN_FAX_PHASE_D) ||
+                           (!(info->faxonline & 1)))
                                PARSE_ERROR1;
                        par = isdn_getnum(p);
                        if ((par < 0) || (par > 2))
index 655ef9a3f4df2a023d319967e9aa99dda93e4dc8..a335c85a736e25a472c3d66157ef40a0313304da 100644 (file)
@@ -1289,7 +1289,7 @@ isdnloop_command(isdn_ctrl * c, isdnloop_card * card)
                                }
                                break;
                case ISDN_CMD_CLREAZ:
-                               if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
+                               if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
                                        return -ENODEV;
                                if (card->leased)
                                        break;
@@ -1333,7 +1333,7 @@ isdnloop_command(isdn_ctrl * c, isdnloop_card * card)
                                }
                                break;
                case ISDN_CMD_SETL3:
-                               if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
+                               if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
                                        return -ENODEV;
                                return 0;
                default:
@@ -1380,7 +1380,7 @@ if_writecmd(const u_char __user *buf, int len, int id, int channel)
        isdnloop_card *card = isdnloop_findcard(id);
 
        if (card) {
-               if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
+               if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
                        return -ENODEV;
                return (isdnloop_writecmd(buf, len, 1, card));
        }
index 7aeceedcf7d46de93824a14ce9b93888350930dd..831aed9c56ffce68384365f95b432634ababa6f3 100644 (file)
@@ -1047,6 +1047,11 @@ void bitmap_daemon_work(struct bitmap *bitmap)
        if (time_before(jiffies, bitmap->daemon_lastrun + bitmap->daemon_sleep*HZ))
                return;
        bitmap->daemon_lastrun = jiffies;
+       if (bitmap->allclean) {
+               bitmap->mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT;
+               return;
+       }
+       bitmap->allclean = 1;
 
        for (j = 0; j < bitmap->chunks; j++) {
                bitmap_counter_t *bmc;
@@ -1068,8 +1073,10 @@ void bitmap_daemon_work(struct bitmap *bitmap)
                                        clear_page_attr(bitmap, page, BITMAP_PAGE_NEEDWRITE);
 
                                spin_unlock_irqrestore(&bitmap->lock, flags);
-                               if (need_write)
+                               if (need_write) {
                                        write_page(bitmap, page, 0);
+                                       bitmap->allclean = 0;
+                               }
                                continue;
                        }
 
@@ -1098,6 +1105,9 @@ void bitmap_daemon_work(struct bitmap *bitmap)
 /*
   if (j < 100) printk("bitmap: j=%lu, *bmc = 0x%x\n", j, *bmc);
 */
+                       if (*bmc)
+                               bitmap->allclean = 0;
+
                        if (*bmc == 2) {
                                *bmc=1; /* maybe clear the bit next time */
                                set_page_attr(bitmap, page, BITMAP_PAGE_CLEAN);
@@ -1132,6 +1142,8 @@ void bitmap_daemon_work(struct bitmap *bitmap)
                }
        }
 
+       if (bitmap->allclean == 0)
+               bitmap->mddev->thread->timeout = bitmap->daemon_sleep * HZ;
 }
 
 static bitmap_counter_t *bitmap_get_counter(struct bitmap *bitmap,
@@ -1226,6 +1238,7 @@ int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sect
                        sectors -= blocks;
                else sectors = 0;
        }
+       bitmap->allclean = 0;
        return 0;
 }
 
@@ -1296,6 +1309,7 @@ int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks,
                }
        }
        spin_unlock_irq(&bitmap->lock);
+       bitmap->allclean = 0;
        return rv;
 }
 
@@ -1332,6 +1346,7 @@ void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int ab
        }
  unlock:
        spin_unlock_irqrestore(&bitmap->lock, flags);
+       bitmap->allclean = 0;
 }
 
 void bitmap_close_sync(struct bitmap *bitmap)
@@ -1399,7 +1414,7 @@ static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset, int n
                set_page_attr(bitmap, page, BITMAP_PAGE_CLEAN);
        }
        spin_unlock_irq(&bitmap->lock);
-
+       bitmap->allclean = 0;
 }
 
 /* dirty the memory and file bits for bitmap chunks "s" to "e" */
index 7da6ec244e15de75184478818b553a66ec59454f..827824a9f3e917de4ae1ce38fa6017efbb49602d 100644 (file)
@@ -1105,7 +1105,11 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
        rdev->sb_size = le32_to_cpu(sb->max_dev) * 2 + 256;
        bmask = queue_hardsect_size(rdev->bdev->bd_disk->queue)-1;
        if (rdev->sb_size & bmask)
-               rdev-> sb_size = (rdev->sb_size | bmask)+1;
+               rdev->sb_size = (rdev->sb_size | bmask) + 1;
+
+       if (minor_version
+           && rdev->data_offset < sb_offset + (rdev->sb_size/512))
+               return -EINVAL;
 
        if (sb->level == cpu_to_le32(LEVEL_MULTIPATH))
                rdev->desc_nr = -1;
@@ -1137,7 +1141,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
                else
                        ret = 0;
        }
-       if (minor_version) 
+       if (minor_version)
                rdev->size = ((rdev->bdev->bd_inode->i_size>>9) - le64_to_cpu(sb->data_offset)) / 2;
        else
                rdev->size = rdev->sb_offset;
@@ -1499,7 +1503,8 @@ static void export_rdev(mdk_rdev_t * rdev)
        free_disk_sb(rdev);
        list_del_init(&rdev->same_set);
 #ifndef MODULE
-       md_autodetect_dev(rdev->bdev->bd_dev);
+       if (test_bit(AutoDetected, &rdev->flags))
+               md_autodetect_dev(rdev->bdev->bd_dev);
 #endif
        unlock_rdev(rdev);
        kobject_put(&rdev->kobj);
@@ -1996,9 +2001,11 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len)
        char *e;
        unsigned long long size = simple_strtoull(buf, &e, 10);
        unsigned long long oldsize = rdev->size;
+       mddev_t *my_mddev = rdev->mddev;
+
        if (e==buf || (*e && *e != '\n'))
                return -EINVAL;
-       if (rdev->mddev->pers)
+       if (my_mddev->pers)
                return -EBUSY;
        rdev->size = size;
        if (size > oldsize && rdev->mddev->external) {
@@ -2011,7 +2018,7 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len)
                int overlap = 0;
                struct list_head *tmp, *tmp2;
 
-               mddev_unlock(rdev->mddev);
+               mddev_unlock(my_mddev);
                for_each_mddev(mddev, tmp) {
                        mdk_rdev_t *rdev2;
 
@@ -2031,7 +2038,7 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len)
                                break;
                        }
                }
-               mddev_lock(rdev->mddev);
+               mddev_lock(my_mddev);
                if (overlap) {
                        /* Someone else could have slipped in a size
                         * change here, but doing so is just silly.
@@ -2043,8 +2050,8 @@ rdev_size_store(mdk_rdev_t *rdev, const char *buf, size_t len)
                        return -EBUSY;
                }
        }
-       if (size < rdev->mddev->size || rdev->mddev->size == 0)
-               rdev->mddev->size = size;
+       if (size < my_mddev->size || my_mddev->size == 0)
+               my_mddev->size = size;
        return len;
 }
 
@@ -2065,10 +2072,21 @@ rdev_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
 {
        struct rdev_sysfs_entry *entry = container_of(attr, struct rdev_sysfs_entry, attr);
        mdk_rdev_t *rdev = container_of(kobj, mdk_rdev_t, kobj);
+       mddev_t *mddev = rdev->mddev;
+       ssize_t rv;
 
        if (!entry->show)
                return -EIO;
-       return entry->show(rdev, page);
+
+       rv = mddev ? mddev_lock(mddev) : -EBUSY;
+       if (!rv) {
+               if (rdev->mddev == NULL)
+                       rv = -EBUSY;
+               else
+                       rv = entry->show(rdev, page);
+               mddev_unlock(mddev);
+       }
+       return rv;
 }
 
 static ssize_t
@@ -2077,15 +2095,19 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr,
 {
        struct rdev_sysfs_entry *entry = container_of(attr, struct rdev_sysfs_entry, attr);
        mdk_rdev_t *rdev = container_of(kobj, mdk_rdev_t, kobj);
-       int rv;
+       ssize_t rv;
+       mddev_t *mddev = rdev->mddev;
 
        if (!entry->store)
                return -EIO;
        if (!capable(CAP_SYS_ADMIN))
                return -EACCES;
-       rv = mddev_lock(rdev->mddev);
+       rv = mddev ? mddev_lock(mddev): -EBUSY;
        if (!rv) {
-               rv = entry->store(rdev, page, length);
+               if (rdev->mddev == NULL)
+                       rv = -EBUSY;
+               else
+                       rv = entry->store(rdev, page, length);
                mddev_unlock(rdev->mddev);
        }
        return rv;
@@ -5351,6 +5373,7 @@ void md_write_start(mddev_t *mddev, struct bio *bi)
                mddev->ro = 0;
                set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
                md_wakeup_thread(mddev->thread);
+               md_wakeup_thread(mddev->sync_thread);
        }
        atomic_inc(&mddev->writes_pending);
        if (mddev->in_sync) {
@@ -6021,6 +6044,7 @@ static void autostart_arrays(int part)
                        MD_BUG();
                        continue;
                }
+               set_bit(AutoDetected, &rdev->flags);
                list_add(&rdev->same_set, &pending_raid_disks);
                i_passed++;
        }
index 5c7fef091cec800da3f3cb482f7e97f574cb43c6..ff61b309129aa8ffa9dbd00987a71c1b6eb35bf5 100644 (file)
@@ -592,6 +592,37 @@ static int raid1_congested(void *data, int bits)
 }
 
 
+static int flush_pending_writes(conf_t *conf)
+{
+       /* Any writes that have been queued but are awaiting
+        * bitmap updates get flushed here.
+        * We return 1 if any requests were actually submitted.
+        */
+       int rv = 0;
+
+       spin_lock_irq(&conf->device_lock);
+
+       if (conf->pending_bio_list.head) {
+               struct bio *bio;
+               bio = bio_list_get(&conf->pending_bio_list);
+               blk_remove_plug(conf->mddev->queue);
+               spin_unlock_irq(&conf->device_lock);
+               /* flush any pending bitmap writes to
+                * disk before proceeding w/ I/O */
+               bitmap_unplug(conf->mddev->bitmap);
+
+               while (bio) { /* submit pending writes */
+                       struct bio *next = bio->bi_next;
+                       bio->bi_next = NULL;
+                       generic_make_request(bio);
+                       bio = next;
+               }
+               rv = 1;
+       } else
+               spin_unlock_irq(&conf->device_lock);
+       return rv;
+}
+
 /* Barriers....
  * Sometimes we need to suspend IO while we do something else,
  * either some resync/recovery, or reconfigure the array.
@@ -673,15 +704,23 @@ static void freeze_array(conf_t *conf)
        /* stop syncio and normal IO and wait for everything to
         * go quite.
         * We increment barrier and nr_waiting, and then
-        * wait until barrier+nr_pending match nr_queued+2
+        * wait until nr_pending match nr_queued+1
+        * This is called in the context of one normal IO request
+        * that has failed. Thus any sync request that might be pending
+        * will be blocked by nr_pending, and we need to wait for
+        * pending IO requests to complete or be queued for re-try.
+        * Thus the number queued (nr_queued) plus this request (1)
+        * must match the number of pending IOs (nr_pending) before
+        * we continue.
         */
        spin_lock_irq(&conf->resync_lock);
        conf->barrier++;
        conf->nr_waiting++;
        wait_event_lock_irq(conf->wait_barrier,
-                           conf->barrier+conf->nr_pending == conf->nr_queued+2,
+                           conf->nr_pending == conf->nr_queued+1,
                            conf->resync_lock,
-                           raid1_unplug(conf->mddev->queue));
+                           ({ flush_pending_writes(conf);
+                              raid1_unplug(conf->mddev->queue); }));
        spin_unlock_irq(&conf->resync_lock);
 }
 static void unfreeze_array(conf_t *conf)
@@ -907,6 +946,9 @@ static int make_request(struct request_queue *q, struct bio * bio)
        blk_plug_device(mddev->queue);
        spin_unlock_irqrestore(&conf->device_lock, flags);
 
+       /* In case raid1d snuck into freeze_array */
+       wake_up(&conf->wait_barrier);
+
        if (do_sync)
                md_wakeup_thread(mddev->thread);
 #if 0
@@ -1473,28 +1515,14 @@ static void raid1d(mddev_t *mddev)
        
        for (;;) {
                char b[BDEVNAME_SIZE];
-               spin_lock_irqsave(&conf->device_lock, flags);
-
-               if (conf->pending_bio_list.head) {
-                       bio = bio_list_get(&conf->pending_bio_list);
-                       blk_remove_plug(mddev->queue);
-                       spin_unlock_irqrestore(&conf->device_lock, flags);
-                       /* flush any pending bitmap writes to disk before proceeding w/ I/O */
-                       bitmap_unplug(mddev->bitmap);
 
-                       while (bio) { /* submit pending writes */
-                               struct bio *next = bio->bi_next;
-                               bio->bi_next = NULL;
-                               generic_make_request(bio);
-                               bio = next;
-                       }
-                       unplug = 1;
+               unplug += flush_pending_writes(conf);
 
-                       continue;
-               }
-
-               if (list_empty(head))
+               spin_lock_irqsave(&conf->device_lock, flags);
+               if (list_empty(head)) {
+                       spin_unlock_irqrestore(&conf->device_lock, flags);
                        break;
+               }
                r1_bio = list_entry(head->prev, r1bio_t, retry_list);
                list_del(head->prev);
                conf->nr_queued--;
@@ -1590,7 +1618,6 @@ static void raid1d(mddev_t *mddev)
                        }
                }
        }
-       spin_unlock_irqrestore(&conf->device_lock, flags);
        if (unplug)
                unplug_slaves(mddev);
 }
index 017f58113c33604e381a5fcc7c75f01344f67841..32389d2f18fcdfcadc87137936441e6d51560c05 100644 (file)
@@ -537,7 +537,8 @@ static int read_balance(conf_t *conf, r10bio_t *r10_bio)
        current_distance = abs(r10_bio->devs[slot].addr -
                               conf->mirrors[disk].head_position);
 
-       /* Find the disk whose head is closest */
+       /* Find the disk whose head is closest,
+        * or - for far > 1 - find the closest to partition beginning */
 
        for (nslot = slot; nslot < conf->copies; nslot++) {
                int ndisk = r10_bio->devs[nslot].devnum;
@@ -557,8 +558,13 @@ static int read_balance(conf_t *conf, r10bio_t *r10_bio)
                        slot = nslot;
                        break;
                }
-               new_distance = abs(r10_bio->devs[nslot].addr -
-                                  conf->mirrors[ndisk].head_position);
+
+               /* for far > 1 always use the lowest address */
+               if (conf->far_copies > 1)
+                       new_distance = r10_bio->devs[nslot].addr;
+               else
+                       new_distance = abs(r10_bio->devs[nslot].addr -
+                                          conf->mirrors[ndisk].head_position);
                if (new_distance < current_distance) {
                        current_distance = new_distance;
                        disk = ndisk;
@@ -629,7 +635,36 @@ static int raid10_congested(void *data, int bits)
        return ret;
 }
 
-
+static int flush_pending_writes(conf_t *conf)
+{
+       /* Any writes that have been queued but are awaiting
+        * bitmap updates get flushed here.
+        * We return 1 if any requests were actually submitted.
+        */
+       int rv = 0;
+
+       spin_lock_irq(&conf->device_lock);
+
+       if (conf->pending_bio_list.head) {
+               struct bio *bio;
+               bio = bio_list_get(&conf->pending_bio_list);
+               blk_remove_plug(conf->mddev->queue);
+               spin_unlock_irq(&conf->device_lock);
+               /* flush any pending bitmap writes to disk
+                * before proceeding w/ I/O */
+               bitmap_unplug(conf->mddev->bitmap);
+
+               while (bio) { /* submit pending writes */
+                       struct bio *next = bio->bi_next;
+                       bio->bi_next = NULL;
+                       generic_make_request(bio);
+                       bio = next;
+               }
+               rv = 1;
+       } else
+               spin_unlock_irq(&conf->device_lock);
+       return rv;
+}
 /* Barriers....
  * Sometimes we need to suspend IO while we do something else,
  * either some resync/recovery, or reconfigure the array.
@@ -712,15 +747,23 @@ static void freeze_array(conf_t *conf)
        /* stop syncio and normal IO and wait for everything to
         * go quiet.
         * We increment barrier and nr_waiting, and then
-        * wait until barrier+nr_pending match nr_queued+2
+        * wait until nr_pending match nr_queued+1
+        * This is called in the context of one normal IO request
+        * that has failed. Thus any sync request that might be pending
+        * will be blocked by nr_pending, and we need to wait for
+        * pending IO requests to complete or be queued for re-try.
+        * Thus the number queued (nr_queued) plus this request (1)
+        * must match the number of pending IOs (nr_pending) before
+        * we continue.
         */
        spin_lock_irq(&conf->resync_lock);
        conf->barrier++;
        conf->nr_waiting++;
        wait_event_lock_irq(conf->wait_barrier,
-                           conf->barrier+conf->nr_pending == conf->nr_queued+2,
+                           conf->nr_pending == conf->nr_queued+1,
                            conf->resync_lock,
-                           raid10_unplug(conf->mddev->queue));
+                           ({ flush_pending_writes(conf);
+                              raid10_unplug(conf->mddev->queue); }));
        spin_unlock_irq(&conf->resync_lock);
 }
 
@@ -892,6 +935,9 @@ static int make_request(struct request_queue *q, struct bio * bio)
        blk_plug_device(mddev->queue);
        spin_unlock_irqrestore(&conf->device_lock, flags);
 
+       /* In case raid10d snuck in to freeze_array */
+       wake_up(&conf->wait_barrier);
+
        if (do_sync)
                md_wakeup_thread(mddev->thread);
 
@@ -1464,28 +1510,14 @@ static void raid10d(mddev_t *mddev)
 
        for (;;) {
                char b[BDEVNAME_SIZE];
-               spin_lock_irqsave(&conf->device_lock, flags);
 
-               if (conf->pending_bio_list.head) {
-                       bio = bio_list_get(&conf->pending_bio_list);
-                       blk_remove_plug(mddev->queue);
-                       spin_unlock_irqrestore(&conf->device_lock, flags);
-                       /* flush any pending bitmap writes to disk before proceeding w/ I/O */
-                       bitmap_unplug(mddev->bitmap);
-
-                       while (bio) { /* submit pending writes */
-                               struct bio *next = bio->bi_next;
-                               bio->bi_next = NULL;
-                               generic_make_request(bio);
-                               bio = next;
-                       }
-                       unplug = 1;
-
-                       continue;
-               }
+               unplug += flush_pending_writes(conf);
 
-               if (list_empty(head))
+               spin_lock_irqsave(&conf->device_lock, flags);
+               if (list_empty(head)) {
+                       spin_unlock_irqrestore(&conf->device_lock, flags);
                        break;
+               }
                r10_bio = list_entry(head->prev, r10bio_t, retry_list);
                list_del(head->prev);
                conf->nr_queued--;
@@ -1548,7 +1580,6 @@ static void raid10d(mddev_t *mddev)
                        }
                }
        }
-       spin_unlock_irqrestore(&conf->device_lock, flags);
        if (unplug)
                unplug_slaves(mddev);
 }
@@ -1787,6 +1818,8 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
                                if (j == conf->copies) {
                                        /* Cannot recover, so abort the recovery */
                                        put_buf(r10_bio);
+                                       if (rb2)
+                                               atomic_dec(&rb2->remaining);
                                        r10_bio = rb2;
                                        if (!test_and_set_bit(MD_RECOVERY_ERR, &mddev->recovery))
                                                printk(KERN_INFO "raid10: %s: insufficient working devices for recovery.\n",
index 0c303c84b37bbcebf86b8f29f8c4167de6b3db37..6b6df8679585dfae3715f327683a8f677e17eae8 100644 (file)
@@ -632,8 +632,7 @@ mpt_deregister(u8 cb_idx)
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
- *     mpt_event_register - Register protocol-specific event callback
- *     handler.
+ *     mpt_event_register - Register protocol-specific event callback handler.
  *     @cb_idx: previously registered (via mpt_register) callback handle
  *     @ev_cbfunc: callback function
  *
@@ -654,8 +653,7 @@ mpt_event_register(u8 cb_idx, MPT_EVHANDLER ev_cbfunc)
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
- *     mpt_event_deregister - Deregister protocol-specific event callback
- *     handler.
+ *     mpt_event_deregister - Deregister protocol-specific event callback handler
  *     @cb_idx: previously registered callback handle
  *
  *     Each protocol-specific driver should call this routine
@@ -765,11 +763,13 @@ mpt_device_driver_deregister(u8 cb_idx)
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
- *     mpt_get_msg_frame - Obtain a MPT request frame from the pool (of 1024)
- *     allocated per MPT adapter.
+ *     mpt_get_msg_frame - Obtain an MPT request frame from the pool
  *     @cb_idx: Handle of registered MPT protocol driver
  *     @ioc: Pointer to MPT adapter structure
  *
+ *     Obtain an MPT request frame from the pool (of 1024) that are
+ *     allocated per MPT adapter.
+ *
  *     Returns pointer to a MPT request frame or %NULL if none are available
  *     or IOC is not active.
  */
@@ -834,13 +834,12 @@ mpt_get_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc)
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
- *     mpt_put_msg_frame - Send a protocol specific MPT request frame
- *     to a IOC.
+ *     mpt_put_msg_frame - Send a protocol-specific MPT request frame to an IOC
  *     @cb_idx: Handle of registered MPT protocol driver
  *     @ioc: Pointer to MPT adapter structure
  *     @mf: Pointer to MPT request frame
  *
- *     This routine posts a MPT request frame to the request post FIFO of a
+ *     This routine posts an MPT request frame to the request post FIFO of a
  *     specific MPT adapter.
  */
 void
@@ -868,13 +867,15 @@ mpt_put_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf)
 }
 
 /**
- *     mpt_put_msg_frame_hi_pri - Send a protocol specific MPT request frame
- *     to a IOC using hi priority request queue.
+ *     mpt_put_msg_frame_hi_pri - Send a hi-pri protocol-specific MPT request frame
  *     @cb_idx: Handle of registered MPT protocol driver
  *     @ioc: Pointer to MPT adapter structure
  *     @mf: Pointer to MPT request frame
  *
- *     This routine posts a MPT request frame to the request post FIFO of a
+ *     Send a protocol-specific MPT request frame to an IOC using
+ *     hi-priority request queue.
+ *
+ *     This routine posts an MPT request frame to the request post FIFO of a
  *     specific MPT adapter.
  **/
 void
index f77b329f6923baab6e4b23742981b97b58393046..78734e25edd515bcc863fbcae3216c6447e045eb 100644 (file)
@@ -1701,6 +1701,11 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info,
        if (error)
                goto out_free_consistent;
 
+       if (!buffer->NumPhys) {
+               error = -ENODEV;
+               goto out_free_consistent;
+       }
+
        /* save config data */
        port_info->num_phys = buffer->NumPhys;
        port_info->phy_info = kcalloc(port_info->num_phys,
index af1de0ccee2f54c37c3567585e9e73db6f83bfe4..0c252f60c4c1ba2c5ee4e7012b21dc6dddf36129 100644 (file)
@@ -1533,7 +1533,7 @@ mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx)
  *
  *     Remark: Currently invoked from a non-interrupt thread (_bh).
  *
- *     Remark: With old EH code, at most 1 SCSI TaskMgmt function per IOC
+ *     Note: With old EH code, at most 1 SCSI TaskMgmt function per IOC
  *     will be active.
  *
  *     Returns 0 for SUCCESS, or %FAILED.
@@ -2537,14 +2537,12 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
 
 /**
  * mptscsih_get_scsi_lookup
- *
- * retrieves scmd entry from ScsiLookup[] array list
- *
  * @ioc: Pointer to MPT_ADAPTER structure
  * @i: index into the array
  *
- * Returns the scsi_cmd pointer
+ * retrieves scmd entry from ScsiLookup[] array list
  *
+ * Returns the scsi_cmd pointer
  **/
 static struct scsi_cmnd *
 mptscsih_get_scsi_lookup(MPT_ADAPTER *ioc, int i)
@@ -2561,14 +2559,12 @@ mptscsih_get_scsi_lookup(MPT_ADAPTER *ioc, int i)
 
 /**
  * mptscsih_getclear_scsi_lookup
- *
- * retrieves and clears scmd entry from ScsiLookup[] array list
- *
  * @ioc: Pointer to MPT_ADAPTER structure
  * @i: index into the array
  *
- * Returns the scsi_cmd pointer
+ * retrieves and clears scmd entry from ScsiLookup[] array list
  *
+ * Returns the scsi_cmd pointer
  **/
 static struct scsi_cmnd *
 mptscsih_getclear_scsi_lookup(MPT_ADAPTER *ioc, int i)
index afd82966f9a0782ad5624f45fcf4538e3755a73f..13bac53db69a1ffe58726720a461ee0bbac9edd0 100644 (file)
@@ -48,31 +48,13 @@ struct sm501_devdata {
        unsigned int                     pdev_id;
        unsigned int                     irq;
        void __iomem                    *regs;
+       unsigned int                     rev;
 };
 
 #define MHZ (1000 * 1000)
 
 #ifdef DEBUG
-static const unsigned int misc_div[] = {
-       [0]             = 1,
-       [1]             = 2,
-       [2]             = 4,
-       [3]             = 8,
-       [4]             = 16,
-       [5]             = 32,
-       [6]             = 64,
-       [7]             = 128,
-       [8]             = 3,
-       [9]             = 6,
-       [10]            = 12,
-       [11]            = 24,
-       [12]            = 48,
-       [13]            = 96,
-       [14]            = 192,
-       [15]            = 384,
-};
-
-static const unsigned int px_div[] = {
+static const unsigned int div_tab[] = {
        [0]             = 1,
        [1]             = 2,
        [2]             = 4,
@@ -101,12 +83,12 @@ static const unsigned int px_div[] = {
 
 static unsigned long decode_div(unsigned long pll2, unsigned long val,
                                unsigned int lshft, unsigned int selbit,
-                               unsigned long mask, const unsigned int *dtab)
+                               unsigned long mask)
 {
        if (val & selbit)
                pll2 = 288 * MHZ;
 
-       return pll2 / dtab[(val >> lshft) & mask];
+       return pll2 / div_tab[(val >> lshft) & mask];
 }
 
 #define fmt_freq(x) ((x) / MHZ), ((x) % MHZ), (x)
@@ -141,10 +123,10 @@ static void sm501_dump_clk(struct sm501_devdata *sm)
        }
 
        sdclk0 = (misct & (1<<12)) ? pll2 : 288 * MHZ;
-       sdclk0 /= misc_div[((misct >> 8) & 0xf)];
+       sdclk0 /= div_tab[((misct >> 8) & 0xf)];
 
        sdclk1 = (misct & (1<<20)) ? pll2 : 288 * MHZ;
-       sdclk1 /= misc_div[((misct >> 16) & 0xf)];
+       sdclk1 /= div_tab[((misct >> 16) & 0xf)];
 
        dev_dbg(sm->dev, "MISCT=%08lx, PM0=%08lx, PM1=%08lx\n",
                misct, pm0, pm1);
@@ -158,19 +140,19 @@ static void sm501_dump_clk(struct sm501_devdata *sm)
                 "P2 %ld.%ld MHz (%ld), V2 %ld.%ld (%ld), "
                 "M %ld.%ld (%ld), MX1 %ld.%ld (%ld)\n",
                 (pmc & 3 ) == 0 ? '*' : '-',
-                fmt_freq(decode_div(pll2, pm0, 24, 1<<29, 31, px_div)),
-                fmt_freq(decode_div(pll2, pm0, 16, 1<<20, 15, misc_div)),
-                fmt_freq(decode_div(pll2, pm0, 8,  1<<12, 15, misc_div)),
-                fmt_freq(decode_div(pll2, pm0, 0,  1<<4,  15, misc_div)));
+                fmt_freq(decode_div(pll2, pm0, 24, 1<<29, 31)),
+                fmt_freq(decode_div(pll2, pm0, 16, 1<<20, 15)),
+                fmt_freq(decode_div(pll2, pm0, 8,  1<<12, 15)),
+                fmt_freq(decode_div(pll2, pm0, 0,  1<<4,  15)));
 
        dev_dbg(sm->dev, "PM1[%c]: "
                "P2 %ld.%ld MHz (%ld), V2 %ld.%ld (%ld), "
                "M %ld.%ld (%ld), MX1 %ld.%ld (%ld)\n",
                (pmc & 3 ) == 1 ? '*' : '-',
-               fmt_freq(decode_div(pll2, pm1, 24, 1<<29, 31, px_div)),
-               fmt_freq(decode_div(pll2, pm1, 16, 1<<20, 15, misc_div)),
-               fmt_freq(decode_div(pll2, pm1, 8,  1<<12, 15, misc_div)),
-               fmt_freq(decode_div(pll2, pm1, 0,  1<<4,  15, misc_div)));
+               fmt_freq(decode_div(pll2, pm1, 24, 1<<29, 31)),
+               fmt_freq(decode_div(pll2, pm1, 16, 1<<20, 15)),
+               fmt_freq(decode_div(pll2, pm1, 8,  1<<12, 15)),
+               fmt_freq(decode_div(pll2, pm1, 0,  1<<4,  15)));
 }
 
 static void sm501_dump_regs(struct sm501_devdata *sm)
@@ -436,46 +418,108 @@ struct sm501_clock {
        unsigned long mclk;
        int divider;
        int shift;
+       unsigned int m, n, k;
 };
 
+/* sm501_calc_clock
+ *
+ * Calculates the nearest discrete clock frequency that
+ * can be achieved with the specified input clock.
+ *   the maximum divisor is 3 or 5
+ */
+
+static int sm501_calc_clock(unsigned long freq,
+                           struct sm501_clock *clock,
+                           int max_div,
+                           unsigned long mclk,
+                           long *best_diff)
+{
+       int ret = 0;
+       int divider;
+       int shift;
+       long diff;
+
+       /* try dividers 1 and 3 for CRT and for panel,
+          try divider 5 for panel only.*/
+
+       for (divider = 1; divider <= max_div; divider += 2) {
+               /* try all 8 shift values.*/
+               for (shift = 0; shift < 8; shift++) {
+                       /* Calculate difference to requested clock */
+                       diff = sm501fb_round_div(mclk, divider << shift) - freq;
+                       if (diff < 0)
+                               diff = -diff;
+
+                       /* If it is less than the current, use it */
+                       if (diff < *best_diff) {
+                               *best_diff = diff;
+
+                               clock->mclk = mclk;
+                               clock->divider = divider;
+                               clock->shift = shift;
+                               ret = 1;
+                       }
+               }
+       }
+
+       return ret;
+}
+
+/* sm501_calc_pll
+ *
+ * Calculates the nearest discrete clock frequency that can be
+ * achieved using the programmable PLL.
+ *   the maximum divisor is 3 or 5
+ */
+
+static unsigned long sm501_calc_pll(unsigned long freq,
+                                       struct sm501_clock *clock,
+                                       int max_div)
+{
+       unsigned long mclk;
+       unsigned int m, n, k;
+       long best_diff = 999999999;
+
+       /*
+        * The SM502 datasheet doesn't specify the min/max values for M and N.
+        * N = 1 at least doesn't work in practice.
+        */
+       for (m = 2; m <= 255; m++) {
+               for (n = 2; n <= 127; n++) {
+                       for (k = 0; k <= 1; k++) {
+                               mclk = (24000000UL * m / n) >> k;
+
+                               if (sm501_calc_clock(freq, clock, max_div,
+                                                    mclk, &best_diff)) {
+                                       clock->m = m;
+                                       clock->n = n;
+                                       clock->k = k;
+                               }
+                       }
+               }
+       }
+
+       /* Return best clock. */
+       return clock->mclk / (clock->divider << clock->shift);
+}
+
 /* sm501_select_clock
  *
- * selects nearest discrete clock frequency the SM501 can achive
+ * Calculates the nearest discrete clock frequency that can be
+ * achieved using the 288MHz and 336MHz PLLs.
  *   the maximum divisor is 3 or 5
  */
+
 static unsigned long sm501_select_clock(unsigned long freq,
                                        struct sm501_clock *clock,
                                        int max_div)
 {
        unsigned long mclk;
-       int divider;
-       int shift;
-       long diff;
        long best_diff = 999999999;
 
        /* Try 288MHz and 336MHz clocks. */
        for (mclk = 288000000; mclk <= 336000000; mclk += 48000000) {
-               /* try dividers 1 and 3 for CRT and for panel,
-                  try divider 5 for panel only.*/
-
-               for (divider = 1; divider <= max_div; divider += 2) {
-                       /* try all 8 shift values.*/
-                       for (shift = 0; shift < 8; shift++) {
-                               /* Calculate difference to requested clock */
-                               diff = sm501fb_round_div(mclk, divider << shift) - freq;
-                               if (diff < 0)
-                                       diff = -diff;
-
-                               /* If it is less than the current, use it */
-                               if (diff < best_diff) {
-                                       best_diff = diff;
-
-                                       clock->mclk = mclk;
-                                       clock->divider = divider;
-                                       clock->shift = shift;
-                               }
-                       }
-               }
+               sm501_calc_clock(freq, clock, max_div, mclk, &best_diff);
        }
 
        /* Return best clock. */
@@ -497,6 +541,7 @@ unsigned long sm501_set_clock(struct device *dev,
        unsigned long gate = readl(sm->regs + SM501_CURRENT_GATE);
        unsigned long clock = readl(sm->regs + SM501_CURRENT_CLOCK);
        unsigned char reg;
+       unsigned int pll_reg = 0;
        unsigned long sm501_freq; /* the actual frequency acheived */
 
        struct sm501_clock to;
@@ -511,14 +556,28 @@ unsigned long sm501_set_clock(struct device *dev,
                 * requested frequency the value must be multiplied by
                 * 2. This clock also has an additional pre divisor */
 
-               sm501_freq = (sm501_select_clock(2 * req_freq, &to, 5) / 2);
-               reg=to.shift & 0x07;/* bottom 3 bits are shift */
-               if (to.divider == 3)
-                       reg |= 0x08; /* /3 divider required */
-               else if (to.divider == 5)
-                       reg |= 0x10; /* /5 divider required */
-               if (to.mclk != 288000000)
-                       reg |= 0x20; /* which mclk pll is source */
+               if (sm->rev >= 0xC0) {
+                       /* SM502 -> use the programmable PLL */
+                       sm501_freq = (sm501_calc_pll(2 * req_freq,
+                                                    &to, 5) / 2);
+                       reg = to.shift & 0x07;/* bottom 3 bits are shift */
+                       if (to.divider == 3)
+                               reg |= 0x08; /* /3 divider required */
+                       else if (to.divider == 5)
+                               reg |= 0x10; /* /5 divider required */
+                       reg |= 0x40; /* select the programmable PLL */
+                       pll_reg = 0x20000 | (to.k << 15) | (to.n << 8) | to.m;
+               } else {
+                       sm501_freq = (sm501_select_clock(2 * req_freq,
+                                                        &to, 5) / 2);
+                       reg = to.shift & 0x07;/* bottom 3 bits are shift */
+                       if (to.divider == 3)
+                               reg |= 0x08; /* /3 divider required */
+                       else if (to.divider == 5)
+                               reg |= 0x10; /* /5 divider required */
+                       if (to.mclk != 288000000)
+                               reg |= 0x20; /* which mclk pll is source */
+               }
                break;
 
        case SM501_CLOCK_V2XCLK:
@@ -579,6 +638,10 @@ unsigned long sm501_set_clock(struct device *dev,
        }
 
        writel(mode, sm->regs + SM501_POWER_MODE_CONTROL);
+
+       if (pll_reg)
+               writel(pll_reg, sm->regs + SM501_PROGRAMMABLE_PLL_CONTROL);
+
        sm501_sync_regs(sm);
 
        dev_info(sm->dev, "gate %08lx, clock %08lx, mode %08lx\n",
@@ -599,15 +662,24 @@ EXPORT_SYMBOL_GPL(sm501_set_clock);
  * finds the closest available frequency for a given clock
 */
 
-unsigned long sm501_find_clock(int clksrc,
+unsigned long sm501_find_clock(struct device *dev,
+                              int clksrc,
                               unsigned long req_freq)
 {
+       struct sm501_devdata *sm = dev_get_drvdata(dev);
        unsigned long sm501_freq; /* the frequency achiveable by the 501 */
        struct sm501_clock to;
 
        switch (clksrc) {
        case SM501_CLOCK_P2XCLK:
-               sm501_freq = (sm501_select_clock(2 * req_freq, &to, 5) / 2);
+               if (sm->rev >= 0xC0) {
+                       /* SM502 -> use the programmable PLL */
+                       sm501_freq = (sm501_calc_pll(2 * req_freq,
+                                                    &to, 5) / 2);
+               } else {
+                       sm501_freq = (sm501_select_clock(2 * req_freq,
+                                                        &to, 5) / 2);
+               }
                break;
 
        case SM501_CLOCK_V2XCLK:
@@ -914,6 +986,8 @@ static int sm501_init_dev(struct sm501_devdata *sm)
        dev_info(sm->dev, "SM501 At %p: Version %08lx, %ld Mb, IRQ %d\n",
                 sm->regs, devid, (unsigned long)mem_avail >> 20, sm->irq);
 
+       sm->rev = devid & SM501_DEVICEID_REVMASK;
+
        sm501_dump_gate(sm);
 
        ret = device_create_file(sm->dev, &dev_attr_dbg_regs);
index bb269d0c677edbc4cadd268dc634e90b6120a80e..6cb781262f947611a20916bf6b996c9ff3e713cb 100644 (file)
@@ -1078,7 +1078,8 @@ static int hotkey_get_tablet_mode(int *status)
        if (!acpi_evalf(hkey_handle, &s, "MHKG", "d"))
                return -EIO;
 
-       return ((s & TP_HOTKEY_TABLET_MASK) != 0);
+       *status = ((s & TP_HOTKEY_TABLET_MASK) != 0);
+       return 0;
 }
 
 /*
index 6ac81e35355cd39fc8232698b790de75f077e59b..2759604629703e6ea9d9c2e6735478a9cd5a9e1c 100644 (file)
@@ -1000,8 +1000,8 @@ static int __init ubi_init(void)
                mutex_unlock(&ubi_devices_mutex);
                if (err < 0) {
                        put_mtd_device(mtd);
-                       printk(KERN_ERR "UBI error: cannot attach %s\n",
-                              p->name);
+                       printk(KERN_ERR "UBI error: cannot attach mtd%d\n",
+                              mtd->index);
                        goto out_detach;
                }
        }
index 457710615261126e2fef2d2ad6463c991d83a895..a548c1d28fa818a5485aa5524a2527eff269edf0 100644 (file)
@@ -217,11 +217,11 @@ struct ubi_volume {
        void *upd_buf;
 
        int *eba_tbl;
-       int checked:1;
-       int corrupted:1;
-       int upd_marker:1;
-       int updating:1;
-       int changing_leb:1;
+       unsigned int checked:1;
+       unsigned int corrupted:1;
+       unsigned int upd_marker:1;
+       unsigned int updating:1;
+       unsigned int changing_leb:1;
 
 #ifdef CONFIG_MTD_UBI_GLUEBI
        /*
index a3ca2257e6015e586ddcbfa513acb760b01afb08..5be58d85c6393c53c2be0f4693ff8a9bd13e40b3 100644 (file)
@@ -376,7 +376,9 @@ out_sysfs:
        get_device(&vol->dev);
        volume_sysfs_close(vol);
 out_gluebi:
-       ubi_destroy_gluebi(vol);
+       if (ubi_destroy_gluebi(vol))
+               dbg_err("cannot destroy gluebi for volume %d:%d",
+                       ubi->ubi_num, vol_id);
 out_cdev:
        cdev_del(&vol->cdev);
 out_mapping:
index 56fc3fbce838179b7d34276ccbb51e1ee2ff2018..af36b12be27871ddefd1c34a0d17f95483042343 100644 (file)
@@ -519,6 +519,7 @@ static int init_volumes(struct ubi_device *ubi, const struct ubi_scan_info *si,
                        if (ubi->autoresize_vol_id != -1) {
                                ubi_err("more then one auto-resize volume (%d "
                                        "and %d)", ubi->autoresize_vol_id, i);
+                               kfree(vol);
                                return -EINVAL;
                        }
 
index 0fbf1bbbaee9972a56ab6f4d13eb31f00ed40c2c..d7a3ea88eddb562be4f632387d30776da84f4ef7 100644 (file)
@@ -1253,7 +1253,7 @@ static void __inline__ fec_request_intrs(struct net_device *dev)
 
        /* Setup interrupt handlers. */
        for (idp = id; idp->name; idp++) {
-               if (request_irq(idp->irq, idp->handler, 0, idp->name, dev) != 0)
+               if (request_irq(idp->irq, idp->handler, IRQF_DISABLED, idp->name, dev) != 0)
                        printk("FEC: Could not allocate %s IRQ(%d)!\n", idp->name, idp->irq);
        }
 
@@ -1382,7 +1382,7 @@ static void __inline__ fec_request_intrs(struct net_device *dev)
 
        /* Setup interrupt handlers. */
        for (idp = id; idp->name; idp++) {
-               if (request_irq(b+idp->irq, fec_enet_interrupt, 0, idp->name, dev) != 0)
+               if (request_irq(b+idp->irq, fec_enet_interrupt, IRQF_DISABLED, idp->name, dev) != 0)
                        printk("FEC: Could not allocate %s IRQ(%d)!\n", idp->name, b+idp->irq);
        }
 
@@ -1553,7 +1553,7 @@ static void __inline__ fec_request_intrs(struct net_device *dev)
 
        /* Setup interrupt handlers. */
        for (idp = id; idp->name; idp++) {
-               if (request_irq(b+idp->irq,fec_enet_interrupt,0,idp->name,dev)!=0)
+               if (request_irq(b+idp->irq, fec_enet_interrupt, IRQF_DISABLED, idp->name,dev) != 0)
                        printk("FEC: Could not allocate %s IRQ(%d)!\n", idp->name, b+idp->irq);
        }
 
@@ -1680,7 +1680,7 @@ static void __inline__ fec_request_intrs(struct net_device *dev)
 
        /* Setup interrupt handlers. */
        for (idp = id; idp->name; idp++) {
-               if (request_irq(b+idp->irq,fec_enet_interrupt,0,idp->name,dev)!=0)
+               if (request_irq(b+idp->irq, fec_enet_interrupt, IRQF_DISABLED, idp->name,dev) != 0)
                        printk("FEC: Could not allocate %s IRQ(%d)!\n",
                                idp->name, b+idp->irq);
        }
index e0b072d9fdb7caf571e6594af1f732068cba5dab..86e5dba079fed6d9a62bcd6d9e9e31fb40888999 100644 (file)
@@ -455,6 +455,7 @@ static void pppol2tp_recv_dequeue(struct pppol2tp_session *session)
                               skb_queue_len(&session->reorder_q));
                        __skb_unlink(skb, &session->reorder_q);
                        kfree_skb(skb);
+                       sock_put(session->sock);
                        continue;
                }
 
@@ -1110,6 +1111,8 @@ static void pppol2tp_tunnel_closeall(struct pppol2tp_tunnel *tunnel)
        for (hash = 0; hash < PPPOL2TP_HASH_SIZE; hash++) {
 again:
                hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) {
+                       struct sk_buff *skb;
+
                        session = hlist_entry(walk, struct pppol2tp_session, hlist);
 
                        sk = session->sock;
@@ -1138,7 +1141,10 @@ again:
                        /* Purge any queued data */
                        skb_queue_purge(&sk->sk_receive_queue);
                        skb_queue_purge(&sk->sk_write_queue);
-                       skb_queue_purge(&session->reorder_q);
+                       while ((skb = skb_dequeue(&session->reorder_q))) {
+                               kfree_skb(skb);
+                               sock_put(sk);
+                       }
 
                        release_sock(sk);
                        sock_put(sk);
index 038c1ef94d2e72e7332a4e28a86cbd82be14788a..7b816a032957b61d692b897c33517bc3f7ad81a3 100644 (file)
@@ -663,7 +663,11 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
        case SIOCSIFHWADDR:
        {
                /* try to set the actual net device's hw address */
-               int ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr);
+               int ret;
+
+               rtnl_lock();
+               ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr);
+               rtnl_unlock();
 
                if (ret == 0) {
                        /** Set the character device's hardware address. This is used when
index c39de422e220d85939e44b3a15eed8478e9f0881..5f3f34e1dbfdc140f426c4660258ba54029780fd 100644 (file)
@@ -3829,7 +3829,7 @@ static void b43legacy_print_driverinfo(void)
 #ifdef CONFIG_B43LEGACY_DMA
        feat_dma = "D";
 #endif
-       printk(KERN_INFO "Broadcom 43xx driver loaded "
+       printk(KERN_INFO "Broadcom 43xx-legacy driver loaded "
               "[ Features: %s%s%s%s%s, Firmware-ID: "
               B43legacy_SUPPORTED_FIRMWARE_ID " ]\n",
               feat_pci, feat_leds, feat_rfkill, feat_pio, feat_dma);
index 159216a91903d14e5f5ec5df62321d302f72b504..bdc6a1cc21033f44f1c322e38d2c3a626ab31fc5 100644 (file)
@@ -562,9 +562,7 @@ int lbs_process_rx_command(struct lbs_private *priv)
        }
 
        resp = (void *)priv->upld_buf;
-
-       curcmd = le16_to_cpu(resp->command);
-
+       curcmd = le16_to_cpu(priv->cur_cmd->cmdbuf->command);
        respcmd = le16_to_cpu(resp->command);
        result = le16_to_cpu(resp->result);
 
@@ -572,9 +570,9 @@ int lbs_process_rx_command(struct lbs_private *priv)
                     respcmd, le16_to_cpu(resp->seqnum), priv->upld_len, jiffies);
        lbs_deb_hex(LBS_DEB_HOST, "CMD_RESP", (void *) resp, priv->upld_len);
 
-       if (resp->seqnum != resp->seqnum) {
+       if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
                lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
-                           le16_to_cpu(resp->seqnum), le16_to_cpu(resp->seqnum));
+                           le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
                spin_unlock_irqrestore(&priv->driver_lock, flags);
                ret = -1;
                goto done;
index 5cda49aff3a86a12b0bdfda94b3bab5de3d83344..d191e055a788210e4a2b6343f4815b1bf120180d 100644 (file)
@@ -166,18 +166,23 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
        struct p54_common *priv = dev->priv;
        struct eeprom_pda_wrap *wrap = NULL;
        struct pda_entry *entry;
-       int i = 0;
        unsigned int data_len, entry_len;
        void *tmp;
        int err;
+       u8 *end = (u8 *)eeprom + len;
 
        wrap = (struct eeprom_pda_wrap *) eeprom;
-       entry = (void *)wrap->data + wrap->len;
-       i += 2;
-       i += le16_to_cpu(entry->len)*2;
-       while (i < len) {
+       entry = (void *)wrap->data + le16_to_cpu(wrap->len);
+
+       /* verify that at least the entry length/code fits */
+       while ((u8 *)entry <= end - sizeof(*entry)) {
                entry_len = le16_to_cpu(entry->len);
                data_len = ((entry_len - 1) << 1);
+
+               /* abort if entry exceeds whole structure */
+               if ((u8 *)entry + sizeof(*entry) + data_len > end)
+                       break;
+
                switch (le16_to_cpu(entry->code)) {
                case PDR_MAC_ADDRESS:
                        SET_IEEE80211_PERM_ADDR(dev, entry->data);
@@ -249,13 +254,12 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
                        priv->version = *(u8 *)(entry->data + 1);
                        break;
                case PDR_END:
-                       i = len;
+                       /* make it overrun */
+                       entry_len = len;
                        break;
                }
 
                entry = (void *)entry + (entry_len + 1)*2;
-               i += 2;
-               i += entry_len*2;
        }
 
        if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) {
index a721334e20d96db17af5e4dd760fdaf90f00c4a0..b67ff34e26fec96dfc8de785fa448a4af3d8ad8c 100644 (file)
@@ -53,10 +53,10 @@ struct pda_entry {
 } __attribute__ ((packed));
 
 struct eeprom_pda_wrap {
-       u32 magic;
-       u16 pad;
-       u16 len;
-       u32 arm_opcode;
+       __le32 magic;
+       __le16 pad;
+       __le16 len;
+       __le32 arm_opcode;
        u8 data[0];
 } __attribute__ ((packed));
 
index d9460aed1f22b772917a3847bdb73ef56a3604f2..10b776c1adc5a2ec20034329d6f3fb07cd25a60e 100644 (file)
@@ -260,7 +260,7 @@ struct NDIS_802_11_KEY {
        __le32 KeyLength;
        u8 Bssid[6];
        u8 Padding[6];
-       __le64 KeyRSC;
+       u8 KeyRSC[8];
        u8 KeyMaterial[32];
 } __attribute__((packed));
 
@@ -1508,7 +1508,7 @@ static int rndis_iw_set_encode_ext(struct net_device *dev,
        struct usbnet *usbdev = dev->priv;
        struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev);
        struct NDIS_802_11_KEY ndis_key;
-       int i, keyidx, ret;
+       int keyidx, ret;
        u8 *addr;
 
        keyidx = wrqu->encoding.flags & IW_ENCODE_INDEX;
@@ -1543,9 +1543,7 @@ static int rndis_iw_set_encode_ext(struct net_device *dev,
        ndis_key.KeyIndex = cpu_to_le32(keyidx);
 
        if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
-               for (i = 0; i < 6; i++)
-                       ndis_key.KeyRSC |=
-                               cpu_to_le64(ext->rx_seq[i] << (i * 8));
+               memcpy(ndis_key.KeyRSC, ext->rx_seq, 6);
                ndis_key.KeyIndex |= cpu_to_le32(1 << 29);
        }
 
index 1d3b84b4af3fc5fb0937763098f7f65e57fb80fd..553a9905299a9cb80f1171ca24d3f449532ca719 100644 (file)
@@ -103,6 +103,11 @@ config IOMMU_SBA
        depends on PCI_LBA
        default PCI_LBA
 
+config IOMMU_HELPER
+       bool
+       depends on IOMMU_SBA || IOMMU_CCIO
+       default y
+
 #config PCI_EPIC
 #      bool "EPIC/SAGA PCI support"
 #      depends on PCI
index d08b284de196b2e807518ac656d678e585f9560c..62db3c3fe4dcbd35dcd6181c4061954e4b0b0d87 100644 (file)
@@ -43,6 +43,7 @@
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/scatterlist.h>
+#include <linux/iommu-helper.h>
 
 #include <asm/byteorder.h>
 #include <asm/cache.h>         /* for L1_CACHE_BYTES */
@@ -302,13 +303,17 @@ static int ioc_count;
 */
 #define CCIO_SEARCH_LOOP(ioc, res_idx, mask, size)  \
        for(; res_ptr < res_end; ++res_ptr) { \
-               if(0 == (*res_ptr & mask)) { \
-                       *res_ptr |= mask; \
-                       res_idx = (unsigned int)((unsigned long)res_ptr - (unsigned long)ioc->res_map); \
-                       ioc->res_hint = res_idx + (size >> 3); \
-                       goto resource_found; \
-               } \
-       }
+               int ret;\
+               unsigned int idx;\
+               idx = (unsigned int)((unsigned long)res_ptr - (unsigned long)ioc->res_map); \
+               ret = iommu_is_span_boundary(idx << 3, pages_needed, 0, boundary_size);\
+               if ((0 == (*res_ptr & mask)) && !ret) { \
+                       *res_ptr |= mask; \
+                       res_idx = idx;\
+                       ioc->res_hint = res_idx + (size >> 3); \
+                       goto resource_found; \
+               } \
+       }
 
 #define CCIO_FIND_FREE_MAPPING(ioa, res_idx, mask, size) \
        u##size *res_ptr = (u##size *)&((ioc)->res_map[ioa->res_hint & ~((size >> 3) - 1)]); \
@@ -341,10 +346,11 @@ static int ioc_count;
  * of available pages for the requested size.
  */
 static int
-ccio_alloc_range(struct ioc *ioc, size_t size)
+ccio_alloc_range(struct ioc *ioc, struct device *dev, size_t size)
 {
        unsigned int pages_needed = size >> IOVP_SHIFT;
        unsigned int res_idx;
+       unsigned long boundary_size;
 #ifdef CCIO_SEARCH_TIME
        unsigned long cr_start = mfctl(16);
 #endif
@@ -360,6 +366,9 @@ ccio_alloc_range(struct ioc *ioc, size_t size)
        ** ggg sacrifices another 710 to the computer gods.
        */
 
+       boundary_size = ALIGN((unsigned long long)dma_get_seg_boundary(dev) + 1,
+                             1ULL << IOVP_SHIFT) >> IOVP_SHIFT;
+
        if (pages_needed <= 8) {
                /*
                 * LAN traffic will not thrash the TLB IFF the same NIC
@@ -760,7 +769,7 @@ ccio_map_single(struct device *dev, void *addr, size_t size,
        ioc->msingle_pages += size >> IOVP_SHIFT;
 #endif
 
-       idx = ccio_alloc_range(ioc, size);
+       idx = ccio_alloc_range(ioc, dev, size);
        iovp = (dma_addr_t)MKIOVP(idx);
 
        pdir_start = &(ioc->pdir_base[idx]);
index 97ba8286c5969285294c2dd886a0e375071f4878..a9c46cc2db3701157485b8194af83a6c03c7b189 100644 (file)
@@ -96,8 +96,8 @@ iommu_fill_pdir(struct ioc *ioc, struct scatterlist *startsg, int nents,
 
 static inline unsigned int
 iommu_coalesce_chunks(struct ioc *ioc, struct device *dev,
-                     struct scatterlist *startsg, int nents,
-                     int (*iommu_alloc_range)(struct ioc *, size_t))
+               struct scatterlist *startsg, int nents,
+               int (*iommu_alloc_range)(struct ioc *, struct device *, size_t))
 {
        struct scatterlist *contig_sg;     /* contig chunk head */
        unsigned long dma_offset, dma_len; /* start/len of DMA stream */
@@ -166,7 +166,7 @@ iommu_coalesce_chunks(struct ioc *ioc, struct device *dev,
                dma_len = ALIGN(dma_len + dma_offset, IOVP_SIZE);
                sg_dma_address(contig_sg) =
                        PIDE_FLAG 
-                       | (iommu_alloc_range(ioc, dma_len) << IOVP_SHIFT)
+                       | (iommu_alloc_range(ioc, dev, dma_len) << IOVP_SHIFT)
                        | dma_offset;
                n_mappings++;
        }
index d06627c3f353a607f7730b300af68a3d607b83b6..bdbe780e21c51e36de99d359c4304bfac2cc2054 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/string.h>
 #include <linux/pci.h>
 #include <linux/scatterlist.h>
+#include <linux/iommu-helper.h>
 
 #include <asm/byteorder.h>
 #include <asm/io.h>
@@ -313,6 +314,12 @@ sba_dump_sg( struct ioc *ioc, struct scatterlist *startsg, int nents)
 #define RESMAP_MASK(n)    (~0UL << (BITS_PER_LONG - (n)))
 #define RESMAP_IDX_MASK   (sizeof(unsigned long) - 1)
 
+unsigned long ptr_to_pide(struct ioc *ioc, unsigned long *res_ptr,
+                         unsigned int bitshiftcnt)
+{
+       return (((unsigned long)res_ptr - (unsigned long)ioc->res_map) << 3)
+               + bitshiftcnt;
+}
 
 /**
  * sba_search_bitmap - find free space in IO PDIR resource bitmap
@@ -324,19 +331,36 @@ sba_dump_sg( struct ioc *ioc, struct scatterlist *startsg, int nents)
  * Cool perf optimization: search for log2(size) bits at a time.
  */
 static SBA_INLINE unsigned long
-sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted)
+sba_search_bitmap(struct ioc *ioc, struct device *dev,
+                 unsigned long bits_wanted)
 {
        unsigned long *res_ptr = ioc->res_hint;
        unsigned long *res_end = (unsigned long *) &(ioc->res_map[ioc->res_size]);
-       unsigned long pide = ~0UL;
+       unsigned long pide = ~0UL, tpide;
+       unsigned long boundary_size;
+       unsigned long shift;
+       int ret;
+
+       boundary_size = ALIGN((unsigned long long)dma_get_seg_boundary(dev) + 1,
+                             1ULL << IOVP_SHIFT) >> IOVP_SHIFT;
+
+#if defined(ZX1_SUPPORT)
+       BUG_ON(ioc->ibase & ~IOVP_MASK);
+       shift = ioc->ibase >> IOVP_SHIFT;
+#else
+       shift = 0;
+#endif
 
        if (bits_wanted > (BITS_PER_LONG/2)) {
                /* Search word at a time - no mask needed */
                for(; res_ptr < res_end; ++res_ptr) {
-                       if (*res_ptr == 0) {
+                       tpide = ptr_to_pide(ioc, res_ptr, 0);
+                       ret = iommu_is_span_boundary(tpide, bits_wanted,
+                                                    shift,
+                                                    boundary_size);
+                       if ((*res_ptr == 0) && !ret) {
                                *res_ptr = RESMAP_MASK(bits_wanted);
-                               pide = ((unsigned long)res_ptr - (unsigned long)ioc->res_map);
-                               pide <<= 3;     /* convert to bit address */
+                               pide = tpide;
                                break;
                        }
                }
@@ -365,11 +389,13 @@ sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted)
                { 
                        DBG_RES("    %p %lx %lx\n", res_ptr, mask, *res_ptr);
                        WARN_ON(mask == 0);
-                       if(((*res_ptr) & mask) == 0) {
+                       tpide = ptr_to_pide(ioc, res_ptr, bitshiftcnt);
+                       ret = iommu_is_span_boundary(tpide, bits_wanted,
+                                                    shift,
+                                                    boundary_size);
+                       if ((((*res_ptr) & mask) == 0) && !ret) {
                                *res_ptr |= mask;     /* mark resources busy! */
-                               pide = ((unsigned long)res_ptr - (unsigned long)ioc->res_map);
-                               pide <<= 3;     /* convert to bit address */
-                               pide += bitshiftcnt;
+                               pide = tpide;
                                break;
                        }
                        mask >>= o;
@@ -404,7 +430,7 @@ sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted)
  * resource bit map.
  */
 static int
-sba_alloc_range(struct ioc *ioc, size_t size)
+sba_alloc_range(struct ioc *ioc, struct device *dev, size_t size)
 {
        unsigned int pages_needed = size >> IOVP_SHIFT;
 #ifdef SBA_COLLECT_STATS
@@ -412,9 +438,9 @@ sba_alloc_range(struct ioc *ioc, size_t size)
 #endif
        unsigned long pide;
 
-       pide = sba_search_bitmap(ioc, pages_needed);
+       pide = sba_search_bitmap(ioc, dev, pages_needed);
        if (pide >= (ioc->res_size << 3)) {
-               pide = sba_search_bitmap(ioc, pages_needed);
+               pide = sba_search_bitmap(ioc, dev, pages_needed);
                if (pide >= (ioc->res_size << 3))
                        panic("%s: I/O MMU @ %p is out of mapping resources\n",
                              __FILE__, ioc->ioc_hpa);
@@ -710,7 +736,7 @@ sba_map_single(struct device *dev, void *addr, size_t size,
        ioc->msingle_calls++;
        ioc->msingle_pages += size >> IOVP_SHIFT;
 #endif
-       pide = sba_alloc_range(ioc, size);
+       pide = sba_alloc_range(ioc, dev, size);
        iovp = (dma_addr_t) pide << IOVP_SHIFT;
 
        DBG_RUN("%s() 0x%p -> 0x%lx\n",
index ef5a6a245f5fa36363d513e5aa35fef248a499a4..6a9403d79e0c6fdd70ab80daecf85c6fed514488 100644 (file)
@@ -145,13 +145,15 @@ void pci_bus_add_devices(struct pci_bus *bus)
                        child_bus = dev->subordinate;
                        child_bus->dev.parent = child_bus->bridge;
                        retval = device_register(&child_bus->dev);
-                       if (!retval)
+                       if (retval)
+                               dev_err(&dev->dev, "Error registering pci_bus,"
+                                       " continuing...\n");
+                       else
                                retval = device_create_file(&child_bus->dev,
                                                        &dev_attr_cpuaffinity);
                        if (retval)
-                               dev_err(&dev->dev, "Error registering pci_bus"
-                                       " device bridge symlink,"
-                                       " continuing...\n");
+                               dev_err(&dev->dev, "Error creating cpuaffinity"
+                                       " file, continuing...\n");
                }
        }
 }
index a590ef682153ee5d765af348640ce79d39a9d4e8..4d4a64478404650a9640c852b3cf708937fc5ff0 100644 (file)
@@ -4,7 +4,7 @@
 #include "pci.h"
 
 
-unsigned int pci_do_scan_bus(struct pci_bus *bus)
+unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
 {
        unsigned int max;
 
index cf22f9e01e005721257bd61c7a2894008f65b497..5e50008d1181046ea2b77378f68c4fd7596c1914 100644 (file)
@@ -1085,7 +1085,7 @@ static int acpiphp_bus_trim(acpi_handle handle)
  * This function should be called per *physical slot*,
  * not per each slot object in ACPI namespace.
  */
-static int enable_device(struct acpiphp_slot *slot)
+static int __ref enable_device(struct acpiphp_slot *slot)
 {
        struct pci_dev *dev;
        struct pci_bus *bus = slot->bridge->pci_bus;
index 5e9be44817cb5ff4daa3f8bc5b04f6f45f10e6d3..b3515fc4cd38383fd2a25860b346b514006c3c52 100644 (file)
@@ -250,7 +250,7 @@ int cpci_led_off(struct slot* slot)
  * Device configuration functions
  */
 
-int cpci_configure_slot(struct slot* slot)
+int __ref cpci_configure_slot(struct slot *slot)
 {
        struct pci_bus *parent;
        int fn;
index 6eba9b2cfb90b359fc1fb92b45408846b4694f6f..698975a6a21c712b46654cba06b71b641612a143 100644 (file)
@@ -711,7 +711,8 @@ static int hpc_power_off_slot(struct slot * slot)
        retval = pcie_write_cmd(slot, slot_cmd, cmd_mask);
        if (retval) {
                err("%s: Write command failed!\n", __FUNCTION__);
-               return -1;
+               retval = -1;
+               goto out;
        }
        dbg("%s: SLOTCTRL %x write cmd %x\n",
            __FUNCTION__, ctrl->cap_base + SLOTCTRL, slot_cmd);
@@ -722,7 +723,7 @@ static int hpc_power_off_slot(struct slot * slot)
         * removed from the slot/adapter.
         */
        msleep(1000);
-
+ out:
        if (changed)
                pcie_unmask_bad_dllp(ctrl);
 
index dd50713966d1b011bc480aa9d2cab642c63bb7c9..9372a840b63dbd3d43147dca446c3f078455a2e5 100644 (file)
@@ -167,7 +167,7 @@ static void program_fw_provided_values(struct pci_dev *dev)
        }
 }
 
-static int pciehp_add_bridge(struct pci_dev *dev)
+static int __ref pciehp_add_bridge(struct pci_dev *dev)
 {
        struct pci_bus *parent = dev->bus;
        int pass, busnr, start = parent->secondary;
index 0a6b25ef194c2991e36d3be4e2bb605b61a4bed4..a69a21520895814caf732ab93735b9a950688c60 100644 (file)
@@ -96,7 +96,7 @@ static void program_fw_provided_values(struct pci_dev *dev)
        }
 }
 
-int shpchp_configure_device(struct slot *p_slot)
+int __ref shpchp_configure_device(struct slot *p_slot)
 {
        struct pci_dev *dev;
        struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
index 4d23b9fb551bc129239f07404e04f6a4102ae092..2db2e4bb0d1ed6073b6ec9d3e0dec604868974ab 100644 (file)
@@ -286,7 +286,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
        }
 }
 
-void pci_read_bridge_bases(struct pci_bus *child)
+void __devinit pci_read_bridge_bases(struct pci_bus *child)
 {
        struct pci_dev *dev = child->self;
        u8 io_base_lo, io_limit_lo;
@@ -472,7 +472,7 @@ static void pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
  * them, we proceed to assigning numbers to the remaining buses in
  * order to avoid overlaps between old and new bus numbers.
  */
-int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass)
+int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
 {
        struct pci_bus *child;
        int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
@@ -1008,7 +1008,7 @@ int pci_scan_slot(struct pci_bus *bus, int devfn)
        return nr;
 }
 
-unsigned int pci_scan_child_bus(struct pci_bus *bus)
+unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
 {
        unsigned int devfn, pass, max = bus->secondary;
        struct pci_dev *dev;
@@ -1116,7 +1116,7 @@ err_out:
        return NULL;
 }
 
-struct pci_bus *pci_scan_bus_parented(struct device *parent,
+struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
                int bus, struct pci_ops *ops, void *sysdata)
 {
        struct pci_bus *b;
index bbad4a9f264f0045dfc091cb1f96cb5877eb11ce..e9a333d985526c5a5af22c1e6cc79c3e2dccad10 100644 (file)
@@ -1652,9 +1652,8 @@ static void __devinit quirk_via_cx700_pci_parking_caching(struct pci_dev *dev)
                        pci_write_config_byte(dev, 0x75, 0x1);
                        pci_write_config_byte(dev, 0x77, 0x0);
 
-                       printk(KERN_INFO
-                               "PCI: VIA CX700 PCI parking/caching fixup on %s\n",
-                               pci_name(dev));
+                       dev_info(&dev->dev,
+                               "Disabling VIA CX700 PCI parking/caching\n");
                }
        }
 }
@@ -1726,32 +1725,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT2
                        quirk_msi_ht_cap);
 
 
-/*
- *  Force enable MSI mapping capability on HT bridges
- */
-static void __devinit quirk_msi_ht_cap_enable(struct pci_dev *dev)
-{
-       int pos, ttl = 48;
-
-       pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING);
-       while (pos && ttl--) {
-               u8 flags;
-
-               if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, &flags) == 0) {
-                       printk(KERN_INFO "PCI: Enabling HT MSI Mapping on %s\n",
-                              pci_name(dev));
-
-                       pci_write_config_byte(dev, pos + HT_MSI_FLAGS,
-                                             flags | HT_MSI_FLAGS_ENABLE);
-               }
-               pos = pci_find_next_ht_capability(dev, pos,
-                                                 HT_CAPTYPE_MSI_MAPPING);
-       }
-}
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
-                        PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB,
-                        quirk_msi_ht_cap_enable);
-
 /* The nVidia CK804 chipset may have 2 HT MSI mappings.
  * MSI are supported if the MSI capability set in any of these mappings.
  */
@@ -1778,9 +1751,8 @@ static void __devinit quirk_nvidia_ck804_msi_ht_cap(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
                        quirk_nvidia_ck804_msi_ht_cap);
 
-/*
- *  Force enable MSI mapping capability on HT bridges  */
-static inline void ht_enable_msi_mapping(struct pci_dev *dev)
+/* Force enable MSI mapping capability on HT bridges */
+static void __devinit ht_enable_msi_mapping(struct pci_dev *dev)
 {
        int pos, ttl = 48;
 
@@ -1799,6 +1771,9 @@ static inline void ht_enable_msi_mapping(struct pci_dev *dev)
                                                  HT_CAPTYPE_MSI_MAPPING);
        }
 }
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
+                        PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB,
+                        ht_enable_msi_mapping);
 
 static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev)
 {
@@ -1830,7 +1805,7 @@ static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev)
 
                if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS,
                                         &flags) == 0) {
-                       dev_info(&dev->dev, "Quirk disabling HT MSI mapping");
+                       dev_info(&dev->dev, "Disabling HT MSI mapping");
                        pci_write_config_byte(dev, pos + HT_MSI_FLAGS,
                                              flags & ~HT_MSI_FLAGS_ENABLE);
                }
index a98b2470b9ea5f85b95a3ae3c9da79aeafb29363..bd5c0e031398e9b50404380076b69c0c25889c71 100644 (file)
@@ -242,8 +242,7 @@ void pci_remove_rom(struct pci_dev *pdev)
 #endif  /*  0  */
 
 /**
- * pci_cleanup_rom - internal routine for freeing the ROM copy created
- * by pci_map_rom_copy called from remove.c
+ * pci_cleanup_rom - free the ROM copy created by pci_map_rom_copy
  * @pdev: pointer to pci device struct
  *
  * Free the copied ROM if we allocated one.
index 5480119ff9d36d94af3dce527dbaacac4d5811d7..3ce9f3defc1287f688f6484f2f265b7cdb620125 100644 (file)
@@ -78,8 +78,7 @@ void rio_dev_put(struct rio_dev *rdev)
 }
 
 /**
- *  rio_device_probe - Tell if a RIO device structure has a matching RIO
- *                     device id structure
+ *  rio_device_probe - Tell if a RIO device structure has a matching RIO device id structure
  *  @id: the RIO device id structure to match against
  *  @dev: the RIO device structure to match against
  *
@@ -137,7 +136,7 @@ static int rio_device_remove(struct device *dev)
  *  rio_register_driver - register a new RIO driver
  *  @rdrv: the RIO driver structure to register
  *
- *  Adds a &struct rio_driver to the list of registered drivers
+ *  Adds a &struct rio_driver to the list of registered drivers.
  *  Returns a negative value on error, otherwise 0. If no error
  *  occurred, the driver remains registered even if no device
  *  was claimed during registration.
@@ -167,8 +166,7 @@ void rio_unregister_driver(struct rio_driver *rdrv)
 }
 
 /**
- *  rio_match_bus - Tell if a RIO device structure has a matching RIO
- *                  driver device id structure
+ *  rio_match_bus - Tell if a RIO device structure has a matching RIO driver device id structure
  *  @dev: the standard device structure to match against
  *  @drv: the standard driver structure containing the ids to match against
  *
index 6402d699072b5a28a11069a5188dd2e34245a079..82f5ad9c3af479a86e711819b8cea6ddfc42f947 100644 (file)
@@ -250,6 +250,15 @@ config RTC_DRV_TWL92330
          platforms.  The support is integrated with the rest of
          the Menelaus driver; it's not separate module.
 
+config RTC_DRV_S35390A
+       tristate "Seiko Instruments S-35390A"
+       help
+         If you say yes here you will get support for the Seiko
+         Instruments S-35390A.
+
+         This driver can also be built as a module. If so the module
+         will be called rtc-s35390a.
+
 endif # I2C
 
 comment "SPI RTC drivers"
index ec703f34ab864da930d3eadbe594d0ca67fb5bfa..872f1218ff9f5d7e2480a8128b481a33e4a4d096 100644 (file)
@@ -45,6 +45,7 @@ obj-$(CONFIG_RTC_DRV_R9701)   += rtc-r9701.o
 obj-$(CONFIG_RTC_DRV_RS5C313)  += rtc-rs5c313.o
 obj-$(CONFIG_RTC_DRV_RS5C348)  += rtc-rs5c348.o
 obj-$(CONFIG_RTC_DRV_RS5C372)  += rtc-rs5c372.o
+obj-$(CONFIG_RTC_DRV_S35390A)  += rtc-s35390a.o
 obj-$(CONFIG_RTC_DRV_S3C)      += rtc-s3c.o
 obj-$(CONFIG_RTC_DRV_SA1100)   += rtc-sa1100.o
 obj-$(CONFIG_RTC_DRV_SH)       += rtc-sh.o
diff --git a/drivers/rtc/rtc-s35390a.c b/drivers/rtc/rtc-s35390a.c
new file mode 100644 (file)
index 0000000..e8abc90
--- /dev/null
@@ -0,0 +1,316 @@
+/*
+ * Seiko Instruments S-35390A RTC Driver
+ *
+ * Copyright (c) 2007 Byron Bradley
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/module.h>
+#include <linux/rtc.h>
+#include <linux/i2c.h>
+#include <linux/bitrev.h>
+#include <linux/bcd.h>
+#include <linux/slab.h>
+
+#define S35390A_CMD_STATUS1    0
+#define S35390A_CMD_STATUS2    1
+#define S35390A_CMD_TIME1      2
+
+#define S35390A_BYTE_YEAR      0
+#define S35390A_BYTE_MONTH     1
+#define S35390A_BYTE_DAY       2
+#define S35390A_BYTE_WDAY      3
+#define S35390A_BYTE_HOURS     4
+#define S35390A_BYTE_MINS      5
+#define S35390A_BYTE_SECS      6
+
+#define S35390A_FLAG_POC       0x01
+#define S35390A_FLAG_BLD       0x02
+#define S35390A_FLAG_24H       0x40
+#define S35390A_FLAG_RESET     0x80
+#define S35390A_FLAG_TEST      0x01
+
+struct s35390a {
+       struct i2c_client *client[8];
+       struct rtc_device *rtc;
+       int twentyfourhour;
+};
+
+static int s35390a_set_reg(struct s35390a *s35390a, int reg, char *buf, int len)
+{
+       struct i2c_client *client = s35390a->client[reg];
+       struct i2c_msg msg[] = {
+               { client->addr, 0, len, buf },
+       };
+
+       if ((i2c_transfer(client->adapter, msg, 1)) != 1)
+               return -EIO;
+
+       return 0;
+}
+
+static int s35390a_get_reg(struct s35390a *s35390a, int reg, char *buf, int len)
+{
+       struct i2c_client *client = s35390a->client[reg];
+       struct i2c_msg msg[] = {
+               { client->addr, I2C_M_RD, len, buf },
+       };
+
+       if ((i2c_transfer(client->adapter, msg, 1)) != 1)
+               return -EIO;
+
+       return 0;
+}
+
+static int s35390a_reset(struct s35390a *s35390a)
+{
+       char buf[1];
+
+       if (s35390a_get_reg(s35390a, S35390A_CMD_STATUS1, buf, sizeof(buf)) < 0)
+               return -EIO;
+
+       if (!(buf[0] & (S35390A_FLAG_POC | S35390A_FLAG_BLD)))
+               return 0;
+
+       buf[0] |= (S35390A_FLAG_RESET | S35390A_FLAG_24H);
+       buf[0] &= 0xf0;
+       return s35390a_set_reg(s35390a, S35390A_CMD_STATUS1, buf, sizeof(buf));
+}
+
+static int s35390a_disable_test_mode(struct s35390a *s35390a)
+{
+       char buf[1];
+
+       if (s35390a_get_reg(s35390a, S35390A_CMD_STATUS2, buf, sizeof(buf)) < 0)
+               return -EIO;
+
+       if (!(buf[0] & S35390A_FLAG_TEST))
+               return 0;
+
+       buf[0] &= ~S35390A_FLAG_TEST;
+       return s35390a_set_reg(s35390a, S35390A_CMD_STATUS2, buf, sizeof(buf));
+}
+
+static char s35390a_hr2reg(struct s35390a *s35390a, int hour)
+{
+       if (s35390a->twentyfourhour)
+               return BIN2BCD(hour);
+
+       if (hour < 12)
+               return BIN2BCD(hour);
+
+       return 0x40 | BIN2BCD(hour - 12);
+}
+
+static int s35390a_reg2hr(struct s35390a *s35390a, char reg)
+{
+       unsigned hour;
+
+       if (s35390a->twentyfourhour)
+               return BCD2BIN(reg & 0x3f);
+
+       hour = BCD2BIN(reg & 0x3f);
+       if (reg & 0x40)
+               hour += 12;
+
+       return hour;
+}
+
+static int s35390a_set_datetime(struct i2c_client *client, struct rtc_time *tm)
+{
+       struct s35390a  *s35390a = i2c_get_clientdata(client);
+       int i, err;
+       char buf[7];
+
+       dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d mday=%d, "
+               "mon=%d, year=%d, wday=%d\n", __func__, tm->tm_sec,
+               tm->tm_min, tm->tm_hour, tm->tm_mday, tm->tm_mon, tm->tm_year,
+               tm->tm_wday);
+
+       buf[S35390A_BYTE_YEAR] = BIN2BCD(tm->tm_year - 100);
+       buf[S35390A_BYTE_MONTH] = BIN2BCD(tm->tm_mon + 1);
+       buf[S35390A_BYTE_DAY] = BIN2BCD(tm->tm_mday);
+       buf[S35390A_BYTE_WDAY] = BIN2BCD(tm->tm_wday);
+       buf[S35390A_BYTE_HOURS] = s35390a_hr2reg(s35390a, tm->tm_hour);
+       buf[S35390A_BYTE_MINS] = BIN2BCD(tm->tm_min);
+       buf[S35390A_BYTE_SECS] = BIN2BCD(tm->tm_sec);
+
+       /* This chip expects the bits of each byte to be in reverse order */
+       for (i = 0; i < 7; ++i)
+               buf[i] = bitrev8(buf[i]);
+
+       err = s35390a_set_reg(s35390a, S35390A_CMD_TIME1, buf, sizeof(buf));
+
+       return err;
+}
+
+static int s35390a_get_datetime(struct i2c_client *client, struct rtc_time *tm)
+{
+       struct s35390a *s35390a = i2c_get_clientdata(client);
+       char buf[7];
+       int i, err;
+
+       err = s35390a_get_reg(s35390a, S35390A_CMD_TIME1, buf, sizeof(buf));
+       if (err < 0)
+               return err;
+
+       /* This chip returns the bits of each byte in reverse order */
+       for (i = 0; i < 7; ++i)
+               buf[i] = bitrev8(buf[i]);
+
+       tm->tm_sec = BCD2BIN(buf[S35390A_BYTE_SECS]);
+       tm->tm_min = BCD2BIN(buf[S35390A_BYTE_MINS]);
+       tm->tm_hour = s35390a_reg2hr(s35390a, buf[S35390A_BYTE_HOURS]);
+       tm->tm_wday = BCD2BIN(buf[S35390A_BYTE_WDAY]);
+       tm->tm_mday = BCD2BIN(buf[S35390A_BYTE_DAY]);
+       tm->tm_mon = BCD2BIN(buf[S35390A_BYTE_MONTH]) - 1;
+       tm->tm_year = BCD2BIN(buf[S35390A_BYTE_YEAR]) + 100;
+
+       dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d, mday=%d, "
+               "mon=%d, year=%d, wday=%d\n", __func__, tm->tm_sec,
+               tm->tm_min, tm->tm_hour, tm->tm_mday, tm->tm_mon, tm->tm_year,
+               tm->tm_wday);
+
+       return rtc_valid_tm(tm);
+}
+
+static int s35390a_rtc_read_time(struct device *dev, struct rtc_time *tm)
+{
+       return s35390a_get_datetime(to_i2c_client(dev), tm);
+}
+
+static int s35390a_rtc_set_time(struct device *dev, struct rtc_time *tm)
+{
+       return s35390a_set_datetime(to_i2c_client(dev), tm);
+}
+
+static const struct rtc_class_ops s35390a_rtc_ops = {
+       .read_time      = s35390a_rtc_read_time,
+       .set_time       = s35390a_rtc_set_time,
+};
+
+static struct i2c_driver s35390a_driver;
+
+static int s35390a_probe(struct i2c_client *client)
+{
+       int err;
+       unsigned int i;
+       struct s35390a *s35390a;
+       struct rtc_time tm;
+       char buf[1];
+
+       if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
+               err = -ENODEV;
+               goto exit;
+       }
+
+       s35390a = kzalloc(sizeof(struct s35390a), GFP_KERNEL);
+       if (!s35390a) {
+               err = -ENOMEM;
+               goto exit;
+       }
+
+       s35390a->client[0] = client;
+       i2c_set_clientdata(client, s35390a);
+
+       /* This chip uses multiple addresses, use dummy devices for them */
+       for (i = 1; i < 8; ++i) {
+               s35390a->client[i] = i2c_new_dummy(client->adapter,
+                                       client->addr + i, "rtc-s35390a");
+               if (!s35390a->client[i]) {
+                       dev_err(&client->dev, "Address %02x unavailable\n",
+                                               client->addr + i);
+                       err = -EBUSY;
+                       goto exit_dummy;
+               }
+       }
+
+       err = s35390a_reset(s35390a);
+       if (err < 0) {
+               dev_err(&client->dev, "error resetting chip\n");
+               goto exit_dummy;
+       }
+
+       err = s35390a_disable_test_mode(s35390a);
+       if (err < 0) {
+               dev_err(&client->dev, "error disabling test mode\n");
+               goto exit_dummy;
+       }
+
+       err = s35390a_get_reg(s35390a, S35390A_CMD_STATUS1, buf, sizeof(buf));
+       if (err < 0) {
+               dev_err(&client->dev, "error checking 12/24 hour mode\n");
+               goto exit_dummy;
+       }
+       if (buf[0] & S35390A_FLAG_24H)
+               s35390a->twentyfourhour = 1;
+       else
+               s35390a->twentyfourhour = 0;
+
+       if (s35390a_get_datetime(client, &tm) < 0)
+               dev_warn(&client->dev, "clock needs to be set\n");
+
+       s35390a->rtc = rtc_device_register(s35390a_driver.driver.name,
+                               &client->dev, &s35390a_rtc_ops, THIS_MODULE);
+
+       if (IS_ERR(s35390a->rtc)) {
+               err = PTR_ERR(s35390a->rtc);
+               goto exit_dummy;
+       }
+       return 0;
+
+exit_dummy:
+       for (i = 1; i < 8; ++i)
+               if (s35390a->client[i])
+                       i2c_unregister_device(s35390a->client[i]);
+       kfree(s35390a);
+       i2c_set_clientdata(client, NULL);
+
+exit:
+       return err;
+}
+
+static int s35390a_remove(struct i2c_client *client)
+{
+       unsigned int i;
+
+       struct s35390a *s35390a = i2c_get_clientdata(client);
+       for (i = 1; i < 8; ++i)
+               if (s35390a->client[i])
+                       i2c_unregister_device(s35390a->client[i]);
+
+       rtc_device_unregister(s35390a->rtc);
+       kfree(s35390a);
+       i2c_set_clientdata(client, NULL);
+
+       return 0;
+}
+
+static struct i2c_driver s35390a_driver = {
+       .driver         = {
+               .name   = "rtc-s35390a",
+       },
+       .probe          = s35390a_probe,
+       .remove         = s35390a_remove,
+};
+
+static int __init s35390a_rtc_init(void)
+{
+       return i2c_add_driver(&s35390a_driver);
+}
+
+static void __exit s35390a_rtc_exit(void)
+{
+       i2c_del_driver(&s35390a_driver);
+}
+
+MODULE_AUTHOR("Byron Bradley <byron.bbradley@gmail.com>");
+MODULE_DESCRIPTION("S35390A RTC driver");
+MODULE_LICENSE("GPL");
+
+module_init(s35390a_rtc_init);
+module_exit(s35390a_rtc_exit);
index f69714a0e9e7bf3ed750e3b497ce429d2f459ffb..b19db20a0befdc1c31ea98bdf691daaec6807f6f 100644 (file)
@@ -2310,10 +2310,8 @@ static int
 dasd_3990_erp_error_match(struct dasd_ccw_req *cqr1, struct dasd_ccw_req *cqr2)
 {
 
-       /* check failed CCW */
-       if (cqr1->irb.scsw.cpa != cqr2->irb.scsw.cpa) {
-               //      return 0;       /* CCW doesn't match */
-       }
+       if (cqr1->startdev != cqr2->startdev)
+               return 0;
 
        if (cqr1->irb.esw.esw0.erw.cons != cqr2->irb.esw.esw0.erw.cons)
                return 0;
index 28a86f070048b4a3a25719fb100546df9cd8ebd8..556063e8f7a91d1163450cc63d1cd9128e6a77b4 100644 (file)
@@ -62,8 +62,10 @@ dasd_devices_show(struct seq_file *m, void *v)
                return 0;
        if (device->block)
                block = device->block;
-       else
+       else {
+               dasd_put_device(device);
                return 0;
+       }
        /* Print device number. */
        seq_printf(m, "%s", device->cdev->dev.bus_id);
        /* Print discipline string. */
index 389346cda6c826fdecfb7d8663a7950ddd2fab43..07c7f31081bccbe629c7bcbd789bb7665e57edb3 100644 (file)
@@ -151,8 +151,8 @@ char *func_table[MAX_NR_FUNC] = {
 };
 
 struct kbdiacruc accent_table[MAX_DIACR] = {
-       {'^', 'c', '\003'},     {'^', 'd', '\004'},
-       {'^', 'z', '\032'},     {'^', '\012', '\000'},
+       {'^', 'c', 0003},       {'^', 'd', 0004},
+       {'^', 'z', 0032},       {'^', 0012, 0000},
 };
 
 unsigned int accent_table_size = 4;
index 92f527201792971095eea15a1503c0938d1eaeb0..f7b258dfd52cf5a40c14470654a240c0f29b0a93 100644 (file)
@@ -367,7 +367,7 @@ sclp_vt220_timeout(unsigned long data)
        sclp_vt220_emit_current();
 }
 
-#define BUFFER_MAX_DELAY       HZ/2
+#define BUFFER_MAX_DELAY       HZ/20
 
 /* 
  * Internal implementation of the write function. Write COUNT bytes of data
index d0c6fd3b1c19a02af51665e657fc102829d4d488..7b0b81901297e9b0d28d967dee4694fb2cd9fadc 100644 (file)
@@ -490,10 +490,12 @@ static int ap_device_probe(struct device *dev)
        int rc;
 
        ap_dev->drv = ap_drv;
-       spin_lock_bh(&ap_device_lock);
-       list_add(&ap_dev->list, &ap_device_list);
-       spin_unlock_bh(&ap_device_lock);
        rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV;
+       if (!rc) {
+               spin_lock_bh(&ap_device_lock);
+               list_add(&ap_dev->list, &ap_device_list);
+               spin_unlock_bh(&ap_device_lock);
+       }
        return rc;
 }
 
@@ -532,11 +534,11 @@ static int ap_device_remove(struct device *dev)
 
        ap_flush_queue(ap_dev);
        del_timer_sync(&ap_dev->timeout);
-       if (ap_drv->remove)
-               ap_drv->remove(ap_dev);
        spin_lock_bh(&ap_device_lock);
        list_del_init(&ap_dev->list);
        spin_unlock_bh(&ap_device_lock);
+       if (ap_drv->remove)
+               ap_drv->remove(ap_dev);
        spin_lock_bh(&ap_dev->lock);
        atomic_sub(ap_dev->queue_count, &ap_poll_requests);
        spin_unlock_bh(&ap_dev->lock);
index 32f513b1b78ab314253e7ddceb4117aa5e40fcad..eb8efdcefe482e0bf8997b566a72db30d76027ba 100644 (file)
@@ -102,6 +102,7 @@ int  asd_abort_task_set(struct domain_device *, u8 *lun);
 int  asd_clear_aca(struct domain_device *, u8 *lun);
 int  asd_clear_task_set(struct domain_device *, u8 *lun);
 int  asd_lu_reset(struct domain_device *, u8 *lun);
+int  asd_I_T_nexus_reset(struct domain_device *dev);
 int  asd_query_task(struct sas_task *);
 
 /* ---------- Adapter and Port management ---------- */
index 150f6706d23f8d95a024fbd5836da76bcd8ac91c..abc757559c1af2911584f3e14be97c69159d923c 100644 (file)
@@ -140,7 +140,7 @@ struct asd_ascb {
 
        /* internally generated command */
        struct timer_list timer;
-       struct completion completion;
+       struct completion *completion;
        u8        tag_valid:1;
        __be16    tag;            /* error recovery only */
 
@@ -294,7 +294,6 @@ static inline void asd_init_ascb(struct asd_ha_struct *asd_ha,
        ascb->timer.function = NULL;
        init_timer(&ascb->timer);
        ascb->tc_index = -1;
-       init_completion(&ascb->completion);
 }
 
 /* Must be called with the tc_index_lock held!
index 5d761eb67442356fa50e360e4cde33af360c8612..88d1e731b65e15b04e5e1a71f281ba1d2035a8d7 100644 (file)
@@ -1003,7 +1003,7 @@ static struct sas_domain_function_template aic94xx_transport_functions = {
        .lldd_abort_task_set    = asd_abort_task_set,
        .lldd_clear_aca         = asd_clear_aca,
        .lldd_clear_task_set    = asd_clear_task_set,
-       .lldd_I_T_nexus_reset   = NULL,
+       .lldd_I_T_nexus_reset   = asd_I_T_nexus_reset,
        .lldd_lu_reset          = asd_lu_reset,
        .lldd_query_task        = asd_query_task,
 
index 965d4bb999d919f314ec83e810c8ad85b0f17075..008df9ab92a5f89b57c8f8cf36fa8ede7abc36d8 100644 (file)
@@ -343,11 +343,13 @@ Again:
        task->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
        task->task_state_flags |= SAS_TASK_STATE_DONE;
        if (unlikely((task->task_state_flags & SAS_TASK_STATE_ABORTED))) {
+               struct completion *completion = ascb->completion;
                spin_unlock_irqrestore(&task->task_state_lock, flags);
                ASD_DPRINTK("task 0x%p done with opcode 0x%x resp 0x%x "
                            "stat 0x%x but aborted by upper layer!\n",
                            task, opcode, ts->resp, ts->stat);
-               complete(&ascb->completion);
+               if (completion)
+                       complete(completion);
        } else {
                spin_unlock_irqrestore(&task->task_state_lock, flags);
                task->lldd_task = NULL;
index 144f5ad20453bbc56ec010d8e870c881c0ef0fd2..b9ac8f703a1d7914d3f269a4e6bddee9a90cda4c 100644 (file)
@@ -53,50 +53,64 @@ static int asd_enqueue_internal(struct asd_ascb *ascb,
        return res;
 }
 
-static inline void asd_timedout_common(unsigned long data)
-{
-       struct asd_ascb *ascb = (void *) data;
-       struct asd_seq_data *seq = &ascb->ha->seq;
-        unsigned long flags;
+/* ---------- CLEAR NEXUS ---------- */
 
-       spin_lock_irqsave(&seq->pend_q_lock, flags);
-        seq->pending--;
-        list_del_init(&ascb->list);
-        spin_unlock_irqrestore(&seq->pend_q_lock, flags);
-}
+struct tasklet_completion_status {
+       int     dl_opcode;
+       int     tmf_state;
+       u8      tag_valid:1;
+       __be16  tag;
+};
+
+#define DECLARE_TCS(tcs) \
+       struct tasklet_completion_status tcs = { \
+               .dl_opcode = 0, \
+               .tmf_state = 0, \
+               .tag_valid = 0, \
+               .tag = 0, \
+       }
 
-/* ---------- CLEAR NEXUS ---------- */
 
 static void asd_clear_nexus_tasklet_complete(struct asd_ascb *ascb,
                                             struct done_list_struct *dl)
 {
+       struct tasklet_completion_status *tcs = ascb->uldd_task;
        ASD_DPRINTK("%s: here\n", __FUNCTION__);
        if (!del_timer(&ascb->timer)) {
                ASD_DPRINTK("%s: couldn't delete timer\n", __FUNCTION__);
                return;
        }
        ASD_DPRINTK("%s: opcode: 0x%x\n", __FUNCTION__, dl->opcode);
-       ascb->uldd_task = (void *) (unsigned long) dl->opcode;
-       complete(&ascb->completion);
+       tcs->dl_opcode = dl->opcode;
+       complete(ascb->completion);
+       asd_ascb_free(ascb);
 }
 
 static void asd_clear_nexus_timedout(unsigned long data)
 {
-       struct asd_ascb *ascb = (void *) data;
+       struct asd_ascb *ascb = (void *)data;
+       struct tasklet_completion_status *tcs = ascb->uldd_task;
 
        ASD_DPRINTK("%s: here\n", __FUNCTION__);
-       asd_timedout_common(data);
-       ascb->uldd_task = (void *) TMF_RESP_FUNC_FAILED;
-       complete(&ascb->completion);
+       tcs->dl_opcode = TMF_RESP_FUNC_FAILED;
+       complete(ascb->completion);
 }
 
 #define CLEAR_NEXUS_PRE         \
+       struct asd_ascb *ascb; \
+       struct scb *scb; \
+       int res; \
+       DECLARE_COMPLETION_ONSTACK(completion); \
+       DECLARE_TCS(tcs); \
+               \
        ASD_DPRINTK("%s: PRE\n", __FUNCTION__); \
         res = 1;                \
        ascb = asd_ascb_alloc_list(asd_ha, &res, GFP_KERNEL); \
        if (!ascb)              \
                return -ENOMEM; \
                                 \
+       ascb->completion = &completion; \
+       ascb->uldd_task = &tcs; \
        scb = ascb->scb;        \
        scb->header.opcode = CLEAR_NEXUS
 
@@ -107,10 +121,11 @@ static void asd_clear_nexus_timedout(unsigned long data)
        if (res)                \
                goto out_err;   \
        ASD_DPRINTK("%s: clear nexus posted, waiting...\n", __FUNCTION__); \
-       wait_for_completion(&ascb->completion); \
-       res = (int) (unsigned long) ascb->uldd_task; \
+       wait_for_completion(&completion); \
+       res = tcs.dl_opcode; \
        if (res == TC_NO_ERROR) \
                res = TMF_RESP_FUNC_COMPLETE;   \
+       return res; \
 out_err:                        \
        asd_ascb_free(ascb);    \
        return res
@@ -118,9 +133,6 @@ out_err:                        \
 int asd_clear_nexus_ha(struct sas_ha_struct *sas_ha)
 {
        struct asd_ha_struct *asd_ha = sas_ha->lldd_ha;
-       struct asd_ascb *ascb;
-       struct scb *scb;
-       int res;
 
        CLEAR_NEXUS_PRE;
        scb->clear_nexus.nexus = NEXUS_ADAPTER;
@@ -130,9 +142,6 @@ int asd_clear_nexus_ha(struct sas_ha_struct *sas_ha)
 int asd_clear_nexus_port(struct asd_sas_port *port)
 {
        struct asd_ha_struct *asd_ha = port->ha->lldd_ha;
-       struct asd_ascb *ascb;
-       struct scb *scb;
-       int res;
 
        CLEAR_NEXUS_PRE;
        scb->clear_nexus.nexus = NEXUS_PORT;
@@ -140,29 +149,73 @@ int asd_clear_nexus_port(struct asd_sas_port *port)
        CLEAR_NEXUS_POST;
 }
 
-#if 0
-static int asd_clear_nexus_I_T(struct domain_device *dev)
+enum clear_nexus_phase {
+       NEXUS_PHASE_PRE,
+       NEXUS_PHASE_POST,
+       NEXUS_PHASE_RESUME,
+};
+
+static int asd_clear_nexus_I_T(struct domain_device *dev,
+                              enum clear_nexus_phase phase)
 {
        struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha;
-       struct asd_ascb *ascb;
-       struct scb *scb;
-       int res;
 
        CLEAR_NEXUS_PRE;
        scb->clear_nexus.nexus = NEXUS_I_T;
-       scb->clear_nexus.flags = SEND_Q | EXEC_Q | NOTINQ;
+       switch (phase) {
+       case NEXUS_PHASE_PRE:
+               scb->clear_nexus.flags = EXEC_Q | SUSPEND_TX;
+               break;
+       case NEXUS_PHASE_POST:
+               scb->clear_nexus.flags = SEND_Q | NOTINQ;
+               break;
+       case NEXUS_PHASE_RESUME:
+               scb->clear_nexus.flags = RESUME_TX;
+       }
        scb->clear_nexus.conn_handle = cpu_to_le16((u16)(unsigned long)
                                                   dev->lldd_dev);
        CLEAR_NEXUS_POST;
 }
-#endif
+
+int asd_I_T_nexus_reset(struct domain_device *dev)
+{
+       int res, tmp_res, i;
+       struct sas_phy *phy = sas_find_local_phy(dev);
+       /* Standard mandates link reset for ATA  (type 0) and
+        * hard reset for SSP (type 1) */
+       int reset_type = (dev->dev_type == SATA_DEV ||
+                         (dev->tproto & SAS_PROTOCOL_STP)) ? 0 : 1;
+
+       asd_clear_nexus_I_T(dev, NEXUS_PHASE_PRE);
+       /* send a hard reset */
+       ASD_DPRINTK("sending %s reset to %s\n",
+                   reset_type ? "hard" : "soft", phy->dev.bus_id);
+       res = sas_phy_reset(phy, reset_type);
+       if (res == TMF_RESP_FUNC_COMPLETE) {
+               /* wait for the maximum settle time */
+               msleep(500);
+               /* clear all outstanding commands (keep nexus suspended) */
+               asd_clear_nexus_I_T(dev, NEXUS_PHASE_POST);
+       }
+       for (i = 0 ; i < 3; i++) {
+               tmp_res = asd_clear_nexus_I_T(dev, NEXUS_PHASE_RESUME);
+               if (tmp_res == TC_RESUME)
+                       return res;
+               msleep(500);
+       }
+
+       /* This is a bit of a problem:  the sequencer is still suspended
+        * and is refusing to resume.  Hope it will resume on a bigger hammer
+        * or the disk is lost */
+       dev_printk(KERN_ERR, &phy->dev,
+                  "Failed to resume nexus after reset 0x%x\n", tmp_res);
+
+       return TMF_RESP_FUNC_FAILED;
+}
 
 static int asd_clear_nexus_I_T_L(struct domain_device *dev, u8 *lun)
 {
        struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha;
-       struct asd_ascb *ascb;
-       struct scb *scb;
-       int res;
 
        CLEAR_NEXUS_PRE;
        scb->clear_nexus.nexus = NEXUS_I_T_L;
@@ -177,9 +230,6 @@ static int asd_clear_nexus_tag(struct sas_task *task)
 {
        struct asd_ha_struct *asd_ha = task->dev->port->ha->lldd_ha;
        struct asd_ascb *tascb = task->lldd_task;
-       struct asd_ascb *ascb;
-       struct scb *scb;
-       int res;
 
        CLEAR_NEXUS_PRE;
        scb->clear_nexus.nexus = NEXUS_TAG;
@@ -195,9 +245,6 @@ static int asd_clear_nexus_index(struct sas_task *task)
 {
        struct asd_ha_struct *asd_ha = task->dev->port->ha->lldd_ha;
        struct asd_ascb *tascb = task->lldd_task;
-       struct asd_ascb *ascb;
-       struct scb *scb;
-       int res;
 
        CLEAR_NEXUS_PRE;
        scb->clear_nexus.nexus = NEXUS_TRANS_CX;
@@ -213,11 +260,11 @@ static int asd_clear_nexus_index(struct sas_task *task)
 static void asd_tmf_timedout(unsigned long data)
 {
        struct asd_ascb *ascb = (void *) data;
+       struct tasklet_completion_status *tcs = ascb->uldd_task;
 
        ASD_DPRINTK("tmf timed out\n");
-       asd_timedout_common(data);
-       ascb->uldd_task = (void *) TMF_RESP_FUNC_FAILED;
-       complete(&ascb->completion);
+       tcs->tmf_state = TMF_RESP_FUNC_FAILED;
+       complete(ascb->completion);
 }
 
 static int asd_get_tmf_resp_tasklet(struct asd_ascb *ascb,
@@ -269,18 +316,24 @@ static int asd_get_tmf_resp_tasklet(struct asd_ascb *ascb,
 static void asd_tmf_tasklet_complete(struct asd_ascb *ascb,
                                     struct done_list_struct *dl)
 {
+       struct tasklet_completion_status *tcs;
+
        if (!del_timer(&ascb->timer))
                return;
 
+       tcs = ascb->uldd_task;
        ASD_DPRINTK("tmf tasklet complete\n");
 
-       if (dl->opcode == TC_SSP_RESP)
-               ascb->uldd_task = (void *) (unsigned long)
-                       asd_get_tmf_resp_tasklet(ascb, dl);
-       else
-               ascb->uldd_task = (void *) 0xFF00 + (unsigned long) dl->opcode;
+       tcs->dl_opcode = dl->opcode;
+
+       if (dl->opcode == TC_SSP_RESP) {
+               tcs->tmf_state = asd_get_tmf_resp_tasklet(ascb, dl);
+               tcs->tag_valid = ascb->tag_valid;
+               tcs->tag = ascb->tag;
+       }
 
-       complete(&ascb->completion);
+       complete(ascb->completion);
+       asd_ascb_free(ascb);
 }
 
 static inline int asd_clear_nexus(struct sas_task *task)
@@ -288,15 +341,19 @@ static inline int asd_clear_nexus(struct sas_task *task)
        int res = TMF_RESP_FUNC_FAILED;
        int leftover;
        struct asd_ascb *tascb = task->lldd_task;
+       DECLARE_COMPLETION_ONSTACK(completion);
        unsigned long flags;
 
+       tascb->completion = &completion;
+
        ASD_DPRINTK("task not done, clearing nexus\n");
        if (tascb->tag_valid)
                res = asd_clear_nexus_tag(task);
        else
                res = asd_clear_nexus_index(task);
-       leftover = wait_for_completion_timeout(&tascb->completion,
+       leftover = wait_for_completion_timeout(&completion,
                                               AIC94XX_SCB_TIMEOUT);
+       tascb->completion = NULL;
        ASD_DPRINTK("came back from clear nexus\n");
        spin_lock_irqsave(&task->task_state_lock, flags);
        if (leftover < 1)
@@ -350,6 +407,11 @@ int asd_abort_task(struct sas_task *task)
        struct asd_ascb *ascb = NULL;
        struct scb *scb;
        int leftover;
+       DECLARE_TCS(tcs);
+       DECLARE_COMPLETION_ONSTACK(completion);
+       DECLARE_COMPLETION_ONSTACK(tascb_completion);
+
+       tascb->completion = &tascb_completion;
 
        spin_lock_irqsave(&task->task_state_lock, flags);
        if (task->task_state_flags & SAS_TASK_STATE_DONE) {
@@ -363,8 +425,10 @@ int asd_abort_task(struct sas_task *task)
        ascb = asd_ascb_alloc_list(asd_ha, &res, GFP_KERNEL);
        if (!ascb)
                return -ENOMEM;
-       scb = ascb->scb;
 
+       ascb->uldd_task = &tcs;
+       ascb->completion = &completion;
+       scb = ascb->scb;
        scb->header.opcode = SCB_ABORT_TASK;
 
        switch (task->task_proto) {
@@ -406,13 +470,12 @@ int asd_abort_task(struct sas_task *task)
        res = asd_enqueue_internal(ascb, asd_tmf_tasklet_complete,
                                   asd_tmf_timedout);
        if (res)
-               goto out;
-       wait_for_completion(&ascb->completion);
+               goto out_free;
+       wait_for_completion(&completion);
        ASD_DPRINTK("tmf came back\n");
 
-       res = (int) (unsigned long) ascb->uldd_task;
-       tascb->tag = ascb->tag;
-       tascb->tag_valid = ascb->tag_valid;
+       tascb->tag = tcs.tag;
+       tascb->tag_valid = tcs.tag_valid;
 
        spin_lock_irqsave(&task->task_state_lock, flags);
        if (task->task_state_flags & SAS_TASK_STATE_DONE) {
@@ -423,63 +486,68 @@ int asd_abort_task(struct sas_task *task)
        }
        spin_unlock_irqrestore(&task->task_state_lock, flags);
 
-       switch (res) {
-       /* The task to be aborted has been sent to the device.
-        * We got a Response IU for the ABORT TASK TMF. */
-       case TC_NO_ERROR + 0xFF00:
-       case TMF_RESP_FUNC_COMPLETE:
-       case TMF_RESP_FUNC_FAILED:
-               res = asd_clear_nexus(task);
-               break;
-       case TMF_RESP_INVALID_FRAME:
-       case TMF_RESP_OVERLAPPED_TAG:
-       case TMF_RESP_FUNC_ESUPP:
-       case TMF_RESP_NO_LUN:
-               goto out_done; break;
-       }
-       /* In the following we assume that the managing layer
-        * will _never_ make a mistake, when issuing ABORT TASK.
-        */
-       switch (res) {
-       default:
-               res = asd_clear_nexus(task);
-               /* fallthrough */
-       case TC_NO_ERROR + 0xFF00:
-       case TMF_RESP_FUNC_COMPLETE:
-               break;
-       /* The task hasn't been sent to the device xor we never got
-        * a (sane) Response IU for the ABORT TASK TMF.
-        */
-       case TF_NAK_RECV + 0xFF00:
-               res = TMF_RESP_INVALID_FRAME;
-               break;
-       case TF_TMF_TASK_DONE + 0xFF00: /* done but not reported yet */
+       if (tcs.dl_opcode == TC_SSP_RESP) {
+               /* The task to be aborted has been sent to the device.
+                * We got a Response IU for the ABORT TASK TMF. */
+               if (tcs.tmf_state == TMF_RESP_FUNC_COMPLETE)
+                       res = asd_clear_nexus(task);
+               else
+                       res = tcs.tmf_state;
+       } else if (tcs.dl_opcode == TC_NO_ERROR &&
+                  tcs.tmf_state == TMF_RESP_FUNC_FAILED) {
+               /* timeout */
                res = TMF_RESP_FUNC_FAILED;
-               leftover = wait_for_completion_timeout(&tascb->completion,
-                                                      AIC94XX_SCB_TIMEOUT);
-               spin_lock_irqsave(&task->task_state_lock, flags);
-               if (leftover < 1)
+       } else {
+               /* In the following we assume that the managing layer
+                * will _never_ make a mistake, when issuing ABORT
+                * TASK.
+                */
+               switch (tcs.dl_opcode) {
+               default:
+                       res = asd_clear_nexus(task);
+                       /* fallthrough */
+               case TC_NO_ERROR:
+                       break;
+                       /* The task hasn't been sent to the device xor
+                        * we never got a (sane) Response IU for the
+                        * ABORT TASK TMF.
+                        */
+               case TF_NAK_RECV:
+                       res = TMF_RESP_INVALID_FRAME;
+                       break;
+               case TF_TMF_TASK_DONE:  /* done but not reported yet */
                        res = TMF_RESP_FUNC_FAILED;
-               if (task->task_state_flags & SAS_TASK_STATE_DONE)
+                       leftover =
+                               wait_for_completion_timeout(&tascb_completion,
+                                                         AIC94XX_SCB_TIMEOUT);
+                       spin_lock_irqsave(&task->task_state_lock, flags);
+                       if (leftover < 1)
+                               res = TMF_RESP_FUNC_FAILED;
+                       if (task->task_state_flags & SAS_TASK_STATE_DONE)
+                               res = TMF_RESP_FUNC_COMPLETE;
+                       spin_unlock_irqrestore(&task->task_state_lock, flags);
+                       break;
+               case TF_TMF_NO_TAG:
+               case TF_TMF_TAG_FREE: /* the tag is in the free list */
+               case TF_TMF_NO_CONN_HANDLE: /* no such device */
                        res = TMF_RESP_FUNC_COMPLETE;
-               spin_unlock_irqrestore(&task->task_state_lock, flags);
-               goto out_done;
-       case TF_TMF_NO_TAG + 0xFF00:
-       case TF_TMF_TAG_FREE + 0xFF00: /* the tag is in the free list */
-       case TF_TMF_NO_CONN_HANDLE + 0xFF00: /* no such device */
-               res = TMF_RESP_FUNC_COMPLETE;
-               goto out_done;
-       case TF_TMF_NO_CTX + 0xFF00: /* not in seq, or proto != SSP */
-               res = TMF_RESP_FUNC_ESUPP;
-               goto out;
+                       break;
+               case TF_TMF_NO_CTX: /* not in seq, or proto != SSP */
+                       res = TMF_RESP_FUNC_ESUPP;
+                       break;
+               }
        }
-out_done:
+ out_done:
+       tascb->completion = NULL;
        if (res == TMF_RESP_FUNC_COMPLETE) {
                task->lldd_task = NULL;
                mb();
                asd_ascb_free(tascb);
        }
-out:
+       ASD_DPRINTK("task 0x%p aborted, res: 0x%x\n", task, res);
+       return res;
+
+ out_free:
        asd_ascb_free(ascb);
        ASD_DPRINTK("task 0x%p aborted, res: 0x%x\n", task, res);
        return res;
@@ -507,6 +575,8 @@ static int asd_initiate_ssp_tmf(struct domain_device *dev, u8 *lun,
        struct asd_ascb *ascb;
        int res = 1;
        struct scb *scb;
+       DECLARE_COMPLETION_ONSTACK(completion);
+       DECLARE_TCS(tcs);
 
        if (!(dev->tproto & SAS_PROTOCOL_SSP))
                return TMF_RESP_FUNC_ESUPP;
@@ -514,6 +584,9 @@ static int asd_initiate_ssp_tmf(struct domain_device *dev, u8 *lun,
        ascb = asd_ascb_alloc_list(asd_ha, &res, GFP_KERNEL);
        if (!ascb)
                return -ENOMEM;
+
+       ascb->completion = &completion;
+       ascb->uldd_task = &tcs;
        scb = ascb->scb;
 
        if (tmf == TMF_QUERY_TASK)
@@ -546,31 +619,32 @@ static int asd_initiate_ssp_tmf(struct domain_device *dev, u8 *lun,
                                   asd_tmf_timedout);
        if (res)
                goto out_err;
-       wait_for_completion(&ascb->completion);
-       res = (int) (unsigned long) ascb->uldd_task;
+       wait_for_completion(&completion);
 
-       switch (res) {
-       case TC_NO_ERROR + 0xFF00:
+       switch (tcs.dl_opcode) {
+       case TC_NO_ERROR:
                res = TMF_RESP_FUNC_COMPLETE;
                break;
-       case TF_NAK_RECV + 0xFF00:
+       case TF_NAK_RECV:
                res = TMF_RESP_INVALID_FRAME;
                break;
-       case TF_TMF_TASK_DONE + 0xFF00:
+       case TF_TMF_TASK_DONE:
                res = TMF_RESP_FUNC_FAILED;
                break;
-       case TF_TMF_NO_TAG + 0xFF00:
-       case TF_TMF_TAG_FREE + 0xFF00: /* the tag is in the free list */
-       case TF_TMF_NO_CONN_HANDLE + 0xFF00: /* no such device */
+       case TF_TMF_NO_TAG:
+       case TF_TMF_TAG_FREE: /* the tag is in the free list */
+       case TF_TMF_NO_CONN_HANDLE: /* no such device */
                res = TMF_RESP_FUNC_COMPLETE;
                break;
-       case TF_TMF_NO_CTX + 0xFF00: /* not in seq, or proto != SSP */
+       case TF_TMF_NO_CTX: /* not in seq, or proto != SSP */
                res = TMF_RESP_FUNC_ESUPP;
                break;
        default:
                /* Allow TMF response codes to propagate upwards */
+               res = tcs.dl_opcode;
                break;
        }
+       return res;
 out_err:
        asd_ascb_free(ascb);
        return res;
index 57786502e3ec18df7f47815b549a2e0152791110..0393707bdfce2a56ade99f0e5e2938a15ae84d78 100644 (file)
@@ -48,7 +48,7 @@ struct class_device_attribute;
 /*The limit of outstanding scsi command that firmware can handle*/
 #define ARCMSR_MAX_OUTSTANDING_CMD                                             256
 #define ARCMSR_MAX_FREECCB_NUM                                                 320
-#define ARCMSR_DRIVER_VERSION               "Driver Version 1.20.00.15 2007/12/24"
+#define ARCMSR_DRIVER_VERSION               "Driver Version 1.20.00.15 2008/02/27"
 #define ARCMSR_SCSI_INITIATOR_ID                                               255
 #define ARCMSR_MAX_XFER_SECTORS                                                        512
 #define ARCMSR_MAX_XFER_SECTORS_B                                              4096
index 6d67f5c0eb8e4133621898d7f5f07f18920592a5..27ebd336409b6fbd922c17360438a7c0ec79babe 100644 (file)
@@ -160,7 +160,7 @@ static void gdth_readapp_event(gdth_ha_str *ha, unchar application,
 static void gdth_clear_events(void);
 
 static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
-                                    char *buffer, ushort count, int to_buffer);
+                                    char *buffer, ushort count);
 static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp);
 static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, ushort hdrive);
 
@@ -182,7 +182,6 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
                       unsigned int cmd, unsigned long arg);
 
 static void gdth_flush(gdth_ha_str *ha);
-static int gdth_halt(struct notifier_block *nb, ulong event, void *buf);
 static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *));
 static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp,
                                struct gdth_cmndinfo *cmndinfo);
@@ -417,12 +416,6 @@ static inline void gdth_set_sglist(struct scsi_cmnd *cmd,
 #include "gdth_proc.h"
 #include "gdth_proc.c"
 
-/* notifier block to get a notify on system shutdown/halt/reboot */
-static struct notifier_block gdth_notifier = {
-    gdth_halt, NULL, 0
-};
-static int notifier_disabled = 0;
-
 static gdth_ha_str *gdth_find_ha(int hanum)
 {
        gdth_ha_str *ha;
@@ -445,8 +438,8 @@ static struct gdth_cmndinfo *gdth_get_cmndinfo(gdth_ha_str *ha)
        for (i=0; i<GDTH_MAXCMDS; ++i) {
                if (ha->cmndinfo[i].index == 0) {
                        priv = &ha->cmndinfo[i];
-                       priv->index = i+1;
                        memset(priv, 0, sizeof(*priv));
+                       priv->index = i+1;
                        break;
                }
        }
@@ -493,7 +486,6 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
     gdth_ha_str *ha = shost_priv(sdev->host);
     Scsi_Cmnd *scp;
     struct gdth_cmndinfo cmndinfo;
-    struct scatterlist one_sg;
     DECLARE_COMPLETION_ONSTACK(wait);
     int rval;
 
@@ -507,13 +499,10 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
     /* use request field to save the ptr. to completion struct. */
     scp->request = (struct request *)&wait;
     scp->timeout_per_command = timeout*HZ;
-    sg_init_one(&one_sg, gdtcmd, sizeof(*gdtcmd));
-    gdth_set_sglist(scp, &one_sg);
-    gdth_set_sg_count(scp, 1);
-    gdth_set_bufflen(scp, sizeof(*gdtcmd));
     scp->cmd_len = 12;
     memcpy(scp->cmnd, cmnd, 12);
     cmndinfo.priority = IOCTL_PRI;
+    cmndinfo.internal_cmd_str = gdtcmd;
     cmndinfo.internal_command = 1;
 
     TRACE(("__gdth_execute() cmd 0x%x\n", scp->cmnd[0]));
@@ -2355,7 +2344,7 @@ static void gdth_next(gdth_ha_str *ha)
  * buffers, kmap_atomic() as needed.
  */
 static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
-                                    char *buffer, ushort count, int to_buffer)
+                                    char *buffer, ushort count)
 {
     ushort cpcount,i, max_sg = gdth_sg_count(scp);
     ushort cpsum,cpnow;
@@ -2381,10 +2370,7 @@ static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
             }
             local_irq_save(flags);
             address = kmap_atomic(sg_page(sl), KM_BIO_SRC_IRQ) + sl->offset;
-            if (to_buffer)
-                memcpy(buffer, address, cpnow);
-            else
-                memcpy(address, buffer, cpnow);
+            memcpy(address, buffer, cpnow);
             flush_dcache_page(sg_page(sl));
             kunmap_atomic(address, KM_BIO_SRC_IRQ);
             local_irq_restore(flags);
@@ -2438,7 +2424,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
         strcpy(inq.vendor,ha->oem_name);
         sprintf(inq.product,"Host Drive  #%02d",t);
         strcpy(inq.revision,"   ");
-        gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data), 0);
+        gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data));
         break;
 
       case REQUEST_SENSE:
@@ -2448,7 +2434,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
         sd.key       = NO_SENSE;
         sd.info      = 0;
         sd.add_length= 0;
-        gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data), 0);
+        gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data));
         break;
 
       case MODE_SENSE:
@@ -2460,7 +2446,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
         mpd.bd.block_length[0] = (SECTOR_SIZE & 0x00ff0000) >> 16;
         mpd.bd.block_length[1] = (SECTOR_SIZE & 0x0000ff00) >> 8;
         mpd.bd.block_length[2] = (SECTOR_SIZE & 0x000000ff);
-        gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data), 0);
+        gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data));
         break;
 
       case READ_CAPACITY:
@@ -2470,7 +2456,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
         else
             rdc.last_block_no = cpu_to_be32(ha->hdr[t].size-1);
         rdc.block_length  = cpu_to_be32(SECTOR_SIZE);
-        gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data), 0);
+        gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data));
         break;
 
       case SERVICE_ACTION_IN:
@@ -2482,7 +2468,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
             rdc16.last_block_no = cpu_to_be64(ha->hdr[t].size-1);
             rdc16.block_length  = cpu_to_be32(SECTOR_SIZE);
             gdth_copy_internal_data(ha, scp, (char*)&rdc16,
-                                                 sizeof(gdth_rdcap16_data), 0);
+                                                 sizeof(gdth_rdcap16_data));
         } else { 
             scp->result = DID_ABORT << 16;
         }
@@ -2852,6 +2838,7 @@ static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar b)
 static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
 {
     register gdth_cmd_str *cmdp;
+    struct gdth_cmndinfo *cmndinfo = gdth_cmnd_priv(scp);
     int cmd_index;
 
     cmdp= ha->pccb;
@@ -2860,7 +2847,7 @@ static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
     if (ha->type==GDT_EISA && ha->cmd_cnt>0) 
         return 0;
 
-    gdth_copy_internal_data(ha, scp, (char *)cmdp, sizeof(gdth_cmd_str), 1);
+    *cmdp = *cmndinfo->internal_cmd_str;
     cmdp->RequestBuffer = scp;
 
     /* search free command index */
@@ -3794,6 +3781,8 @@ static void gdth_timeout(ulong data)
     gdth_ha_str *ha;
     ulong flags;
 
+    BUG_ON(list_empty(&gdth_instances));
+
     ha = list_first_entry(&gdth_instances, gdth_ha_str, list);
     spin_lock_irqsave(&ha->smp_lock, flags);
 
@@ -4669,45 +4658,6 @@ static void gdth_flush(gdth_ha_str *ha)
     }
 }
 
-/* shutdown routine */
-static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
-{
-    gdth_ha_str *ha;
-#ifndef __alpha__
-    gdth_cmd_str    gdtcmd;
-    char            cmnd[MAX_COMMAND_SIZE];   
-#endif
-
-    if (notifier_disabled)
-        return NOTIFY_OK;
-
-    TRACE2(("gdth_halt() event %d\n",(int)event));
-    if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
-        return NOTIFY_DONE;
-
-    notifier_disabled = 1;
-    printk("GDT-HA: Flushing all host drives .. ");
-    list_for_each_entry(ha, &gdth_instances, list) {
-        gdth_flush(ha);
-
-#ifndef __alpha__
-        /* controller reset */
-        memset(cmnd, 0xff, MAX_COMMAND_SIZE);
-        gdtcmd.BoardNode = LOCALBOARD;
-        gdtcmd.Service = CACHESERVICE;
-        gdtcmd.OpCode = GDT_RESET;
-        TRACE2(("gdth_halt(): reset controller %d\n", ha->hanum));
-        gdth_execute(ha->shost, &gdtcmd, cmnd, 10, NULL);
-#endif
-    }
-    printk("Done.\n");
-
-#ifdef GDTH_STATISTICS
-    del_timer(&gdth_timer);
-#endif
-    return NOTIFY_OK;
-}
-
 /* configure lun */
 static int gdth_slave_configure(struct scsi_device *sdev)
 {
@@ -5142,13 +5092,13 @@ static void gdth_remove_one(gdth_ha_str *ha)
 
        scsi_remove_host(shp);
 
+       gdth_flush(ha);
+
        if (ha->sdev) {
                scsi_free_host_dev(ha->sdev);
                ha->sdev = NULL;
        }
 
-       gdth_flush(ha);
-
        if (shp->irq)
                free_irq(shp->irq,ha);
 
@@ -5174,6 +5124,24 @@ static void gdth_remove_one(gdth_ha_str *ha)
        scsi_host_put(shp);
 }
 
+static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
+{
+       gdth_ha_str *ha;
+
+       TRACE2(("gdth_halt() event %d\n", (int)event));
+       if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
+               return NOTIFY_DONE;
+
+       list_for_each_entry(ha, &gdth_instances, list)
+               gdth_flush(ha);
+
+       return NOTIFY_OK;
+}
+
+static struct notifier_block gdth_notifier = {
+    gdth_halt, NULL, 0
+};
+
 static int __init gdth_init(void)
 {
        if (disable) {
@@ -5236,7 +5204,6 @@ static int __init gdth_init(void)
        add_timer(&gdth_timer);
 #endif
        major = register_chrdev(0,"gdth", &gdth_fops);
-       notifier_disabled = 0;
        register_reboot_notifier(&gdth_notifier);
        gdth_polling = FALSE;
        return 0;
@@ -5246,14 +5213,15 @@ static void __exit gdth_exit(void)
 {
        gdth_ha_str *ha;
 
-       list_for_each_entry(ha, &gdth_instances, list)
-               gdth_remove_one(ha);
+       unregister_chrdev(major, "gdth");
+       unregister_reboot_notifier(&gdth_notifier);
 
 #ifdef GDTH_STATISTICS
-       del_timer(&gdth_timer);
+       del_timer_sync(&gdth_timer);
 #endif
-       unregister_chrdev(major,"gdth");
-       unregister_reboot_notifier(&gdth_notifier);
+
+       list_for_each_entry(ha, &gdth_instances, list)
+               gdth_remove_one(ha);
 }
 
 module_init(gdth_init);
index 1434c6b0297c6977f17c73166ddcd6b9c48bb7ed..26e4e92515e0cfcc0793f9b01b15e1e669acbfe2 100644 (file)
@@ -915,6 +915,7 @@ typedef struct {
     struct gdth_cmndinfo {                      /* per-command private info */
         int index;
         int internal_command;                   /* don't call scsi_done */
+        gdth_cmd_str *internal_cmd_str;         /* crier for internal messages*/
         dma_addr_t sense_paddr;                 /* sense dma-addr */
         unchar priority;
         int timeout;
index bd62131b97a1d431eef230ab0efd9ed487a7234f..e5881e92d0fb29f730d93f79b8c554e629a72dfa 100644 (file)
@@ -290,7 +290,7 @@ static int ibmvstgt_cmd_done(struct scsi_cmnd *sc,
        int err = 0;
 
        dprintk("%p %p %x %u\n", iue, target, vio_iu(iue)->srp.cmd.cdb[0],
-               cmd->usg_sg);
+               scsi_sg_count(sc));
 
        if (scsi_sg_count(sc))
                err = srp_transfer_data(sc, &vio_iu(iue)->srp.cmd, ibmvstgt_rdma, 1, 1);
@@ -838,9 +838,6 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)
        if (!shost)
                goto free_vport;
        shost->transportt = ibmvstgt_transport_template;
-       err = scsi_tgt_alloc_queue(shost);
-       if (err)
-               goto put_host;
 
        target = host_to_srp_target(shost);
        target->shost = shost;
@@ -872,6 +869,10 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)
        if (err)
                goto destroy_queue;
 
+       err = scsi_tgt_alloc_queue(shost);
+       if (err)
+               goto destroy_queue;
+
        return 0;
 destroy_queue:
        crq_queue_destroy(target);
index 59f8445eab0daa7a5b138c278897da53aa4ca351..bdd7de7da39a5819cea137dcb5b083f6f69a8d3c 100644 (file)
@@ -1708,8 +1708,8 @@ iscsi_session_setup(struct iscsi_transport *iscsit,
                qdepth = ISCSI_DEF_CMD_PER_LUN;
        }
 
-       if (!is_power_of_2(cmds_max) ||
-           cmds_max >= ISCSI_MGMT_ITT_OFFSET) {
+       if (!is_power_of_2(cmds_max) || cmds_max >= ISCSI_MGMT_ITT_OFFSET ||
+           cmds_max < 2) {
                if (cmds_max != 0)
                        printk(KERN_ERR "iscsi: invalid can_queue of %d. "
                               "can_queue must be a power of 2 and between "
index 7cd05b599a12ca68348ccd721963e4afb7becede..b0e5ac372a3223453b3e4fbfecc737d21fad2977 100644 (file)
@@ -236,12 +236,12 @@ static void sas_ata_phy_reset(struct ata_port *ap)
        struct domain_device *dev = ap->private_data;
        struct sas_internal *i =
                to_sas_internal(dev->port->ha->core.shost->transportt);
-       int res = 0;
+       int res = TMF_RESP_FUNC_FAILED;
 
        if (i->dft->lldd_I_T_nexus_reset)
                res = i->dft->lldd_I_T_nexus_reset(dev);
 
-       if (res)
+       if (res != TMF_RESP_FUNC_COMPLETE)
                SAS_DPRINTK("%s: Unable to reset I T nexus?\n", __FUNCTION__);
 
        switch (dev->sata_dev.command_set) {
@@ -656,21 +656,6 @@ out:
        return res;
 }
 
-static void sas_sata_propagate_sas_addr(struct domain_device *dev)
-{
-       unsigned long flags;
-       struct asd_sas_port *port = dev->port;
-       struct asd_sas_phy  *phy;
-
-       BUG_ON(dev->parent);
-
-       memcpy(port->attached_sas_addr, dev->sas_addr, SAS_ADDR_SIZE);
-       spin_lock_irqsave(&port->phy_list_lock, flags);
-       list_for_each_entry(phy, &port->phy_list, port_phy_el)
-               memcpy(phy->attached_sas_addr, dev->sas_addr, SAS_ADDR_SIZE);
-       spin_unlock_irqrestore(&port->phy_list_lock, flags);
-}
-
 #define ATA_IDENTIFY_DEV         0xEC
 #define ATA_IDENTIFY_PACKET_DEV  0xA1
 #define ATA_SET_FEATURES         0xEF
@@ -728,26 +713,6 @@ static int sas_discover_sata_dev(struct domain_device *dev)
                        goto out_err;
        }
 cont1:
-       /* Get WWN */
-       if (dev->port->oob_mode != SATA_OOB_MODE) {
-               memcpy(dev->sas_addr, dev->sata_dev.rps_resp.rps.stp_sas_addr,
-                      SAS_ADDR_SIZE);
-       } else if (dev->sata_dev.command_set == ATA_COMMAND_SET &&
-                  (le16_to_cpu(dev->sata_dev.identify_device[108]) & 0xF000)
-                  == 0x5000) {
-               int i;
-
-               for (i = 0; i < 4; i++) {
-                       dev->sas_addr[2*i] =
-            (le16_to_cpu(dev->sata_dev.identify_device[108+i]) & 0xFF00) >> 8;
-                       dev->sas_addr[2*i+1] =
-             le16_to_cpu(dev->sata_dev.identify_device[108+i]) & 0x00FF;
-               }
-       }
-       sas_hash_addr(dev->hashed_sas_addr, dev->sas_addr);
-       if (!dev->parent)
-               sas_sata_propagate_sas_addr(dev);
-
        /* XXX Hint: register this SATA device with SATL.
           When this returns, dev->sata_dev->lu is alive and
           present.
index e1e2d085c920918dc508d4ec8d67dfad98095450..39ae68a3b0ef57a14eefcff9112e9668deb6fe1f 100644 (file)
@@ -92,9 +92,6 @@ static void sas_form_port(struct asd_sas_phy *phy)
        if (!port->phy)
                port->phy = phy->phy;
 
-       SAS_DPRINTK("phy%d added to port%d, phy_mask:0x%x\n", phy->id,
-                   port->id, port->phy_mask);
-
        if (*(u64 *)port->attached_sas_addr == 0) {
                port->class = phy->class;
                memcpy(port->attached_sas_addr, phy->attached_sas_addr,
@@ -115,6 +112,11 @@ static void sas_form_port(struct asd_sas_phy *phy)
        }
        sas_port_add_phy(port->port, phy->phy);
 
+       SAS_DPRINTK("%s added to %s, phy_mask:0x%x (%16llx)\n",
+                   phy->phy->dev.bus_id,port->port->dev.bus_id,
+                   port->phy_mask,
+                   SAS_ADDR(port->attached_sas_addr));
+
        if (port->port_dev)
                port->port_dev->pathways = port->num_phys;
 
@@ -255,12 +257,11 @@ void sas_porte_hard_reset(struct work_struct *work)
 static void sas_init_port(struct asd_sas_port *port,
                          struct sas_ha_struct *sas_ha, int i)
 {
+       memset(port, 0, sizeof(*port));
        port->id = i;
        INIT_LIST_HEAD(&port->dev_list);
        spin_lock_init(&port->phy_list_lock);
        INIT_LIST_HEAD(&port->phy_list);
-       port->num_phys = 0;
-       port->phy_mask = 0;
        port->ha = sas_ha;
 
        spin_lock_init(&port->dev_list_lock);
index 704ea06a6e500a8d3bfd25179dc9efa73791c655..1f8241563c6ccea625640eb69c22554d931f3d87 100644 (file)
@@ -434,7 +434,7 @@ static int sas_recover_I_T(struct domain_device *dev)
 }
 
 /* Find the sas_phy that's attached to this device */
-static struct sas_phy *find_local_sas_phy(struct domain_device *dev)
+struct sas_phy *sas_find_local_phy(struct domain_device *dev)
 {
        struct domain_device *pdev = dev->parent;
        struct ex_phy *exphy = NULL;
@@ -456,6 +456,7 @@ static struct sas_phy *find_local_sas_phy(struct domain_device *dev)
        BUG_ON(!exphy);
        return exphy->phy;
 }
+EXPORT_SYMBOL_GPL(sas_find_local_phy);
 
 /* Attempt to send a LUN reset message to a device */
 int sas_eh_device_reset_handler(struct scsi_cmnd *cmd)
@@ -482,7 +483,7 @@ int sas_eh_device_reset_handler(struct scsi_cmnd *cmd)
 int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd)
 {
        struct domain_device *dev = cmd_to_domain_dev(cmd);
-       struct sas_phy *phy = find_local_sas_phy(dev);
+       struct sas_phy *phy = sas_find_local_phy(dev);
        int res;
 
        res = sas_phy_reset(phy, 1);
@@ -497,10 +498,10 @@ int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd)
 }
 
 /* Try to reset a device */
-static int try_to_reset_cmd_device(struct Scsi_Host *shost,
-                                  struct scsi_cmnd *cmd)
+static int try_to_reset_cmd_device(struct scsi_cmnd *cmd)
 {
        int res;
+       struct Scsi_Host *shost = cmd->device->host;
 
        if (!shost->hostt->eh_device_reset_handler)
                goto try_bus_reset;
@@ -540,6 +541,12 @@ Again:
                need_reset = task->task_state_flags & SAS_TASK_NEED_DEV_RESET;
                spin_unlock_irqrestore(&task->task_state_lock, flags);
 
+               if (need_reset) {
+                       SAS_DPRINTK("%s: task 0x%p requests reset\n",
+                                   __FUNCTION__, task);
+                       goto reset;
+               }
+
                SAS_DPRINTK("trying to find task 0x%p\n", task);
                res = sas_scsi_find_task(task);
 
@@ -550,18 +557,15 @@ Again:
                        SAS_DPRINTK("%s: task 0x%p is done\n", __FUNCTION__,
                                    task);
                        sas_eh_finish_cmd(cmd);
-                       if (need_reset)
-                               try_to_reset_cmd_device(shost, cmd);
                        continue;
                case TASK_IS_ABORTED:
                        SAS_DPRINTK("%s: task 0x%p is aborted\n",
                                    __FUNCTION__, task);
                        sas_eh_finish_cmd(cmd);
-                       if (need_reset)
-                               try_to_reset_cmd_device(shost, cmd);
                        continue;
                case TASK_IS_AT_LU:
                        SAS_DPRINTK("task 0x%p is at LU: lu recover\n", task);
+ reset:
                        tmf_resp = sas_recover_lu(task->dev, cmd);
                        if (tmf_resp == TMF_RESP_FUNC_COMPLETE) {
                                SAS_DPRINTK("dev %016llx LU %x is "
@@ -569,8 +573,6 @@ Again:
                                            SAS_ADDR(task->dev),
                                            cmd->device->lun);
                                sas_eh_finish_cmd(cmd);
-                               if (need_reset)
-                                       try_to_reset_cmd_device(shost, cmd);
                                sas_scsi_clear_queue_lu(work_q, cmd);
                                goto Again;
                        }
@@ -581,15 +583,15 @@ Again:
                                    task);
                        tmf_resp = sas_recover_I_T(task->dev);
                        if (tmf_resp == TMF_RESP_FUNC_COMPLETE) {
+                               struct domain_device *dev = task->dev;
                                SAS_DPRINTK("I_T %016llx recovered\n",
                                            SAS_ADDR(task->dev->sas_addr));
                                sas_eh_finish_cmd(cmd);
-                               if (need_reset)
-                                       try_to_reset_cmd_device(shost, cmd);
-                               sas_scsi_clear_queue_I_T(work_q, task->dev);
+                               sas_scsi_clear_queue_I_T(work_q, dev);
                                goto Again;
                        }
                        /* Hammer time :-) */
+                       try_to_reset_cmd_device(cmd);
                        if (i->dft->lldd_clear_nexus_port) {
                                struct asd_sas_port *port = task->dev->port;
                                SAS_DPRINTK("clearing nexus for port:%d\n",
@@ -599,8 +601,6 @@ Again:
                                        SAS_DPRINTK("clear nexus port:%d "
                                                    "succeeded\n", port->id);
                                        sas_eh_finish_cmd(cmd);
-                                       if (need_reset)
-                                               try_to_reset_cmd_device(shost, cmd);
                                        sas_scsi_clear_queue_port(work_q,
                                                                  port);
                                        goto Again;
@@ -613,8 +613,6 @@ Again:
                                        SAS_DPRINTK("clear nexus ha "
                                                    "succeeded\n");
                                        sas_eh_finish_cmd(cmd);
-                                       if (need_reset)
-                                               try_to_reset_cmd_device(shost, cmd);
                                        goto clear_q;
                                }
                        }
@@ -628,8 +626,6 @@ Again:
                                    cmd->device->lun);
 
                        sas_eh_finish_cmd(cmd);
-                       if (need_reset)
-                               try_to_reset_cmd_device(shost, cmd);
                        goto clear_q;
                }
        }
index d4a6ac3c9c4746155eca706225995344ff265e52..5ec0665b3a3dd875e9e555def0bd4d2977f4a782 100644 (file)
@@ -40,7 +40,7 @@
 #include <asm/io.h>
 
 #define DRV_NAME       "mvsas"
-#define DRV_VERSION    "0.5"
+#define DRV_VERSION    "0.5.1"
 #define _MV_DUMP 0
 #define MVS_DISABLE_NVRAM
 #define MVS_DISABLE_MSI
@@ -1005,7 +1005,7 @@ err_out:
        return rc;
 #else
        /* FIXME , For SAS target mode */
-       memcpy(buf, "\x00\x00\xab\x11\x30\x04\x05\x50", 8);
+       memcpy(buf, "\x50\x05\x04\x30\x11\xab\x00\x00", 8);
        return 0;
 #endif
 }
@@ -1330,7 +1330,7 @@ static int mvs_int_rx(struct mvs_info *mvi, bool self_clear)
 
                mvs_hba_cq_dump(mvi);
 
-               if (unlikely(rx_desc & RXQ_DONE))
+               if (likely(rx_desc & RXQ_DONE))
                        mvs_slot_complete(mvi, rx_desc);
                if (rx_desc & RXQ_ATTN) {
                        attn = true;
@@ -2720,9 +2720,8 @@ static int __devinit mvs_hw_init(struct mvs_info *mvi)
        msleep(100);
        /* init and reset phys */
        for (i = 0; i < mvi->chip->n_phy; i++) {
-               /* FIXME: is this the correct dword order? */
-               u32 lo = *((u32 *)&mvi->sas_addr[0]);
-               u32 hi = *((u32 *)&mvi->sas_addr[4]);
+               u32 lo = be32_to_cpu(*(u32 *)&mvi->sas_addr[4]);
+               u32 hi = be32_to_cpu(*(u32 *)&mvi->sas_addr[0]);
 
                mvs_detect_porttype(mvi, i);
 
index 0cd614a0fa73d98eb354aee000c1c4f1909de050..fad6cb5cba283acc8410e9d8bed1e996062d03b8 100644 (file)
@@ -124,7 +124,7 @@ static int fill_from_dev_buffer(struct scsi_cmnd *cmd, const void *buf)
                }
                req_len += sgpnt->length;
        }
-       scsi_set_resid(cmd, req_len - act_len);
+       scsi_set_resid(cmd, buflen - act_len);
        return 0;
 }
 
@@ -427,7 +427,7 @@ static struct scsi_host_template ps3rom_host_template = {
        .cmd_per_lun =          1,
        .emulated =             1,              /* only sg driver uses this */
        .max_sectors =          PS3ROM_MAX_SECTORS,
-       .use_clustering =       ENABLE_CLUSTERING,
+       .use_clustering =       DISABLE_CLUSTERING,
        .module =               THIS_MODULE,
 };
 
index 6226d88479f59fa2a1ded8423180281a98393ab0..c1808763d40ef21608e6dab7fab271712098f975 100644 (file)
@@ -39,7 +39,7 @@ qla2x00_prep_ms_iocb(scsi_qla_host_t *ha, uint32_t req_size, uint32_t rsp_size)
        ms_pkt->entry_count = 1;
        SET_TARGET_ID(ha, ms_pkt->loop_id, SIMPLE_NAME_SERVER);
        ms_pkt->control_flags = __constant_cpu_to_le16(CF_READ | CF_HEAD_TAG);
-       ms_pkt->timeout = __constant_cpu_to_le16(25);
+       ms_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
        ms_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
        ms_pkt->total_dsd_count = __constant_cpu_to_le16(2);
        ms_pkt->rsp_bytecount = cpu_to_le32(rsp_size);
@@ -75,7 +75,7 @@ qla24xx_prep_ms_iocb(scsi_qla_host_t *ha, uint32_t req_size, uint32_t rsp_size)
        ct_pkt->entry_type = CT_IOCB_TYPE;
        ct_pkt->entry_count = 1;
        ct_pkt->nport_handle = __constant_cpu_to_le16(NPH_SNS);
-       ct_pkt->timeout = __constant_cpu_to_le16(25);
+       ct_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
        ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
        ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1);
        ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size);
@@ -1144,7 +1144,7 @@ qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *ha, uint32_t req_size,
        ms_pkt->entry_count = 1;
        SET_TARGET_ID(ha, ms_pkt->loop_id, ha->mgmt_svr_loop_id);
        ms_pkt->control_flags = __constant_cpu_to_le16(CF_READ | CF_HEAD_TAG);
-       ms_pkt->timeout = __constant_cpu_to_le16(59);
+       ms_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
        ms_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
        ms_pkt->total_dsd_count = __constant_cpu_to_le16(2);
        ms_pkt->rsp_bytecount = cpu_to_le32(rsp_size);
@@ -1181,7 +1181,7 @@ qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *ha, uint32_t req_size,
        ct_pkt->entry_type = CT_IOCB_TYPE;
        ct_pkt->entry_count = 1;
        ct_pkt->nport_handle = cpu_to_le16(ha->mgmt_svr_loop_id);
-       ct_pkt->timeout = __constant_cpu_to_le16(59);
+       ct_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
        ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
        ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1);
        ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size);
@@ -1761,7 +1761,7 @@ qla24xx_prep_ms_fm_iocb(scsi_qla_host_t *ha, uint32_t req_size,
        ct_pkt->entry_type = CT_IOCB_TYPE;
        ct_pkt->entry_count = 1;
        ct_pkt->nport_handle = cpu_to_le16(ha->mgmt_svr_loop_id);
-       ct_pkt->timeout = __constant_cpu_to_le16(59);
+       ct_pkt->timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
        ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1);
        ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1);
        ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size);
index d5c7853e7ebab34e0b621d98dbb6f36de823ca06..364be7d068759c4972cc7fd414cc26c63c396323 100644 (file)
@@ -1733,8 +1733,8 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
        ha->login_timeout = nv->login_timeout;
        icb->login_timeout = nv->login_timeout;
 
-       /* Set minimum RATOV to 200 tenths of a second. */
-       ha->r_a_tov = 200;
+       /* Set minimum RATOV to 100 tenths of a second. */
+       ha->r_a_tov = 100;
 
        ha->loop_reset_delay = nv->reset_delay;
 
@@ -3645,8 +3645,8 @@ qla24xx_nvram_config(scsi_qla_host_t *ha)
        ha->login_timeout = le16_to_cpu(nv->login_timeout);
        icb->login_timeout = cpu_to_le16(nv->login_timeout);
 
-       /* Set minimum RATOV to 200 tenths of a second. */
-       ha->r_a_tov = 200;
+       /* Set minimum RATOV to 100 tenths of a second. */
+       ha->r_a_tov = 100;
 
        ha->loop_reset_delay = nv->reset_delay;
 
@@ -4022,7 +4022,8 @@ qla2x00_try_to_stop_firmware(scsi_qla_host_t *ha)
                return;
 
        ret = qla2x00_stop_firmware(ha);
-       for (retries = 5; ret != QLA_SUCCESS && retries ; retries--) {
+       for (retries = 5; ret != QLA_SUCCESS && ret != QLA_FUNCTION_TIMEOUT &&
+           retries ; retries--) {
                qla2x00_reset_chip(ha);
                if (qla2x00_chip_diag(ha) != QLA_SUCCESS)
                        continue;
index 14e6f22944b71886be2ba17094a406e2f49b2f7c..f0337036c7bb144242567963591c368999deecbd 100644 (file)
@@ -958,6 +958,11 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
                }
        }
 
+       /* Check for overrun. */
+       if (IS_FWI2_CAPABLE(ha) && comp_status == CS_COMPLETE &&
+           scsi_status & SS_RESIDUAL_OVER)
+               comp_status = CS_DATA_OVERRUN;
+
        /*
         * Based on Host and scsi status generate status code for Linux
         */
index 99d29fff836d631bc37686b6c45bee7972dcb4e4..bb103580e1ba8b874e59bb8987c2b5addad940cb 100644 (file)
@@ -2206,7 +2206,7 @@ qla24xx_abort_target(fc_port_t *fcport)
        tsk->p.tsk.entry_type = TSK_MGMT_IOCB_TYPE;
        tsk->p.tsk.entry_count = 1;
        tsk->p.tsk.nport_handle = cpu_to_le16(fcport->loop_id);
-       tsk->p.tsk.timeout = __constant_cpu_to_le16(25);
+       tsk->p.tsk.timeout = cpu_to_le16(ha->r_a_tov / 10 * 2);
        tsk->p.tsk.control_flags = __constant_cpu_to_le32(TCF_TARGET_RESET);
        tsk->p.tsk.port_id[0] = fcport->d_id.b.al_pa;
        tsk->p.tsk.port_id[1] = fcport->d_id.b.area;
index c5742cc15abbbc56b1134619d09714e400d1a33d..ea08a129fee91827b4c3b285f78c8ae171782cdf 100644 (file)
@@ -7,7 +7,7 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION      "8.02.00-k8"
+#define QLA2XXX_VERSION      "8.02.00-k9"
 
 #define QLA_DRIVER_MAJOR_VER   8
 #define QLA_DRIVER_MINOR_VER   2
index 10b3b9a620f357f0bcf91a39546a9b594451f149..109c5f5985ecfb1772956296a27ea219ee7a01ff 100644 (file)
@@ -1299,9 +1299,9 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha,
        ddb_entry->fw_ddb_device_state = state;
        /* Device is back online. */
        if (ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE) {
+               atomic_set(&ddb_entry->state, DDB_STATE_ONLINE);
                atomic_set(&ddb_entry->port_down_timer,
                           ha->port_down_retry_count);
-               atomic_set(&ddb_entry->state, DDB_STATE_ONLINE);
                atomic_set(&ddb_entry->relogin_retry_count, 0);
                atomic_set(&ddb_entry->relogin_timer, 0);
                clear_bit(DF_RELOGIN, &ddb_entry->flags);
index c3c59d7630371781b25a7bf46fed47d02f37edb6..8b92f348f02c73ad8e139be5ede91843d31afc47 100644 (file)
@@ -75,6 +75,7 @@ static int qla4xxx_eh_host_reset(struct scsi_cmnd *cmd);
 static int qla4xxx_slave_alloc(struct scsi_device *device);
 static int qla4xxx_slave_configure(struct scsi_device *device);
 static void qla4xxx_slave_destroy(struct scsi_device *sdev);
+static void qla4xxx_scan_start(struct Scsi_Host *shost);
 
 static struct scsi_host_template qla4xxx_driver_template = {
        .module                 = THIS_MODULE,
@@ -90,6 +91,7 @@ static struct scsi_host_template qla4xxx_driver_template = {
        .slave_destroy          = qla4xxx_slave_destroy,
 
        .scan_finished          = iscsi_scan_finished,
+       .scan_start             = qla4xxx_scan_start,
 
        .this_id                = -1,
        .cmd_per_lun            = 3,
@@ -299,6 +301,18 @@ struct ddb_entry *qla4xxx_alloc_sess(struct scsi_qla_host *ha)
        return ddb_entry;
 }
 
+static void qla4xxx_scan_start(struct Scsi_Host *shost)
+{
+       struct scsi_qla_host *ha = shost_priv(shost);
+       struct ddb_entry *ddb_entry, *ddbtemp;
+
+       /* finish setup of sessions that were already setup in firmware */
+       list_for_each_entry_safe(ddb_entry, ddbtemp, &ha->ddb_list, list) {
+               if (ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE)
+                       qla4xxx_add_sess(ddb_entry);
+       }
+}
+
 /*
  * Timer routines
  */
@@ -864,8 +878,9 @@ static void qla4xxx_flush_active_srbs(struct scsi_qla_host *ha)
  * qla4xxx_recover_adapter - recovers adapter after a fatal error
  * @ha: Pointer to host adapter structure.
  * @renew_ddb_list: Indicates what to do with the adapter's ddb list
- *     after adapter recovery has completed.
- *     0=preserve ddb list, 1=destroy and rebuild ddb list
+ *
+ * renew_ddb_list value can be 0=preserve ddb list, 1=destroy and rebuild
+ * ddb list.
  **/
 static int qla4xxx_recover_adapter(struct scsi_qla_host *ha,
                                uint8_t renew_ddb_list)
@@ -874,6 +889,7 @@ static int qla4xxx_recover_adapter(struct scsi_qla_host *ha,
 
        /* Stall incoming I/O until we are done */
        clear_bit(AF_ONLINE, &ha->flags);
+
        DEBUG2(printk("scsi%ld: %s calling qla4xxx_cmd_wait\n", ha->host_no,
                      __func__));
 
@@ -1176,7 +1192,6 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev,
        int ret = -ENODEV, status;
        struct Scsi_Host *host;
        struct scsi_qla_host *ha;
-       struct ddb_entry *ddb_entry, *ddbtemp;
        uint8_t init_retry_count = 0;
        char buf[34];
 
@@ -1295,13 +1310,6 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev,
        if (ret)
                goto probe_failed;
 
-       /* Update transport device information for all devices. */
-       list_for_each_entry_safe(ddb_entry, ddbtemp, &ha->ddb_list, list) {
-               if (ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE)
-                       if (qla4xxx_add_sess(ddb_entry))
-                               goto remove_host;
-       }
-
        printk(KERN_INFO
               " QLogic iSCSI HBA Driver version: %s\n"
               "  QLogic ISP%04x @ %s, host#=%ld, fw=%02d.%02d.%02d.%02d\n",
@@ -1311,10 +1319,6 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev,
        scsi_scan_host(host);
        return 0;
 
-remove_host:
-       qla4xxx_free_ddb_list(ha);
-       scsi_remove_host(host);
-
 probe_failed:
        qla4xxx_free_adapter(ha);
        scsi_host_put(ha->host);
@@ -1600,9 +1604,12 @@ static int qla4xxx_eh_host_reset(struct scsi_cmnd *cmd)
                return FAILED;
        }
 
-       if (qla4xxx_recover_adapter(ha, PRESERVE_DDB_LIST) == QLA_SUCCESS) {
+       /* make sure the dpc thread is stopped while we reset the hba */
+       clear_bit(AF_ONLINE, &ha->flags);
+       flush_workqueue(ha->dpc_thread);
+
+       if (qla4xxx_recover_adapter(ha, PRESERVE_DDB_LIST) == QLA_SUCCESS)
                return_status = SUCCESS;
-       }
 
        dev_info(&ha->pdev->dev, "HOST RESET %s.\n",
                   return_status == FAILED ? "FAILED" : "SUCCEDED");
index fecba05b4e7783da1c22402080c7ab0c6338504b..e5c6f6af876558c0b92dea602c6d2f6eed1a23a5 100644 (file)
@@ -757,7 +757,7 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
                                "Notifying upper driver of completion "
                                "(result %x)\n", cmd->result));
 
-       good_bytes = scsi_bufflen(cmd);
+       good_bytes = scsi_bufflen(cmd) + cmd->request->extra_len;
         if (cmd->request->cmd_type != REQ_TYPE_BLOCK_PC) {
                drv = scsi_cmd_to_driver(cmd);
                if (drv->done)
index 1dc165ad17fb20edae98e80b408fbd8cfd0c4543..e67c14e31babba5913f0ab1852f7952e191502bb 100644 (file)
@@ -1577,8 +1577,7 @@ static void __scsi_scan_target(struct device *parent, unsigned int channel,
 }
 
 /**
- * scsi_scan_target - scan a target id, possibly including all LUNs on the
- *     target.
+ * scsi_scan_target - scan a target id, possibly including all LUNs on the target.
  * @parent:    host to scan
  * @channel:   channel to scan
  * @id:                target id to scan
index 3677fbb30b720d50b6777a395125ba03ae1c492b..a0f308bd145b062e2403af9b57a2c32d92108ca0 100644 (file)
@@ -103,7 +103,6 @@ struct scsi_cmnd *scsi_host_get_command(struct Scsi_Host *shost,
        if (!cmd)
                goto release_rq;
 
-       memset(cmd, 0, sizeof(*cmd));
        cmd->sc_data_direction = data_dir;
        cmd->jiffies_at_alloc = jiffies;
        cmd->request = rq;
@@ -382,6 +381,11 @@ static int scsi_map_user_pages(struct scsi_tgt_cmd *tcmd, struct scsi_cmnd *cmd,
                scsi_release_buffers(cmd);
                goto unmap_rq;
        }
+       /*
+        * we use REQ_TYPE_BLOCK_PC so scsi_init_io doesn't set the
+        * length for us.
+        */
+       cmd->sdb.length = rq->data_len;
 
        return 0;
 
index 9981682d5302d5ea0bbbea58f181fb75458345f2..ca7bb6f63bdeb6bcee801e8588b5d339c47a6f57 100644 (file)
@@ -33,7 +33,7 @@
 #define ISCSI_SESSION_ATTRS 19
 #define ISCSI_CONN_ATTRS 13
 #define ISCSI_HOST_ATTRS 4
-#define ISCSI_TRANSPORT_VERSION "2.0-868"
+#define ISCSI_TRANSPORT_VERSION "2.0-869"
 
 struct iscsi_internal {
        int daemon_pid;
@@ -373,24 +373,25 @@ static void session_recovery_timedout(struct work_struct *work)
        scsi_target_unblock(&session->dev);
 }
 
-static void __iscsi_unblock_session(struct iscsi_cls_session *session)
-{
-       if (!cancel_delayed_work(&session->recovery_work))
-               flush_workqueue(iscsi_eh_timer_workq);
-       scsi_target_unblock(&session->dev);
-}
-
-void iscsi_unblock_session(struct iscsi_cls_session *session)
+static void __iscsi_unblock_session(struct work_struct *work)
 {
+       struct iscsi_cls_session *session =
+                       container_of(work, struct iscsi_cls_session,
+                                    unblock_work);
        struct Scsi_Host *shost = iscsi_session_to_shost(session);
        struct iscsi_host *ihost = shost->shost_data;
        unsigned long flags;
 
+       /*
+        * The recovery and unblock work get run from the same workqueue,
+        * so try to cancel it if it was going to run after this unblock.
+        */
+       cancel_delayed_work(&session->recovery_work);
        spin_lock_irqsave(&session->lock, flags);
        session->state = ISCSI_SESSION_LOGGED_IN;
        spin_unlock_irqrestore(&session->lock, flags);
-
-       __iscsi_unblock_session(session);
+       /* start IO */
+       scsi_target_unblock(&session->dev);
        /*
         * Only do kernel scanning if the driver is properly hooked into
         * the async scanning code (drivers like iscsi_tcp do login and
@@ -401,20 +402,43 @@ void iscsi_unblock_session(struct iscsi_cls_session *session)
                        atomic_inc(&ihost->nr_scans);
        }
 }
+
+/**
+ * iscsi_unblock_session - set a session as logged in and start IO.
+ * @session: iscsi session
+ *
+ * Mark a session as ready to accept IO.
+ */
+void iscsi_unblock_session(struct iscsi_cls_session *session)
+{
+       queue_work(iscsi_eh_timer_workq, &session->unblock_work);
+       /*
+        * make sure all the events have completed before tell the driver
+        * it is safe
+        */
+       flush_workqueue(iscsi_eh_timer_workq);
+}
 EXPORT_SYMBOL_GPL(iscsi_unblock_session);
 
-void iscsi_block_session(struct iscsi_cls_session *session)
+static void __iscsi_block_session(struct work_struct *work)
 {
+       struct iscsi_cls_session *session =
+                       container_of(work, struct iscsi_cls_session,
+                                    block_work);
        unsigned long flags;
 
        spin_lock_irqsave(&session->lock, flags);
        session->state = ISCSI_SESSION_FAILED;
        spin_unlock_irqrestore(&session->lock, flags);
-
        scsi_target_block(&session->dev);
        queue_delayed_work(iscsi_eh_timer_workq, &session->recovery_work,
                           session->recovery_tmo * HZ);
 }
+
+void iscsi_block_session(struct iscsi_cls_session *session)
+{
+       queue_work(iscsi_eh_timer_workq, &session->block_work);
+}
 EXPORT_SYMBOL_GPL(iscsi_block_session);
 
 static void __iscsi_unbind_session(struct work_struct *work)
@@ -463,6 +487,8 @@ iscsi_alloc_session(struct Scsi_Host *shost,
        INIT_DELAYED_WORK(&session->recovery_work, session_recovery_timedout);
        INIT_LIST_HEAD(&session->host_list);
        INIT_LIST_HEAD(&session->sess_list);
+       INIT_WORK(&session->unblock_work, __iscsi_unblock_session);
+       INIT_WORK(&session->block_work, __iscsi_block_session);
        INIT_WORK(&session->unbind_work, __iscsi_unbind_session);
        INIT_WORK(&session->scan_work, iscsi_scan_session);
        spin_lock_init(&session->lock);
@@ -575,24 +601,25 @@ void iscsi_remove_session(struct iscsi_cls_session *session)
        list_del(&session->sess_list);
        spin_unlock_irqrestore(&sesslock, flags);
 
+       /* make sure there are no blocks/unblocks queued */
+       flush_workqueue(iscsi_eh_timer_workq);
+       /* make sure the timedout callout is not running */
+       if (!cancel_delayed_work(&session->recovery_work))
+               flush_workqueue(iscsi_eh_timer_workq);
        /*
         * If we are blocked let commands flow again. The lld or iscsi
         * layer should set up the queuecommand to fail commands.
+        * We assume that LLD will not be calling block/unblock while
+        * removing the session.
         */
        spin_lock_irqsave(&session->lock, flags);
        session->state = ISCSI_SESSION_FREE;
        spin_unlock_irqrestore(&session->lock, flags);
-       __iscsi_unblock_session(session);
-       __iscsi_unbind_session(&session->unbind_work);
 
-       /* flush running scans */
+       scsi_target_unblock(&session->dev);
+       /* flush running scans then delete devices */
        flush_workqueue(ihost->scan_workq);
-       /*
-        * If the session dropped while removing devices then we need to make
-        * sure it is not blocked
-        */
-       if (!cancel_delayed_work(&session->recovery_work))
-               flush_workqueue(iscsi_eh_timer_workq);
+       __iscsi_unbind_session(&session->unbind_work);
 
        /* hw iscsi may not have removed all connections from session */
        err = device_for_each_child(&session->dev, NULL,
@@ -802,23 +829,16 @@ EXPORT_SYMBOL_GPL(iscsi_recv_pdu);
 
 void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error)
 {
-       struct iscsi_cls_session *session = iscsi_conn_to_session(conn);
        struct nlmsghdr *nlh;
        struct sk_buff  *skb;
        struct iscsi_uevent *ev;
        struct iscsi_internal *priv;
        int len = NLMSG_SPACE(sizeof(*ev));
-       unsigned long flags;
 
        priv = iscsi_if_transport_lookup(conn->transport);
        if (!priv)
                return;
 
-       spin_lock_irqsave(&session->lock, flags);
-       if (session->state == ISCSI_SESSION_LOGGED_IN)
-               session->state = ISCSI_SESSION_FAILED;
-       spin_unlock_irqrestore(&session->lock, flags);
-
        skb = alloc_skb(len, GFP_ATOMIC);
        if (!skb) {
                iscsi_cls_conn_printk(KERN_ERR, conn, "gracefully ignored "
index 6f09cbd7fc488ac53286c92ba1ce0698f11ba0bd..97c68d021d28bcb3ecd1cae57846cdac3fdaed7e 100644 (file)
@@ -91,6 +91,8 @@ static const struct pnp_device_id pnp_dev_table[] = {
        /* Archtek America Corp. */
        /* Archtek SmartLink Modem 3334BT Plug & Play */
        {       "GVC000F",              0       },
+       /* Archtek SmartLink Modem 3334BRV 33.6K Data Fax Voice */
+       {       "GVC0303",              0       },
        /* Hayes */
        /* Hayes Optima 288 V.34-V.FC + FAX + Voice Plug & Play */
        {       "HAY0001",              0       },
index 348ee2c19b5830a32b92b2d93b5a6167f199a51b..c2bb11c02bdedebd73d6934f4f67702199e81a0d 100644 (file)
@@ -421,7 +421,7 @@ static void transmit_chars(struct uart_sio_port *up)
                up->port.icount.tx++;
                if (uart_circ_empty(xmit))
                        break;
-               while (!serial_in(up, UART_LSR) & UART_LSR_THRE);
+               while (!(serial_in(up, UART_LSR) & UART_LSR_THRE));
 
        } while (--count > 0);
 
index 253ed5682a6d6c354a761791b4103d2ec4f04a20..a86315a0c5b8e93c90c70edac02fd6734cf62bbb 100644 (file)
@@ -42,6 +42,7 @@ struct mpc52xx_psc_spi {
 
        /* driver internal data */
        struct mpc52xx_psc __iomem *psc;
+       struct mpc52xx_psc_fifo __iomem *fifo;
        unsigned int irq;
        u8 bits_per_word;
        u8 busy;
@@ -139,6 +140,7 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
 {
        struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master);
        struct mpc52xx_psc __iomem *psc = mps->psc;
+       struct mpc52xx_psc_fifo __iomem *fifo = mps->fifo;
        unsigned rb = 0;        /* number of bytes receieved */
        unsigned sb = 0;        /* number of bytes sent */
        unsigned char *rx_buf = (unsigned char *)t->rx_buf;
@@ -190,11 +192,11 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
                        out_8(&psc->mode, 0);
                } else {
                        out_8(&psc->mode, MPC52xx_PSC_MODE_FFULL);
-                       out_be16(&psc->rfalarm, rfalarm);
+                       out_be16(&fifo->rfalarm, rfalarm);
                }
                out_be16(&psc->mpc52xx_psc_imr, MPC52xx_PSC_IMR_RXRDY);
                wait_for_completion(&mps->done);
-               recv_at_once = in_be16(&psc->rfnum);
+               recv_at_once = in_be16(&fifo->rfnum);
                dev_dbg(&spi->dev, "%d bytes received\n", recv_at_once);
 
                send_at_once = recv_at_once;
@@ -331,6 +333,7 @@ static void mpc52xx_psc_spi_cleanup(struct spi_device *spi)
 static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps)
 {
        struct mpc52xx_psc __iomem *psc = mps->psc;
+       struct mpc52xx_psc_fifo __iomem *fifo = mps->fifo;
        u32 mclken_div;
        int ret = 0;
 
@@ -346,7 +349,7 @@ static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps)
        /* Disable interrupts, interrupts are based on alarm level */
        out_be16(&psc->mpc52xx_psc_imr, 0);
        out_8(&psc->command, MPC52xx_PSC_SEL_MODE_REG_1);
-       out_8(&psc->rfcntl, 0);
+       out_8(&fifo->rfcntl, 0);
        out_8(&psc->mode, MPC52xx_PSC_MODE_FFULL);
 
        /* Configure 8bit codec mode as a SPI master and use EOF flags */
@@ -419,6 +422,8 @@ static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr,
                ret = -EFAULT;
                goto free_master;
        }
+       /* On the 5200, fifo regs are immediately ajacent to the psc regs */
+       mps->fifo = ((void __iomem *)mps->psc) + sizeof(struct mpc52xx_psc);
 
        ret = request_irq(mps->irq, mpc52xx_psc_spi_isr, 0, "mpc52xx-psc-spi",
                                mps);
index 07ab48d9ceab1f70e3b06abd9ad5670d719adf91..74b9a8aea52b12bbbf721a9c6f623ac2d09655b3 100644 (file)
@@ -111,7 +111,10 @@ static void __init ssb_fixup_pcibridge(struct pci_dev *dev)
 
        /* Enable PCI bridge bus mastering and memory space */
        pci_set_master(dev);
-       pcibios_enable_device(dev, ~0);
+       if (pcibios_enable_device(dev, ~0) < 0) {
+               ssb_printk(KERN_ERR "PCI: SSB bridge enable failed\n");
+               return;
+       }
 
        /* Enable PCI bridge BAR1 prefetch and burst */
        pci_write_config_dword(dev, SSB_BAR1_CONTROL, 3);
index 5c33cdb9cac7131a0e4d2715ecbcec538903406f..a2b0aa48b8eaba4d5be56c5d2bcbe3a4ed9fc2cd 100644 (file)
@@ -87,12 +87,13 @@ config USB_DYNAMIC_MINORS
          If you are unsure about this, say N here.
 
 config USB_SUSPEND
-       bool "USB selective suspend/resume and wakeup (EXPERIMENTAL)"
-       depends on USB && PM && EXPERIMENTAL
+       bool "USB selective suspend/resume and wakeup"
+       depends on USB && PM
        help
          If you say Y here, you can use driver calls or the sysfs
-         "power/state" file to suspend or resume individual USB
-         peripherals.
+         "power/level" file to suspend or resume individual USB
+         peripherals and to enable or disable autosuspend (see
+         Documentation/usb/power-management.txt for more details).
 
          Also, USB "remote wakeup" signaling is supported, whereby some
          USB devices (like keyboards and network adapters) can wake up
index f90ab5e94c5842d5b5c61f55e5fd33fdf4b5ecb1..d9d1eb19f2a134ecde7a5f5bad21cb195da0bdb1 100644 (file)
  * devices is broken...
  */
 static const struct usb_device_id usb_quirk_list[] = {
-       /* Action Semiconductor flash disk */
-       { USB_DEVICE(0x10d6, 0x2200), .driver_info = USB_QUIRK_STRING_FETCH_255},
-
        /* CBM - Flash disk */
        { USB_DEVICE(0x0204, 0x6025), .driver_info = USB_QUIRK_RESET_RESUME },
+
        /* HP 5300/5370C scanner */
-       { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 },
+       { USB_DEVICE(0x03f0, 0x0701), .driver_info =
+                       USB_QUIRK_STRING_FETCH_255 },
 
        /* Creative SB Audigy 2 NX */
        { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME },
 
+       /* Philips PSC805 audio device */
+       { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
+
        /* Roland SC-8820 */
        { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
 
        /* Edirol SD-20 */
        { USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME },
 
-       /* INTEL VALUE SSD */
-       { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
-
        /* M-Systems Flash Disk Pioneers */
        { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
 
-       /* Philips PSC805 audio device */
-       { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
+       /* Action Semiconductor flash disk */
+       { USB_DEVICE(0x10d6, 0x2200), .driver_info =
+                       USB_QUIRK_STRING_FETCH_255 },
 
        /* SKYMEDI USB_DRIVE */
        { USB_DEVICE(0x1516, 0x8628), .driver_info = USB_QUIRK_RESET_RESUME },
 
+       /* INTEL VALUE SSD */
+       { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
+
        { }  /* terminating entry must be last */
 };
 
index 4e984060c984b4cbb715607f26ab13dfb05d357e..1f0db51190ccc79c121364de04a39a93c7e54aae 100644 (file)
@@ -99,8 +99,7 @@ struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev,
 EXPORT_SYMBOL_GPL(usb_ifnum_to_if);
 
 /**
- * usb_altnum_to_altsetting - get the altsetting structure with a given
- *     alternate setting number.
+ * usb_altnum_to_altsetting - get the altsetting structure with a given alternate setting number.
  * @intf: the interface containing the altsetting in question
  * @altnum: the desired alternate setting number
  *
@@ -234,7 +233,7 @@ static int ksuspend_usb_init(void)
         * singlethreaded.  Its job doesn't justify running on more
         * than one CPU.
         */
-       ksuspend_usb_wq = create_singlethread_workqueue("ksuspend_usbd");
+       ksuspend_usb_wq = create_freezeable_workqueue("ksuspend_usbd");
        if (!ksuspend_usb_wq)
                return -ENOMEM;
        return 0;
@@ -442,8 +441,7 @@ EXPORT_SYMBOL_GPL(usb_put_intf);
  */
 
 /**
- * usb_lock_device_for_reset - cautiously acquire the lock for a
- *     usb device structure
+ * usb_lock_device_for_reset - cautiously acquire the lock for a usb device structure
  * @udev: device that's being locked
  * @iface: interface bound to the driver making the request (optional)
  *
index 4f6bfa100f2ad009381190605cdb75c1ee4271ae..2c32bd08ee7db2c6051df00de37f709de9041a10 100644 (file)
@@ -92,7 +92,6 @@ struct printer_dev {
        u8                      *current_rx_buf;
        u8                      printer_status;
        u8                      reset_printer;
-       struct class_device     *printer_class_dev;
        struct cdev             printer_cdev;
        struct device           *pdev;
        u8                      printer_cdev_open;
index 4402d6f042d971bd42d6a1453bb3c0bef85172ee..096c41cc40d1bc8acd262fb75f5cf310d8189e6c 100644 (file)
@@ -103,6 +103,12 @@ static const char ep0name [] = "ep0";
 #error "Can't configure both IXP and PXA"
 #endif
 
+/* IXP doesn't yet support <linux/clk.h> */
+#define clk_get(dev,name)      NULL
+#define clk_enable(clk)                do { } while (0)
+#define clk_disable(clk)       do { } while (0)
+#define clk_put(clk)           do { } while (0)
+
 #endif
 
 #include "pxa2xx_udc.h"
@@ -934,20 +940,31 @@ static void udc_disable(struct pxa2xx_udc *);
 /* We disable the UDC -- and its 48 MHz clock -- whenever it's not
  * in active use.
  */
-static int pullup(struct pxa2xx_udc *udc, int is_active)
+static int pullup(struct pxa2xx_udc *udc)
 {
-       is_active = is_active && udc->vbus && udc->pullup;
+       int is_active = udc->vbus && udc->pullup && !udc->suspended;
        DMSG("%s\n", is_active ? "active" : "inactive");
-       if (is_active)
-               udc_enable(udc);
-       else {
-               if (udc->gadget.speed != USB_SPEED_UNKNOWN) {
-                       DMSG("disconnect %s\n", udc->driver
-                               ? udc->driver->driver.name
-                               : "(no driver)");
-                       stop_activity(udc, udc->driver);
+       if (is_active) {
+               if (!udc->active) {
+                       udc->active = 1;
+                       /* Enable clock for USB device */
+                       clk_enable(udc->clk);
+                       udc_enable(udc);
                }
-               udc_disable(udc);
+       } else {
+               if (udc->active) {
+                       if (udc->gadget.speed != USB_SPEED_UNKNOWN) {
+                               DMSG("disconnect %s\n", udc->driver
+                                       ? udc->driver->driver.name
+                                       : "(no driver)");
+                               stop_activity(udc, udc->driver);
+                       }
+                       udc_disable(udc);
+                       /* Disable clock for USB device */
+                       clk_disable(udc->clk);
+                       udc->active = 0;
+               }
+
        }
        return 0;
 }
@@ -958,9 +975,9 @@ static int pxa2xx_udc_vbus_session(struct usb_gadget *_gadget, int is_active)
        struct pxa2xx_udc       *udc;
 
        udc = container_of(_gadget, struct pxa2xx_udc, gadget);
-       udc->vbus = is_active = (is_active != 0);
+       udc->vbus = (is_active != 0);
        DMSG("vbus %s\n", is_active ? "supplied" : "inactive");
-       pullup(udc, is_active);
+       pullup(udc);
        return 0;
 }
 
@@ -975,9 +992,8 @@ static int pxa2xx_udc_pullup(struct usb_gadget *_gadget, int is_active)
        if (!udc->mach->gpio_pullup && !udc->mach->udc_command)
                return -EOPNOTSUPP;
 
-       is_active = (is_active != 0);
-       udc->pullup = is_active;
-       pullup(udc, is_active);
+       udc->pullup = (is_active != 0);
+       pullup(udc);
        return 0;
 }
 
@@ -997,7 +1013,7 @@ static const struct usb_gadget_ops pxa2xx_udc_ops = {
 #ifdef CONFIG_USB_GADGET_DEBUG_FS
 
 static int
-udc_seq_show(struct seq_file *m, void *d)
+udc_seq_show(struct seq_file *m, void *_d)
 {
        struct pxa2xx_udc       *dev = m->private;
        unsigned long           flags;
@@ -1146,11 +1162,6 @@ static void udc_disable(struct pxa2xx_udc *dev)
 
        udc_clear_mask_UDCCR(UDCCR_UDE);
 
-#ifdef CONFIG_ARCH_PXA
-        /* Disable clock for USB device */
-       clk_disable(dev->clk);
-#endif
-
        ep0_idle (dev);
        dev->gadget.speed = USB_SPEED_UNKNOWN;
 }
@@ -1191,11 +1202,6 @@ static void udc_enable (struct pxa2xx_udc *dev)
 {
        udc_clear_mask_UDCCR(UDCCR_UDE);
 
-#ifdef CONFIG_ARCH_PXA
-        /* Enable clock for USB device */
-       clk_enable(dev->clk);
-#endif
-
        /* try to clear these bits before we enable the udc */
        udc_ack_int_UDCCR(UDCCR_SUSIR|/*UDCCR_RSTIR|*/UDCCR_RESIR);
 
@@ -1286,7 +1292,7 @@ fail:
         * for set_configuration as well as eventual disconnect.
         */
        DMSG("registered gadget driver '%s'\n", driver->driver.name);
-       pullup(dev, 1);
+       pullup(dev);
        dump_state(dev);
        return 0;
 }
@@ -1329,7 +1335,8 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
                return -EINVAL;
 
        local_irq_disable();
-       pullup(dev, 0);
+       dev->pullup = 0;
+       pullup(dev);
        stop_activity(dev, driver);
        local_irq_enable();
 
@@ -2131,13 +2138,11 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
        if (irq < 0)
                return -ENODEV;
 
-#ifdef CONFIG_ARCH_PXA
        dev->clk = clk_get(&pdev->dev, "UDCCLK");
        if (IS_ERR(dev->clk)) {
                retval = PTR_ERR(dev->clk);
                goto err_clk;
        }
-#endif
 
        pr_debug("%s: IRQ %d%s%s\n", driver_name, irq,
                dev->has_cfr ? "" : " (!cfr)",
@@ -2250,10 +2255,8 @@ lubbock_fail0:
        if (dev->mach->gpio_vbus)
                gpio_free(dev->mach->gpio_vbus);
  err_gpio_vbus:
-#ifdef CONFIG_ARCH_PXA
        clk_put(dev->clk);
  err_clk:
-#endif
        return retval;
 }
 
@@ -2269,7 +2272,9 @@ static int __exit pxa2xx_udc_remove(struct platform_device *pdev)
        if (dev->driver)
                return -EBUSY;
 
-       udc_disable(dev);
+       dev->pullup = 0;
+       pullup(dev);
+
        remove_debug_files(dev);
 
        if (dev->got_irq) {
@@ -2289,9 +2294,7 @@ static int __exit pxa2xx_udc_remove(struct platform_device *pdev)
        if (dev->mach->gpio_pullup)
                gpio_free(dev->mach->gpio_pullup);
 
-#ifdef CONFIG_ARCH_PXA
        clk_put(dev->clk);
-#endif
 
        platform_set_drvdata(pdev, NULL);
        the_controller = NULL;
@@ -2317,10 +2320,15 @@ static int __exit pxa2xx_udc_remove(struct platform_device *pdev)
 static int pxa2xx_udc_suspend(struct platform_device *dev, pm_message_t state)
 {
        struct pxa2xx_udc       *udc = platform_get_drvdata(dev);
+       unsigned long flags;
 
        if (!udc->mach->gpio_pullup && !udc->mach->udc_command)
                WARN("USB host won't detect disconnect!\n");
-       pullup(udc, 0);
+       udc->suspended = 1;
+
+       local_irq_save(flags);
+       pullup(udc);
+       local_irq_restore(flags);
 
        return 0;
 }
@@ -2328,8 +2336,12 @@ static int pxa2xx_udc_suspend(struct platform_device *dev, pm_message_t state)
 static int pxa2xx_udc_resume(struct platform_device *dev)
 {
        struct pxa2xx_udc       *udc = platform_get_drvdata(dev);
+       unsigned long flags;
 
-       pullup(udc, 1);
+       udc->suspended = 0;
+       local_irq_save(flags);
+       pullup(udc);
+       local_irq_restore(flags);
 
        return 0;
 }
index b67e3ff5e4eb5baf648b0fcceb457e7e3456af69..e2c19e88c8753b2bd745fab07d6fb8698c855489 100644 (file)
@@ -119,7 +119,9 @@ struct pxa2xx_udc {
                                                has_cfr : 1,
                                                req_pending : 1,
                                                req_std : 1,
-                                               req_config : 1;
+                                               req_config : 1,
+                                               suspended : 1,
+                                               active : 1;
 
 #define start_watchdog(dev) mod_timer(&dev->timer, jiffies + (HZ/200))
        struct timer_list                       timer;
index 776a97f33914e05511bc85dcdced2b4febe6a89b..2e49de820b1494b054dfc5c4cd92ad75c5aad2ef 100644 (file)
@@ -319,10 +319,10 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
                        if (likely (last->urb != urb)) {
                                ehci_urb_done(ehci, last->urb, last_status);
                                count++;
+                               last_status = -EINPROGRESS;
                        }
                        ehci_qtd_free (ehci, last);
                        last = NULL;
-                       last_status = -EINPROGRESS;
                }
 
                /* ignore urbs submitted during completions we reported */
index 0130fd8571e4018549db9a5003bd432b72645878..d7071c85575876552841c4bff7397cd8c43bbcb1 100644 (file)
@@ -911,8 +911,7 @@ static int isp116x_hub_status_data(struct usb_hcd *hcd, char *buf)
                buf[0] = 0;
 
        for (i = 0; i < ports; i++) {
-               u32 status = isp116x->rhport[i] =
-                   isp116x_read_reg32(isp116x, i ? HCRHPORT2 : HCRHPORT1);
+               u32 status = isp116x_read_reg32(isp116x, i ? HCRHPORT2 : HCRHPORT1);
 
                if (status & (RH_PS_CSC | RH_PS_PESC | RH_PS_PSSC
                              | RH_PS_OCIC | RH_PS_PRSC)) {
@@ -1031,7 +1030,9 @@ static int isp116x_hub_control(struct usb_hcd *hcd,
                DBG("GetPortStatus\n");
                if (!wIndex || wIndex > ports)
                        goto error;
-               tmp = isp116x->rhport[--wIndex];
+               spin_lock_irqsave(&isp116x->lock, flags);
+               tmp = isp116x_read_reg32(isp116x, (--wIndex) ? HCRHPORT2 : HCRHPORT1);
+               spin_unlock_irqrestore(&isp116x->lock, flags);
                *(__le32 *) buf = cpu_to_le32(tmp);
                DBG("GetPortStatus: port[%d]  %08x\n", wIndex + 1, tmp);
                break;
@@ -1080,8 +1081,6 @@ static int isp116x_hub_control(struct usb_hcd *hcd,
                spin_lock_irqsave(&isp116x->lock, flags);
                isp116x_write_reg32(isp116x, wIndex
                                    ? HCRHPORT2 : HCRHPORT1, tmp);
-               isp116x->rhport[wIndex] =
-                   isp116x_read_reg32(isp116x, wIndex ? HCRHPORT2 : HCRHPORT1);
                spin_unlock_irqrestore(&isp116x->lock, flags);
                break;
        case SetPortFeature:
@@ -1095,24 +1094,22 @@ static int isp116x_hub_control(struct usb_hcd *hcd,
                        spin_lock_irqsave(&isp116x->lock, flags);
                        isp116x_write_reg32(isp116x, wIndex
                                            ? HCRHPORT2 : HCRHPORT1, RH_PS_PSS);
+                       spin_unlock_irqrestore(&isp116x->lock, flags);
                        break;
                case USB_PORT_FEAT_POWER:
                        DBG("USB_PORT_FEAT_POWER\n");
                        spin_lock_irqsave(&isp116x->lock, flags);
                        isp116x_write_reg32(isp116x, wIndex
                                            ? HCRHPORT2 : HCRHPORT1, RH_PS_PPS);
+                       spin_unlock_irqrestore(&isp116x->lock, flags);
                        break;
                case USB_PORT_FEAT_RESET:
                        DBG("USB_PORT_FEAT_RESET\n");
                        root_port_reset(isp116x, wIndex);
-                       spin_lock_irqsave(&isp116x->lock, flags);
                        break;
                default:
                        goto error;
                }
-               isp116x->rhport[wIndex] =
-                   isp116x_read_reg32(isp116x, wIndex ? HCRHPORT2 : HCRHPORT1);
-               spin_unlock_irqrestore(&isp116x->lock, flags);
                break;
 
        default:
index b91e2edd9c5c1415ebecfe7aa056cddcb15c4fc6..595b90a9984880c819011ad4e181a223d8d6d50b 100644 (file)
@@ -270,7 +270,6 @@ struct isp116x {
        u32 rhdesca;
        u32 rhdescb;
        u32 rhstatus;
-       u32 rhport[2];
 
        /* async schedule: control, bulk */
        struct list_head async;
index 76db2fef4657d076b2e35b5285882308dd173659..91dc433dbcf14048488239bc42a788024eadc32a 100644 (file)
@@ -92,6 +92,7 @@ struct ftdi_sio_quirk {
 };
 
 static int   ftdi_jtag_probe           (struct usb_serial *serial);
+static int   ftdi_mtxorb_hack_setup    (struct usb_serial *serial);
 static void  ftdi_USB_UIRT_setup       (struct ftdi_private *priv);
 static void  ftdi_HE_TIRA1_setup       (struct ftdi_private *priv);
 
@@ -99,6 +100,10 @@ static struct ftdi_sio_quirk ftdi_jtag_quirk = {
        .probe  = ftdi_jtag_probe,
 };
 
+static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = {
+       .probe  = ftdi_mtxorb_hack_setup,
+};
+
 static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
        .port_probe = ftdi_USB_UIRT_setup,
 };
@@ -161,6 +166,8 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
+       { USB_DEVICE(MTXORB_VK_VID, MTXORB_VK_PID),
+               .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
        { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
@@ -274,6 +281,7 @@ static struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) },
        { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) },
        { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) },
@@ -1088,6 +1096,23 @@ static int ftdi_jtag_probe(struct usb_serial *serial)
        return 0;
 }
 
+/*
+ * The Matrix Orbital VK204-25-USB has an invalid IN endpoint.
+ * We have to correct it if we want to read from it.
+ */
+static int ftdi_mtxorb_hack_setup(struct usb_serial *serial)
+{
+       struct usb_host_endpoint *ep = serial->dev->ep_in[1];
+       struct usb_endpoint_descriptor *ep_desc = &ep->desc;
+
+       if (ep->enabled && ep_desc->wMaxPacketSize == 0) {
+               ep_desc->wMaxPacketSize = 0x40;
+               info("Fixing invalid wMaxPacketSize on read pipe");
+       }
+
+       return 0;
+}
+
 /* ftdi_shutdown is called from usbserial:usb_serial_disconnect
  *   it is called when the usb device is disconnected
  *
index 6eee2ab914eca092d1d3b53dc92b30ee294605d1..e1eb742abcd5d081f467b01263a5bf45f26f54b3 100644 (file)
  * (http://www.joernonline.de/dw/doku.php?id=start&idx=projects:oocdlink) */
 #define FTDI_OOCDLINK_PID      0xbaf8  /* Amontec JTAGkey */
 
+/*
+ * The following are the values for the Matrix Orbital VK204-25-USB
+ * display, which use the FT232RL.
+ */
+#define MTXORB_VK_VID          0x1b3d
+#define MTXORB_VK_PID          0x0158
+
 /* Interbiometrics USB I/O Board */
 /* Developed for Interbiometrics by Rudolf Gugler */
 #define INTERBIOMETRICS_VID              0x1209
index 869ecd374cb49e8161b765d23791604c3aff6256..aeeb9cb209994d5a2f0a17c925509605c84d1184 100644 (file)
 
 /* vendor id and device id defines */
 
+/* The native mos7840/7820 component */
 #define USB_VENDOR_ID_MOSCHIP           0x9710
 #define MOSCHIP_DEVICE_ID_7840          0x7840
 #define MOSCHIP_DEVICE_ID_7820          0x7820
+/* The native component can have its vendor/device id's overridden
+ * in vendor-specific implementations.  Such devices can be handled
+ * by making a change here, in moschip_port_id_table, and in
+ * moschip_id_table_combined
+ */
+#define USB_VENDOR_ID_BANDB             0x0856
+#define BANDB_DEVICE_ID_USOPTL4_4       0xAC44
+#define BANDB_DEVICE_ID_USOPTL4_2       0xAC42
 
-/* Interrupt Rotinue Defines    */
+/* Interrupt Routine Defines    */
 
 #define SERIAL_IIR_RLS      0x06
 #define SERIAL_IIR_MS       0x00
 static struct usb_device_id moschip_port_id_table[] = {
        {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)},
        {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)},
+       {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
+       {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
        {}                      /* terminating entry */
 };
 
 static __devinitdata struct usb_device_id moschip_id_table_combined[] = {
        {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)},
        {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)},
+       {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
+       {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
        {}                      /* terminating entry */
 };
 
index af2674c57414c0acde52258f97dcf795f8215cf8..828a4377ec6a1496c5898a6a12c6f3cd8c5f7497 100644 (file)
@@ -120,6 +120,9 @@ static int  option_send_setup(struct usb_serial_port *port);
 #define ANYDATA_PRODUCT_ADU_E100A              0x6501
 #define ANYDATA_PRODUCT_ADU_500A               0x6502
 
+#define AXESSTEL_VENDOR_ID                     0x1726
+#define AXESSTEL_PRODUCT_MV110H                        0x1000
+
 #define BANDRICH_VENDOR_ID                     0x1A8D
 #define BANDRICH_PRODUCT_C100_1                        0x1002
 #define BANDRICH_PRODUCT_C100_2                        0x1003
@@ -192,6 +195,7 @@ static struct usb_device_id option_ids[] = {
        { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */
        { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) },
        { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
+       { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) },
        { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) },
        { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) },
        { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
index 958f5b17847c57748a16a344a833a5a7f8dfe3ae..b9b8ede61fb337bf4927ef2638640bc6723d8102 100644 (file)
@@ -170,7 +170,6 @@ unsigned int usb_stor_access_xfer_buf(unsigned char *buffer,
 
        if (!sg)
                sg = scsi_sglist(srb);
-       buflen = min(buflen, scsi_bufflen(srb));
 
        /* This loop handles a single s-g list entry, which may
         * include multiple pages.  Find the initial page structure
@@ -232,6 +231,7 @@ void usb_stor_set_xfer_buf(unsigned char *buffer,
        unsigned int offset = 0;
        struct scatterlist *sg = NULL;
 
+       buflen = min(buflen, scsi_bufflen(srb));
        buflen = usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, &offset,
                        TO_XFER_BUF);
        if (buflen < scsi_bufflen(srb))
index 756c0ce85911fa8d5c27b6a2254d52cac6323488..392a8be6aa76b873cd87b6d3f72ae2f3aef3b4ce 100644 (file)
@@ -403,7 +403,7 @@ static int __init hitfb_probe(struct platform_device *dev)
        return 0;
 }
 
-static int __devexit hitfb_remove(struct platform_device *dev)
+static int __exit hitfb_remove(struct platform_device *dev)
 {
        return unregister_framebuffer(&fb_info);
 }
@@ -439,7 +439,7 @@ static int hitfb_resume(struct platform_device *dev)
 
 static struct platform_driver hitfb_driver = {
        .probe          = hitfb_probe,
-       .remove         = __devexit_p(hitfb_remove),
+       .remove         = __exit_p(hitfb_remove),
 #ifdef CONFIG_PM
        .suspend        = hitfb_suspend,
        .resume         = hitfb_resume,
index 6a3d0b574897f5da14a6840b0dfc07926506387f..8c863a7f654bba9ce667c7942415e4fc09d9417a 100644 (file)
@@ -1,16 +1,12 @@
-/* drivers/video/pvr2fb.c
+/*
+ * drivers/video/pvr2fb.c
  *
  * Frame buffer and fbcon support for the NEC PowerVR2 found within the Sega
  * Dreamcast.
  *
  * Copyright (c) 2001 M. R. Brown <mrbrown@0xd6.org>
- * Copyright (c) 2001, 2002, 2003, 2004, 2005 Paul Mundt <lethal@linux-sh.org>
- *
- * This file is part of the LinuxDC project (linuxdc.sourceforge.net).
+ * Copyright (c) 2001 - 2008  Paul Mundt <lethal@linux-sh.org>
  *
- */
-
-/*
  * This driver is mostly based on the excellent amifb and vfb sources.  It uses
  * an odd scheme for converting hardware values to/from framebuffer values,
  * here are some hacked-up formulas:
@@ -490,7 +486,7 @@ static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
        } else {
                var->sync &= ~FB_SYNC_BROADCAST;
                var->vmode &= ~FB_VMODE_INTERLACED;
-               var->vmode |= pvr2_var.vmode;
+               var->vmode |= FB_VMODE_NONINTERLACED;
        }
 
        if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_TEST) {
index e83dfba7e6361af564390dcd553dcdd6a1790ee5..742b5c656d668d447b02984d1fe4c2ba237c6743 100644 (file)
@@ -237,12 +237,14 @@ static int sm501fb_check_var(struct fb_var_screeninfo *var,
 
        /* check we can fit these values into the registers */
 
-       if (var->hsync_len > 255 || var->vsync_len > 255)
+       if (var->hsync_len > 255 || var->vsync_len > 63)
                return -EINVAL;
 
-       if ((var->xres + var->right_margin) >= 4096)
+       /* hdisplay end and hsync start */
+       if ((var->xres + var->right_margin) > 4096)
                return -EINVAL;
 
+       /* vdisplay end and vsync start */
        if ((var->yres + var->lower_margin) > 2048)
                return -EINVAL;
 
@@ -281,19 +283,21 @@ static int sm501fb_check_var(struct fb_var_screeninfo *var,
                var->blue.length        = var->bits_per_pixel;
                var->blue.offset        = 0;
                var->transp.length      = 0;
+               var->transp.offset      = 0;
 
                break;
 
        case 16:
                if (sm->pdata->flags & SM501_FBPD_SWAP_FB_ENDIAN) {
-                       var->red.offset         = 11;
-                       var->green.offset       = 5;
-                       var->blue.offset        = 0;
-               } else {
                        var->blue.offset        = 11;
                        var->green.offset       = 5;
                        var->red.offset         = 0;
+               } else {
+                       var->red.offset         = 11;
+                       var->green.offset       = 5;
+                       var->blue.offset        = 0;
                }
+               var->transp.offset      = 0;
 
                var->red.length         = 5;
                var->green.length       = 6;
@@ -397,7 +401,7 @@ static int sm501fb_set_par_common(struct fb_info *info,
                break;
 
        case 16:
-               info->fix.visual = FB_VISUAL_DIRECTCOLOR;
+               info->fix.visual = FB_VISUAL_TRUECOLOR;
                break;
 
        case 32:
@@ -613,6 +617,7 @@ static int sm501fb_set_par_crt(struct fb_info *info)
 
        case 16:
                control |= SM501_DC_CRT_CONTROL_16BPP;
+               sm501fb_setup_gamma(fbi, SM501_DC_CRT_PALETTE);
                break;
 
        case 32:
@@ -750,6 +755,7 @@ static int sm501fb_set_par_pnl(struct fb_info *info)
 
        case 16:
                control |= SM501_DC_PANEL_CONTROL_16BPP;
+               sm501fb_setup_gamma(fbi, SM501_DC_PANEL_PALETTE);
                break;
 
        case 32:
index 70fb4ee2b4215d978208f5edf7693991e4ebdd5c..919ce75db9e2ce1a0bcf6ce71d498eace0233c38 100644 (file)
@@ -564,19 +564,46 @@ static inline void write3CE(int reg, unsigned char val)
        t_outb(val, 0x3CF);
 }
 
-static inline void enable_mmio(void)
+static void enable_mmio(void)
 {
+       unsigned char tmp;
+
        /* Goto New Mode */
        outb(0x0B, 0x3C4);
        inb(0x3C5);
 
        /* Unprotect registers */
        outb(NewMode1, 0x3C4);
+       tmp = inb(0x3C5);
        outb(0x80, 0x3C5);
 
        /* Enable MMIO */
        outb(PCIReg, 0x3D4);
        outb(inb(0x3D5) | 0x01, 0x3D5);
+
+       t_outb(NewMode1, 0x3C4);
+       t_outb(tmp, 0x3C5);
+}
+
+static void disable_mmio(void)
+{
+       unsigned char tmp;
+
+       /* Goto New Mode */
+       t_outb(0x0B, 0x3C4);
+       t_inb(0x3C5);
+
+       /* Unprotect registers */
+       t_outb(NewMode1, 0x3C4);
+       tmp = t_inb(0x3C5);
+       t_outb(0x80, 0x3C5);
+
+       /* Disable MMIO */
+       t_outb(PCIReg, 0x3D4);
+       t_outb(t_inb(0x3D5) & ~0x01, 0x3D5);
+
+       outb(NewMode1, 0x3C4);
+       outb(tmp, 0x3C5);
 }
 
 #define crtc_unlock()  write3X4(CRTVSyncEnd, read3X4(CRTVSyncEnd) & 0x7F)
@@ -1239,9 +1266,9 @@ static int __devinit trident_pci_probe(struct pci_dev * dev,
        default_par.io_virt = ioremap_nocache(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len);
 
        if (!default_par.io_virt) {
-               release_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len);
                debug("ioremap failed\n");
-               return -1;
+               err = -1;
+               goto out_unmap1;
        }
 
        enable_mmio();
@@ -1252,25 +1279,21 @@ static int __devinit trident_pci_probe(struct pci_dev * dev,
 
        if (!request_mem_region(tridentfb_fix.smem_start, tridentfb_fix.smem_len, "tridentfb")) {
                debug("request_mem_region failed!\n");
+               disable_mmio();
                err = -1;
-               goto out_unmap;
+               goto out_unmap1;
        }
 
        fb_info.screen_base = ioremap_nocache(tridentfb_fix.smem_start,
                                              tridentfb_fix.smem_len);
 
        if (!fb_info.screen_base) {
-               release_mem_region(tridentfb_fix.smem_start, tridentfb_fix.smem_len);
                debug("ioremap failed\n");
                err = -1;
-               goto out_unmap;
+               goto out_unmap2;
        }
 
        output("%s board found\n", pci_name(dev));
-#if 0
-       output("Trident board found : mem = %X, io = %X, mem_v = %X, io_v = %X\n",
-               tridentfb_fix.smem_start, tridentfb_fix.mmio_start, fb_info.screen_base, default_par.io_virt);
-#endif
        displaytype = get_displaytype();
 
        if (flatpanel)
@@ -1288,9 +1311,12 @@ static int __devinit trident_pci_probe(struct pci_dev * dev,
 
        if (!fb_find_mode(&default_var, &fb_info, mode, NULL, 0, NULL, bpp)) {
                err = -EINVAL;
-               goto out_unmap;
+               goto out_unmap2;
        }
-       fb_alloc_cmap(&fb_info.cmap, 256, 0);
+       err = fb_alloc_cmap(&fb_info.cmap, 256, 0);
+       if (err < 0)
+               goto out_unmap2;
+
        if (defaultaccel && acc)
                default_var.accel_flags |= FB_ACCELF_TEXT;
        else
@@ -1300,19 +1326,24 @@ static int __devinit trident_pci_probe(struct pci_dev * dev,
        fb_info.device = &dev->dev;
        if (register_framebuffer(&fb_info) < 0) {
                printk(KERN_ERR "tridentfb: could not register Trident framebuffer\n");
+               fb_dealloc_cmap(&fb_info.cmap);
                err = -EINVAL;
-               goto out_unmap;
+               goto out_unmap2;
        }
        output("fb%d: %s frame buffer device %dx%d-%dbpp\n",
           fb_info.node, fb_info.fix.id, default_var.xres,
           default_var.yres, default_var.bits_per_pixel);
        return 0;
 
-out_unmap:
-       if (default_par.io_virt)
-               iounmap(default_par.io_virt);
+out_unmap2:
        if (fb_info.screen_base)
                iounmap(fb_info.screen_base);
+       release_mem_region(tridentfb_fix.smem_start, tridentfb_fix.smem_len);
+       disable_mmio();
+out_unmap1:
+       if (default_par.io_virt)
+               iounmap(default_par.io_virt);
+       release_mem_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len);
        return err;
 }
 
@@ -1323,7 +1354,7 @@ static void __devexit trident_pci_remove(struct pci_dev *dev)
        iounmap(par->io_virt);
        iounmap(fb_info.screen_base);
        release_mem_region(tridentfb_fix.smem_start, tridentfb_fix.smem_len);
-       release_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len);
+       release_mem_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len);
 }
 
 /* List of boards that we are trying to support */
index 688e435b4d9a60cb56097ee85c82ec3b662bd479..10211e493001582e0a5b27f549a4c9c00f3a6e5a 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/pm.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 #include <linux/delay.h>
 #include <linux/ds1wm.h>
 
@@ -102,12 +103,12 @@ struct ds1wm_data {
 static inline void ds1wm_write_register(struct ds1wm_data *ds1wm_data, u32 reg,
                                        u8 val)
 {
-        __raw_writeb(val, ds1wm_data->map + (reg << ds1wm_data->bus_shift));
+       __raw_writeb(val, ds1wm_data->map + (reg << ds1wm_data->bus_shift));
 }
 
 static inline u8 ds1wm_read_register(struct ds1wm_data *ds1wm_data, u32 reg)
 {
-        return __raw_readb(ds1wm_data->map + (reg << ds1wm_data->bus_shift));
+       return __raw_readb(ds1wm_data->map + (reg << ds1wm_data->bus_shift));
 }
 
 
@@ -149,8 +150,8 @@ static int ds1wm_reset(struct ds1wm_data *ds1wm_data)
        timeleft = wait_for_completion_timeout(&reset_done, DS1WM_TIMEOUT);
        ds1wm_data->reset_complete = NULL;
        if (!timeleft) {
-                dev_dbg(&ds1wm_data->pdev->dev, "reset failed\n");
-                return 1;
+               dev_err(&ds1wm_data->pdev->dev, "reset failed\n");
+               return 1;
        }
 
        /* Wait for the end of the reset. According to the specs, the time
@@ -167,11 +168,11 @@ static int ds1wm_reset(struct ds1wm_data *ds1wm_data)
                (ds1wm_data->active_high ? DS1WM_INTEN_IAS : 0));
 
        if (!ds1wm_data->slave_present) {
-                dev_dbg(&ds1wm_data->pdev->dev, "reset: no devices found\n");
-                return 1;
-        }
+               dev_dbg(&ds1wm_data->pdev->dev, "reset: no devices found\n");
+               return 1;
+       }
 
-        return 0;
+       return 0;
 }
 
 static int ds1wm_write(struct ds1wm_data *ds1wm_data, u8 data)
@@ -334,7 +335,7 @@ static int ds1wm_probe(struct platform_device *pdev)
        if (!pdev)
                return -ENODEV;
 
-       ds1wm_data = kzalloc(sizeof (*ds1wm_data), GFP_KERNEL);
+       ds1wm_data = kzalloc(sizeof(*ds1wm_data), GFP_KERNEL);
        if (!ds1wm_data)
                return -ENOMEM;
 
@@ -374,8 +375,8 @@ static int ds1wm_probe(struct platform_device *pdev)
                goto err1;
 
        ds1wm_data->clk = clk_get(&pdev->dev, "ds1wm");
-       if (!ds1wm_data->clk) {
-               ret = -ENOENT;
+       if (IS_ERR(ds1wm_data->clk)) {
+               ret = PTR_ERR(ds1wm_data->clk);
                goto err2;
        }
 
index 41a958a7585e750cd800b2d229d5b3b2a04f0898..5e1a4fb5cacb2a3715ad3552bd8e412fdae9b00c 100644 (file)
@@ -1424,6 +1424,18 @@ struct elf_note_info {
        int thread_notes;
 };
 
+/*
+ * When a regset has a writeback hook, we call it on each thread before
+ * dumping user memory.  On register window machines, this makes sure the
+ * user memory backing the register data is up to date before we read it.
+ */
+static void do_thread_regset_writeback(struct task_struct *task,
+                                      const struct user_regset *regset)
+{
+       if (regset->writeback)
+               regset->writeback(task, regset, 1);
+}
+
 static int fill_thread_core_info(struct elf_thread_core_info *t,
                                 const struct user_regset_view *view,
                                 long signr, size_t *total)
@@ -1445,6 +1457,8 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
                  sizeof(t->prstatus), &t->prstatus);
        *total += notesize(&t->notes[0]);
 
+       do_thread_regset_writeback(t->task, &view->regsets[0]);
+
        /*
         * Each other regset might generate a note too.  For each regset
         * that has no core_note_type or is inactive, we leave t->notes[i]
@@ -1452,6 +1466,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
         */
        for (i = 1; i < view->n; ++i) {
                const struct user_regset *regset = &view->regsets[i];
+               do_thread_regset_writeback(t->task, regset);
                if (regset->core_note_type &&
                    (!regset->active || regset->active(t->task, regset))) {
                        int ret;
index 3ebccf4aa7e3280318b4ae8fbd2b28514d929749..ddfdd2c80bf9ba22c20901e5a74f9cd449d80ccd 100644 (file)
@@ -627,8 +627,7 @@ repeat:
 }
 
 /**
- * sync_mapping_buffers - write out and wait upon a mapping's "associated"
- *                        buffers
+ * sync_mapping_buffers - write out & wait upon a mapping's "associated" buffers
  * @mapping: the mapping which wants those buffers written
  *
  * Starts I/O against the buffers at mapping->private_list, and waits upon
@@ -836,7 +835,7 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list)
                smp_mb();
                if (buffer_dirty(bh)) {
                        list_add(&bh->b_assoc_buffers,
-                                &bh->b_assoc_map->private_list);
+                                &mapping->private_list);
                        bh->b_assoc_map = mapping;
                }
                spin_unlock(lock);
index edd248367b36fe67166053731ab55d0edbcff796..dbd91461853c97fc1c5c4538c53c6514570f85d4 100644 (file)
@@ -6,7 +6,9 @@ and sync so that events like out of disk space get reported properly on
 cached files. Fix setxattr failure to certain Samba versions. Fix mount
 of second share to disconnected server session (autoreconnect on this).
 Add ability to modify cifs acls for handling chmod (when mounted with
-cifsacl flag).
+cifsacl flag). Fix prefixpath path separator so we can handle mounts
+with prefixpaths longer than one directory (one path component) when
+mounted to Windows servers.
 
 Version 1.51
 ------------
index c623e2f9c5dbab90e314c54133ea027ff6cbfe4d..50306229b0f9f822b4f4e6d53cca9b9a5986ec07 100644 (file)
@@ -461,7 +461,7 @@ A partial list of the supported mount options follows:
  cifsacl        Report mode bits (e.g. on stat) based on the Windows ACL for
                the file. (EXPERIMENTAL)
  servern        Specify the server 's netbios name (RFC1001 name) to use
-               when attempting to setup a session to the server.  This is
+               when attempting to setup a session to the server. 
                This is needed for mounting to some older servers (such
                as OS/2 or Windows 98 and Windows ME) since they do not
                support a default server name.  A server name can be up
index 73c4c419663c1dc1a3558d2df405fcb58bc07e66..0228ed06069e95c88b3b4a032b5b423f474ca190 100644 (file)
@@ -98,8 +98,7 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
                        if (mid_entry->resp_buf) {
                                cifs_dump_detail(mid_entry->resp_buf);
                                cifs_dump_mem("existing buf: ",
-                                       mid_entry->resp_buf,
-                                       62 /* fixme */);
+                                       mid_entry->resp_buf, 62);
                        }
                }
        }
@@ -439,7 +438,7 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset,
 
        return length;
 }
-#endif
+#endif /* STATS */
 
 static struct proc_dir_entry *proc_fs_cifs;
 read_proc_t cifs_txanchor_read;
@@ -482,7 +481,7 @@ cifs_proc_init(void)
                                cifs_stats_read, NULL);
        if (pde)
                pde->write_proc = cifs_stats_write;
-#endif
+#endif /* STATS */
        pde = create_proc_read_entry("cifsFYI", 0, proc_fs_cifs,
                                cifsFYI_read, NULL);
        if (pde)
@@ -918,4 +917,12 @@ security_flags_write(struct file *file, const char __user *buffer,
        /* BB should we turn on MAY flags for other MUST options? */
        return count;
 }
-#endif
+#else
+inline void cifs_proc_init(void)
+{
+}
+
+inline void cifs_proc_clean(void)
+{
+}
+#endif /* PROC_FS */
index c26cd0d2c6d525d64455dfba60e9fdd5b9a4243a..5eb3b83bbfa76b90992f8bfbc805758f6a2e71bf 100644 (file)
 
 void cifs_dump_mem(char *label, void *data, int length);
 #ifdef CONFIG_CIFS_DEBUG2
+#define DBG2 2
 void cifs_dump_detail(struct smb_hdr *);
 void cifs_dump_mids(struct TCP_Server_Info *);
+#else
+#define DBG2 0
 #endif
 extern int traceSMB;           /* flag which enables the function below */
 void dump_smb(struct smb_hdr *, int);
@@ -64,10 +67,10 @@ extern int cifsERROR;
  *     ---------
  */
 #else          /* _CIFS_DEBUG */
-#define cERROR(button,prspec)
-#define cEVENT(format,arg...)
+#define cERROR(button, prspec)
+#define cEVENT(format, arg...)
 #define cFYI(button, prspec)
-#define cifserror(format,arg...)
+#define cifserror(format, arg...)
 #endif         /* _CIFS_DEBUG */
 
 #endif                         /* _H_CIFS_DEBUG */
index 6ad447529961c0939c84b1eba822cb7076e3817d..7f8838253410572397725dffd3d92abba884c20c 100644 (file)
@@ -286,7 +286,7 @@ static void dump_referral(const struct dfs_info3_param *ref)
        cFYI(1, ("DFS: node path: %s", ref->node_name));
        cFYI(1, ("DFS: fl: %hd, srv_type: %hd", ref->flags, ref->server_type));
        cFYI(1, ("DFS: ref_flags: %hd, path_consumed: %hd", ref->ref_flag,
-                               ref->PathConsumed));
+                               ref->path_consumed));
 }
 
 
index d543accc10dd0be24a870ebaa634bd9c7cb199e7..6653e29637a7ec534c83d53c8a21ddda24130367 100644 (file)
@@ -125,7 +125,7 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
 #ifdef CONFIG_CIFS_DEBUG2
        if (cifsFYI && !IS_ERR(spnego_key)) {
                struct cifs_spnego_msg *msg = spnego_key->payload.data;
-               cifs_dump_mem("SPNEGO reply blob:", msg->data, min(1024,
+               cifs_dump_mem("SPNEGO reply blob:", msg->data, min(1024U,
                                msg->secblob_len + msg->sesskey_len));
        }
 #endif /* CONFIG_CIFS_DEBUG2 */
index b5903b89250d412c93f31eb626252c44861463b4..7d75272a6b3f01499738ce1ba10f961429892855 100644 (file)
@@ -32,7 +32,7 @@
  *
  */
 int
-cifs_strfromUCS_le(char *to, const __le16 * from,
+cifs_strfromUCS_le(char *to, const __le16 *from,
                   int len, const struct nls_table *codepage)
 {
        int i;
@@ -61,7 +61,7 @@ cifs_strfromUCS_le(char *to, const __le16 * from,
  *
  */
 int
-cifs_strtoUCS(__le16 * to, const char *from, int len,
+cifs_strtoUCS(__le16 *to, const char *from, int len,
              const struct nls_table *codepage)
 {
        int charlen;
index 614c11fcdcb67d0f704badaf029991dddc3682c0..14eb9a2395d3cc3c4020e08c01d8b3b5dbc9faa0 100644 (file)
@@ -254,7 +254,8 @@ UniStrstr(const wchar_t *ucs1, const wchar_t *ucs2)
        const wchar_t *anchor2 = ucs2;
 
        while (*ucs1) {
-               if (*ucs1 == *ucs2) {   /* Partial match found */
+               if (*ucs1 == *ucs2) {
+                       /* Partial match found */
                        ucs1++;
                        ucs2++;
                } else {
@@ -279,7 +280,8 @@ UniToupper(register wchar_t uc)
 {
        register const struct UniCaseRange *rp;
 
-       if (uc < sizeof (CifsUniUpperTable)) {  /* Latin characters */
+       if (uc < sizeof(CifsUniUpperTable)) {
+               /* Latin characters */
                return uc + CifsUniUpperTable[uc];      /* Use base tables */
        } else {
                rp = CifsUniUpperRange; /* Use range tables */
@@ -320,7 +322,8 @@ UniTolower(wchar_t uc)
 {
        register struct UniCaseRange *rp;
 
-       if (uc < sizeof (UniLowerTable)) {      /* Latin characters */
+       if (uc < sizeof(UniLowerTable)) {
+               /* Latin characters */
                return uc + UniLowerTable[uc];  /* Use base tables */
        } else {
                rp = UniLowerRange;     /* Use range tables */
index a7035bd18e4e4282ed4fcef9c22132c94c9e7f09..f93932c217728861d97ca4b1d4d2754a6f81fa1c 100644 (file)
@@ -46,8 +46,7 @@ static struct cifs_wksid wksidarr[NUM_WK_SIDS] = {
 static const struct cifs_sid sid_everyone = {
        1, 1, {0, 0, 0, 0, 0, 1}, {0} };
 /* group users */
-static const struct cifs_sid sid_user =
-               {1, 2 , {0, 0, 0, 0, 0, 5}, {} };
+static const struct cifs_sid sid_user = {1, 2 , {0, 0, 0, 0, 0, 5}, {} };
 
 
 int match_sid(struct cifs_sid *ctsid)
@@ -195,9 +194,9 @@ static void access_flags_to_mode(__le32 ace_flags, int type, umode_t *pmode,
        /* For deny ACEs we change the mask so that subsequent allow access
           control entries do not turn on the bits we are denying */
        if (type == ACCESS_DENIED) {
-               if (flags & GENERIC_ALL) {
+               if (flags & GENERIC_ALL)
                        *pbits_to_set &= ~S_IRWXUGO;
-               }
+
                if ((flags & GENERIC_WRITE) ||
                        ((flags & FILE_WRITE_RIGHTS) == FILE_WRITE_RIGHTS))
                        *pbits_to_set &= ~S_IWUGO;
@@ -216,9 +215,7 @@ static void access_flags_to_mode(__le32 ace_flags, int type, umode_t *pmode,
 
        if (flags & GENERIC_ALL) {
                *pmode |= (S_IRWXUGO & (*pbits_to_set));
-#ifdef CONFIG_CIFS_DEBUG2
-               cFYI(1, ("all perms"));
-#endif
+               cFYI(DBG2, ("all perms"));
                return;
        }
        if ((flags & GENERIC_WRITE) ||
@@ -231,9 +228,7 @@ static void access_flags_to_mode(__le32 ace_flags, int type, umode_t *pmode,
                        ((flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS))
                *pmode |= (S_IXUGO & (*pbits_to_set));
 
-#ifdef CONFIG_CIFS_DEBUG2
-       cFYI(1, ("access flags 0x%x mode now 0x%x", flags, *pmode));
-#endif
+       cFYI(DBG2, ("access flags 0x%x mode now 0x%x", flags, *pmode));
        return;
 }
 
@@ -262,9 +257,7 @@ static void mode_to_access_flags(umode_t mode, umode_t bits_to_use,
        if (mode & S_IXUGO)
                *pace_flags |= SET_FILE_EXEC_RIGHTS;
 
-#ifdef CONFIG_CIFS_DEBUG2
-       cFYI(1, ("mode: 0x%x, access flags now 0x%x", mode, *pace_flags));
-#endif
+       cFYI(DBG2, ("mode: 0x%x, access flags now 0x%x", mode, *pace_flags));
        return;
 }
 
@@ -358,11 +351,9 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
                return;
        }
 
-#ifdef CONFIG_CIFS_DEBUG2
-       cFYI(1, ("DACL revision %d size %d num aces %d",
+       cFYI(DBG2, ("DACL revision %d size %d num aces %d",
                le16_to_cpu(pdacl->revision), le16_to_cpu(pdacl->size),
                le32_to_cpu(pdacl->num_aces)));
-#endif
 
        /* reset rwx permissions for user/group/other.
           Also, if num_aces is 0 i.e. DACL has no ACEs,
@@ -381,10 +372,6 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
                ppace = kmalloc(num_aces * sizeof(struct cifs_ace *),
                                GFP_KERNEL);
 
-/*             cifscred->cecount = pdacl->num_aces;
-               cifscred->aces = kmalloc(num_aces *
-                       sizeof(struct cifs_ace *), GFP_KERNEL);*/
-
                for (i = 0; i < num_aces; ++i) {
                        ppace[i] = (struct cifs_ace *) (acl_base + acl_size);
 #ifdef CONFIG_CIFS_DEBUG2
@@ -437,7 +424,7 @@ static int set_chmod_dacl(struct cifs_acl *pndacl, struct cifs_sid *pownersid,
                                         &sid_everyone, nmode, S_IRWXO);
 
        pndacl->size = cpu_to_le16(size + sizeof(struct cifs_acl));
-       pndacl->num_aces = 3;
+       pndacl->num_aces = cpu_to_le32(3);
 
        return (0);
 }
@@ -495,13 +482,11 @@ static int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len,
                                le32_to_cpu(pntsd->gsidoffset));
        dacloffset = le32_to_cpu(pntsd->dacloffset);
        dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset);
-#ifdef CONFIG_CIFS_DEBUG2
-       cFYI(1, ("revision %d type 0x%x ooffset 0x%x goffset 0x%x "
+       cFYI(DBG2, ("revision %d type 0x%x ooffset 0x%x goffset 0x%x "
                 "sacloffset 0x%x dacloffset 0x%x",
                 pntsd->revision, pntsd->type, le32_to_cpu(pntsd->osidoffset),
                 le32_to_cpu(pntsd->gsidoffset),
                 le32_to_cpu(pntsd->sacloffset), dacloffset));
-#endif
 /*     cifs_dump_mem("owner_sid: ", owner_sid_ptr, 64); */
        rc = parse_sid(owner_sid_ptr, end_of_acl);
        if (rc)
@@ -636,9 +621,7 @@ static int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
        struct super_block *sb;
        struct cifs_sb_info *cifs_sb;
 
-#ifdef CONFIG_CIFS_DEBUG2
-       cFYI(1, ("set ACL for %s from mode 0x%x", path, inode->i_mode));
-#endif
+       cFYI(DBG2, ("set ACL for %s from mode 0x%x", path, inode->i_mode));
 
        if (!inode)
                return (rc);
@@ -669,9 +652,7 @@ static int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
        }
 
        rc = CIFSSMBSetCIFSACL(xid, cifs_sb->tcon, fid, pnntsd, acllen);
-#ifdef CONFIG_CIFS_DEBUG2
-       cFYI(1, ("SetCIFSACL rc = %d", rc));
-#endif
+       cFYI(DBG2, ("SetCIFSACL rc = %d", rc));
        if (unlock_file == TRUE)
                atomic_dec(&open_file->wrtPending);
        else
@@ -689,9 +670,7 @@ void acl_to_uid_mode(struct inode *inode, const char *path)
        u32 acllen = 0;
        int rc = 0;
 
-#ifdef CONFIG_CIFS_DEBUG2
-       cFYI(1, ("converting ACL to mode for %s", path));
-#endif
+       cFYI(DBG2, ("converting ACL to mode for %s", path));
        pntsd = get_cifs_acl(&acllen, inode, path);
 
        /* if we can retrieve the ACL, now parse Access Control Entries, ACEs */
@@ -712,9 +691,7 @@ int mode_to_acl(struct inode *inode, const char *path, __u64 nmode)
        struct cifs_ntsd *pntsd = NULL; /* acl obtained from server */
        struct cifs_ntsd *pnntsd = NULL; /* modified acl to be sent to server */
 
-#ifdef CONFIG_CIFS_DEBUG2
-       cFYI(1, ("set ACL from mode for %s", path));
-#endif
+       cFYI(DBG2, ("set ACL from mode for %s", path));
 
        /* Get the security descriptor */
        pntsd = get_cifs_acl(&acllen, inode, path);
@@ -736,16 +713,12 @@ int mode_to_acl(struct inode *inode, const char *path, __u64 nmode)
 
                rc = build_sec_desc(pntsd, pnntsd, acllen, inode, nmode);
 
-#ifdef CONFIG_CIFS_DEBUG2
-               cFYI(1, ("build_sec_desc rc: %d", rc));
-#endif
+               cFYI(DBG2, ("build_sec_desc rc: %d", rc));
 
                if (!rc) {
                        /* Set the security descriptor */
                        rc = set_cifs_acl(pnntsd, acllen, inode, path);
-#ifdef CONFIG_CIFS_DEBUG2
-                       cFYI(1, ("set_cifs_acl rc: %d", rc));
-#endif
+                       cFYI(DBG2, ("set_cifs_acl rc: %d", rc));
                }
 
                kfree(pnntsd);
index fcc434227691fe4cbd57d2d74b7780c0767804fb..a04b17e5a9d01dbf5b8af64323b38b9ec45b20e8 100644 (file)
@@ -204,9 +204,8 @@ cifs_put_super(struct super_block *sb)
                return;
        }
        rc = cifs_umount(sb, cifs_sb);
-       if (rc) {
+       if (rc)
                cERROR(1, ("cifs_umount failed with return code %d", rc));
-       }
 #ifdef CONFIG_CIFS_DFS_UPCALL
        if (cifs_sb->mountdata) {
                kfree(cifs_sb->mountdata);
@@ -461,7 +460,7 @@ int cifs_xstate_get(struct super_block *sb, struct fs_quota_stat *qstats)
 
 static struct quotactl_ops cifs_quotactl_ops = {
        .set_xquota     = cifs_xquota_set,
-       .get_xquota     = cifs_xquota_set,
+       .get_xquota     = cifs_xquota_get,
        .set_xstate     = cifs_xstate_set,
        .get_xstate     = cifs_xstate_get,
 };
@@ -472,9 +471,7 @@ static void cifs_umount_begin(struct vfsmount *vfsmnt, int flags)
        struct cifs_sb_info *cifs_sb;
        struct cifsTconInfo *tcon;
 
-#ifdef CONFIG_CIFS_DFS_UPCALL
        dfs_shrink_umount_helper(vfsmnt);
-#endif /* CONFIG CIFS_DFS_UPCALL */
 
        if (!(flags & MNT_FORCE))
                return;
@@ -992,9 +989,7 @@ static int __init
 init_cifs(void)
 {
        int rc = 0;
-#ifdef CONFIG_PROC_FS
        cifs_proc_init();
-#endif
 /*     INIT_LIST_HEAD(&GlobalServerList);*/    /* BB not implemented yet */
        INIT_LIST_HEAD(&GlobalSMBSessionList);
        INIT_LIST_HEAD(&GlobalTreeConnectionList);
@@ -1095,19 +1090,15 @@ init_cifs(void)
  out_destroy_inodecache:
        cifs_destroy_inodecache();
  out_clean_proc:
-#ifdef CONFIG_PROC_FS
        cifs_proc_clean();
-#endif
        return rc;
 }
 
 static void __exit
 exit_cifs(void)
 {
-       cFYI(0, ("exit_cifs"));
-#ifdef CONFIG_PROC_FS
+       cFYI(DBG2, ("exit_cifs"));
        cifs_proc_clean();
-#endif
 #ifdef CONFIG_CIFS_DFS_UPCALL
        unregister_key_type(&key_type_dns_resolver);
 #endif
index 5d32d8ddc82eac91b80ebf552da45f0ea6c9fd22..69a2e1942542e1601e9e66078a1c052b86d51742 100644 (file)
@@ -454,7 +454,7 @@ struct dir_notify_req {
 
 struct dfs_info3_param {
        int flags; /* DFSREF_REFERRAL_SERVER, DFSREF_STORAGE_SERVER*/
-       int PathConsumed;
+       int path_consumed;
        int server_type;
        int ref_flag;
        char *path_name;
index 2f09f565a3d9603c02811f4ce47cfb36df41de21..0af63e6b426be4044e5d921c0b2ae53da517e5e5 100644 (file)
@@ -53,11 +53,11 @@ extern int SendReceiveNoRsp(const unsigned int xid, struct cifsSesInfo *ses,
 extern int SendReceive2(const unsigned int /* xid */ , struct cifsSesInfo *,
                        struct kvec *, int /* nvec to send */,
                        int * /* type of buf returned */ , const int flags);
-extern int SendReceiveBlockingLock(const unsigned int /* xid */ ,
-                                       struct cifsTconInfo *,
-                               struct smb_hdr * /* input */ ,
-                               struct smb_hdr * /* out */ ,
-                               int * /* bytes returned */);
+extern int SendReceiveBlockingLock(const unsigned int xid,
+                       struct cifsTconInfo *ptcon,
+                       struct smb_hdr *in_buf ,
+                       struct smb_hdr *out_buf,
+                       int *bytes_returned);
 extern int checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length);
 extern int is_valid_oplock_break(struct smb_hdr *smb, struct TCP_Server_Info *);
 extern int is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
@@ -84,7 +84,7 @@ extern __u16 GetNextMid(struct TCP_Server_Info *server);
 extern struct oplock_q_entry *AllocOplockQEntry(struct inode *, u16,
                                                 struct cifsTconInfo *);
 extern void DeleteOplockQEntry(struct oplock_q_entry *);
-extern struct timespec cifs_NTtimeToUnix(u64 /* utc nanoseconds since 1601 */ );
+extern struct timespec cifs_NTtimeToUnix(u64 utc_nanoseconds_since_1601);
 extern u64 cifs_UnixTimeToNT(struct timespec);
 extern __le64 cnvrtDosCifsTm(__u16 date, __u16 time);
 extern struct timespec cnvrtDosUnixTm(__u16 date, __u16 time);
@@ -104,7 +104,11 @@ extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *,
 extern int cifs_umount(struct super_block *, struct cifs_sb_info *);
 #ifdef CONFIG_CIFS_DFS_UPCALL
 extern void dfs_shrink_umount_helper(struct vfsmount *vfsmnt);
-#endif
+#else
+static inline void dfs_shrink_umount_helper(struct vfsmount *vfsmnt)
+{
+}
+#endif /* DFS_UPCALL */
 void cifs_proc_init(void);
 void cifs_proc_clean(void);
 
@@ -175,11 +179,11 @@ extern int CIFSSMBQFSPosixInfo(const int xid, struct cifsTconInfo *tcon,
                        struct kstatfs *FSData);
 
 extern int CIFSSMBSetTimes(const int xid, struct cifsTconInfo *tcon,
-                       const char *fileName, const FILE_BASIC_INFO * data,
+                       const char *fileName, const FILE_BASIC_INFO *data,
                        const struct nls_table *nls_codepage,
                        int remap_special_chars);
 extern int CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon,
-                       const FILE_BASIC_INFO * data, __u16 fid);
+                       const FILE_BASIC_INFO *data, __u16 fid);
 #if 0
 extern int CIFSSMBSetAttrLegacy(int xid, struct cifsTconInfo *tcon,
                        char *fileName, __u16 dos_attributes,
index 9409524e4bf88e5634ebbc94c2a1b30e7df38aeb..30bbe448e260fa931a2a36098057bfdd8364fad3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *   fs/cifs/cifssmb.c
  *
- *   Copyright (C) International Business Machines  Corp., 2002,2007
+ *   Copyright (C) International Business Machines  Corp., 2002,2008
  *   Author(s): Steve French (sfrench@us.ibm.com)
  *
  *   Contains the routines for constructing the SMB PDUs themselves
@@ -102,10 +102,12 @@ static void mark_open_files_invalid(struct cifsTconInfo *pTcon)
           to this tcon */
 }
 
-/* If the return code is zero, this function must fill in request_buf pointer */
+/* Allocate and return pointer to an SMB request buffer, and set basic
+   SMB information in the SMB header.  If the return code is zero, this
+   function must have filled in request_buf pointer */
 static int
 small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
-        void **request_buf /* returned */)
+               void **request_buf)
 {
        int rc = 0;
 
@@ -363,7 +365,7 @@ smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
                *response_buf = *request_buf;
 
        header_assemble((struct smb_hdr *) *request_buf, smb_command, tcon,
-                       wct /*wct */ );
+                       wct);
 
        if (tcon != NULL)
                cifs_stats_inc(&tcon->num_smbs_sent);
@@ -523,7 +525,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
                        if (remain >= (MIN_TZ_ADJ / 2))
                                result += MIN_TZ_ADJ;
                        if (val < 0)
-                               result = - result;
+                               result = -result;
                        server->timeAdj = result;
                } else {
                        server->timeAdj = (int)tmp;
@@ -600,7 +602,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
        server->maxBuf = min(le32_to_cpu(pSMBr->MaxBufferSize),
                        (__u32) CIFSMaxBufSize + MAX_CIFS_HDR_SIZE);
        server->maxRw = le32_to_cpu(pSMBr->MaxRawSize);
-       cFYI(0, ("Max buf = %d", ses->server->maxBuf));
+       cFYI(DBG2, ("Max buf = %d", ses->server->maxBuf));
        GETU32(ses->server->sessid) = le32_to_cpu(pSMBr->SessionKey);
        server->capabilities = le32_to_cpu(pSMBr->Capabilities);
        server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone);
@@ -868,9 +870,8 @@ PsxDelete:
        pSMB->ByteCount = cpu_to_le16(byte_count);
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Posix delete returned %d", rc));
-       }
        cifs_buf_release(pSMB);
 
        cifs_stats_inc(&tcon->num_deletes);
@@ -916,9 +917,8 @@ DelFileRetry:
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
        cifs_stats_inc(&tcon->num_deletes);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Error in RMFile = %d", rc));
-       }
 
        cifs_buf_release(pSMB);
        if (rc == -EAGAIN)
@@ -961,9 +961,8 @@ RmDirRetry:
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
        cifs_stats_inc(&tcon->num_rmdirs);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Error in RMDir = %d", rc));
-       }
 
        cifs_buf_release(pSMB);
        if (rc == -EAGAIN)
@@ -1005,9 +1004,8 @@ MkDirRetry:
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
        cifs_stats_inc(&tcon->num_mkdirs);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Error in Mkdir = %d", rc));
-       }
 
        cifs_buf_release(pSMB);
        if (rc == -EAGAIN)
@@ -1017,7 +1015,7 @@ MkDirRetry:
 
 int
 CIFSPOSIXCreate(const int xid, struct cifsTconInfo *tcon, __u32 posix_flags,
-               __u64 mode, __u16 * netfid, FILE_UNIX_BASIC_INFO *pRetData,
+               __u64 mode, __u16 *netfid, FILE_UNIX_BASIC_INFO *pRetData,
                __u32 *pOplock, const char *name,
                const struct nls_table *nls_codepage, int remap)
 {
@@ -1027,8 +1025,8 @@ CIFSPOSIXCreate(const int xid, struct cifsTconInfo *tcon, __u32 posix_flags,
        int rc = 0;
        int bytes_returned = 0;
        __u16 params, param_offset, offset, byte_count, count;
-       OPEN_PSX_REQ * pdata;
-       OPEN_PSX_RSP * psx_rsp;
+       OPEN_PSX_REQ *pdata;
+       OPEN_PSX_RSP *psx_rsp;
 
        cFYI(1, ("In POSIX Create"));
 PsxCreat:
@@ -1110,9 +1108,7 @@ PsxCreat:
        /* check to make sure response data is there */
        if (psx_rsp->ReturnedLevel != cpu_to_le16(SMB_QUERY_FILE_UNIX_BASIC)) {
                pRetData->Type = cpu_to_le32(-1); /* unknown */
-#ifdef CONFIG_CIFS_DEBUG2
-               cFYI(1, ("unknown type"));
-#endif
+               cFYI(DBG2, ("unknown type"));
        } else {
                if (pSMBr->ByteCount < sizeof(OPEN_PSX_RSP)
                                        + sizeof(FILE_UNIX_BASIC_INFO)) {
@@ -1169,8 +1165,8 @@ static __u16 convert_disposition(int disposition)
 int
 SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon,
            const char *fileName, const int openDisposition,
-           const int access_flags, const int create_options, __u16 * netfid,
-           int *pOplock, FILE_ALL_INFO * pfile_info,
+           const int access_flags, const int create_options, __u16 *netfid,
+           int *pOplock, FILE_ALL_INFO *pfile_info,
            const struct nls_table *nls_codepage, int remap)
 {
        int rc = -EACCES;
@@ -1221,8 +1217,8 @@ OldOpenRetry:
 
        if (create_options & CREATE_OPTION_SPECIAL)
                pSMB->FileAttributes = cpu_to_le16(ATTR_SYSTEM);
-       else
-                pSMB->FileAttributes = cpu_to_le16(0/*ATTR_NORMAL*/); /* BB FIXME */
+       else /* BB FIXME BB */
+               pSMB->FileAttributes = cpu_to_le16(0/*ATTR_NORMAL*/);
 
        /* if ((omode & S_IWUGO) == 0)
                pSMB->FileAttributes |= cpu_to_le32(ATTR_READONLY);*/
@@ -1284,8 +1280,8 @@ OldOpenRetry:
 int
 CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon,
            const char *fileName, const int openDisposition,
-           const int access_flags, const int create_options, __u16 * netfid,
-           int *pOplock, FILE_ALL_INFO * pfile_info,
+           const int access_flags, const int create_options, __u16 *netfid,
+           int *pOplock, FILE_ALL_INFO *pfile_info,
            const struct nls_table *nls_codepage, int remap)
 {
        int rc = -EACCES;
@@ -1556,9 +1552,9 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon,
        } /* else setting file size with write of zero bytes */
        if (wct == 14)
                byte_count = bytes_sent + 1; /* pad */
-       else /* wct == 12 */ {
+       else /* wct == 12 */
                byte_count = bytes_sent + 5; /* bigger pad, smaller smb hdr */
-       }
+
        pSMB->DataLengthLow = cpu_to_le16(bytes_sent & 0xFFFF);
        pSMB->DataLengthHigh = cpu_to_le16(bytes_sent >> 16);
        pSMB->hdr.smb_buf_length += byte_count;
@@ -1663,7 +1659,7 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon,
                rc = -EIO;
                *nbytes = 0;
        } else {
-               WRITE_RSP * pSMBr = (WRITE_RSP *)iov[0].iov_base;
+               WRITE_RSP *pSMBr = (WRITE_RSP *)iov[0].iov_base;
                *nbytes = le16_to_cpu(pSMBr->CountHigh);
                *nbytes = (*nbytes) << 16;
                *nbytes += le16_to_cpu(pSMBr->Count);
@@ -1744,9 +1740,8 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
                /* SMB buffer freed by function above */
        }
        cifs_stats_inc(&tcon->num_locks);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Send error in Lock = %d", rc));
-       }
 
        /* Note: On -EAGAIN error only caller can retry on handle based calls
        since file handle passed in no longer valid */
@@ -1791,7 +1786,7 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
 
        count = sizeof(struct cifs_posix_lock);
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB PDU from sess */
+       pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */
        pSMB->SetupCount = 1;
        pSMB->Reserved3 = 0;
        if (get_flag)
@@ -1972,9 +1967,8 @@ renameRetry:
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
        cifs_stats_inc(&tcon->num_renames);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Send error in rename = %d", rc));
-       }
 
        cifs_buf_release(pSMB);
 
@@ -2016,7 +2010,7 @@ int CIFSSMBRenameOpenFile(const int xid, struct cifsTconInfo *pTcon,
        data_offset = (char *) (&pSMB->hdr.Protocol) + offset;
        rename_info = (struct set_file_rename *) data_offset;
        pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB PDU from sess */
+       pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */
        pSMB->SetupCount = 1;
        pSMB->Reserved3 = 0;
        pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION);
@@ -2052,9 +2046,8 @@ int CIFSSMBRenameOpenFile(const int xid, struct cifsTconInfo *pTcon,
        rc = SendReceive(xid, pTcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
        cifs_stats_inc(&pTcon->num_t2renames);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Send error in Rename (by file handle) = %d", rc));
-       }
 
        cifs_buf_release(pSMB);
 
@@ -2211,9 +2204,8 @@ createSymLinkRetry:
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
        cifs_stats_inc(&tcon->num_symlinks);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Send error in SetPathInfo create symlink = %d", rc));
-       }
 
        if (pSMB)
                cifs_buf_release(pSMB);
@@ -2299,9 +2291,8 @@ createHardLinkRetry:
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
        cifs_stats_inc(&tcon->num_hardlinks);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Send error in SetPathInfo (hard link) = %d", rc));
-       }
 
        cifs_buf_release(pSMB);
        if (rc == -EAGAIN)
@@ -2370,9 +2361,9 @@ winCreateHardLinkRetry:
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
        cifs_stats_inc(&tcon->num_hardlinks);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Send error in hard link (NT rename) = %d", rc));
-       }
+
        cifs_buf_release(pSMB);
        if (rc == -EAGAIN)
                goto winCreateHardLinkRetry;
@@ -2968,9 +2959,8 @@ setAclRetry:
        pSMB->ByteCount = cpu_to_le16(byte_count);
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Set POSIX ACL returned %d", rc));
-       }
 
 setACLerrorExit:
        cifs_buf_release(pSMB);
@@ -2982,7 +2972,7 @@ setACLerrorExit:
 /* BB fix tabs in this function FIXME BB */
 int
 CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon,
-              const int netfid, __u64 * pExtAttrBits, __u64 *pMask)
+              const int netfid, __u64 *pExtAttrBits, __u64 *pMask)
 {
        int rc = 0;
        struct smb_t2_qfi_req *pSMB = NULL;
@@ -3000,7 +2990,7 @@ GetExtAttrRetry:
        if (rc)
                return rc;
 
-       params = 2 /* level */ +2 /* fid */;
+       params = 2 /* level */ + 2 /* fid */;
        pSMB->t2.TotalDataCount = 0;
        pSMB->t2.MaxParameterCount = cpu_to_le16(4);
        /* BB find exact max data count below from sess structure BB */
@@ -3071,7 +3061,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
 {
        int rc = 0;
        int buf_type = 0;
-       QUERY_SEC_DESC_REQ * pSMB;
+       QUERY_SEC_DESC_REQ *pSMB;
        struct kvec iov[1];
 
        cFYI(1, ("GetCifsACL"));
@@ -3101,7 +3091,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
        if (rc) {
                cFYI(1, ("Send error in QuerySecDesc = %d", rc));
        } else {                /* decode response */
-               __le32 * parm;
+               __le32 *parm;
                __u32 parm_len;
                __u32 acl_len;
                struct smb_com_ntransact_rsp *pSMBr;
@@ -3230,8 +3220,8 @@ int SMBQueryInformation(const int xid, struct cifsTconInfo *tcon,
                        FILE_ALL_INFO *pFinfo,
                        const struct nls_table *nls_codepage, int remap)
 {
-       QUERY_INFORMATION_REQ * pSMB;
-       QUERY_INFORMATION_RSP * pSMBr;
+       QUERY_INFORMATION_REQ *pSMB;
+       QUERY_INFORMATION_RSP *pSMBr;
        int rc = 0;
        int bytes_returned;
        int name_len;
@@ -3263,9 +3253,11 @@ QInfRetry:
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
        if (rc) {
                cFYI(1, ("Send error in QueryInfo = %d", rc));
-       } else if (pFinfo) {            /* decode response */
+       } else if (pFinfo) {
                struct timespec ts;
                __u32 time = le32_to_cpu(pSMBr->last_write_time);
+
+               /* decode response */
                /* BB FIXME - add time zone adjustment BB */
                memset(pFinfo, 0, sizeof(FILE_ALL_INFO));
                ts.tv_nsec = 0;
@@ -3296,7 +3288,7 @@ QInfRetry:
 int
 CIFSSMBQPathInfo(const int xid, struct cifsTconInfo *tcon,
                 const unsigned char *searchName,
-                FILE_ALL_INFO * pFindData,
+                FILE_ALL_INFO *pFindData,
                 int legacy /* old style infolevel */,
                 const struct nls_table *nls_codepage, int remap)
 {
@@ -3371,10 +3363,12 @@ QPathInfoRetry:
                else if (pFindData) {
                        int size;
                        __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset);
-                       if (legacy) /* we do not read the last field, EAsize,
-                                      fortunately since it varies by subdialect
-                                      and on Set vs. Get, is two bytes or 4
-                                      bytes depending but we don't care here */
+
+                       /* On legacy responses we do not read the last field,
+                       EAsize, fortunately since it varies by subdialect and
+                       also note it differs on Set vs. Get, ie two bytes or 4
+                       bytes depending but we don't care here */
+                       if (legacy)
                                size = sizeof(FILE_INFO_STANDARD);
                        else
                                size = sizeof(FILE_ALL_INFO);
@@ -3476,85 +3470,6 @@ UnixQPathInfoRetry:
        return rc;
 }
 
-#if 0  /* function unused at present */
-int CIFSFindSingle(const int xid, struct cifsTconInfo *tcon,
-              const char *searchName, FILE_ALL_INFO * findData,
-              const struct nls_table *nls_codepage)
-{
-/* level 257 SMB_ */
-       TRANSACTION2_FFIRST_REQ *pSMB = NULL;
-       TRANSACTION2_FFIRST_RSP *pSMBr = NULL;
-       int rc = 0;
-       int bytes_returned;
-       int name_len;
-       __u16 params, byte_count;
-
-       cFYI(1, ("In FindUnique"));
-findUniqueRetry:
-       rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
-                     (void **) &pSMBr);
-       if (rc)
-               return rc;
-
-       if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
-               name_len =
-                   cifsConvertToUCS((__le16 *) pSMB->FileName, searchName,
-                                    PATH_MAX, nls_codepage);
-               name_len++;     /* trailing null */
-               name_len *= 2;
-       } else {        /* BB improve the check for buffer overruns BB */
-               name_len = strnlen(searchName, PATH_MAX);
-               name_len++;     /* trailing null */
-               strncpy(pSMB->FileName, searchName, name_len);
-       }
-
-       params = 12 + name_len /* includes null */ ;
-       pSMB->TotalDataCount = 0;       /* no EAs */
-       pSMB->MaxParameterCount = cpu_to_le16(2);
-       pSMB->MaxDataCount = cpu_to_le16(4000); /* BB find exact max SMB PDU from sess structure BB */
-       pSMB->MaxSetupCount = 0;
-       pSMB->Reserved = 0;
-       pSMB->Flags = 0;
-       pSMB->Timeout = 0;
-       pSMB->Reserved2 = 0;
-       pSMB->ParameterOffset = cpu_to_le16(
-        offsetof(struct smb_com_transaction2_ffirst_req, InformationLevel)-4);
-       pSMB->DataCount = 0;
-       pSMB->DataOffset = 0;
-       pSMB->SetupCount = 1;   /* one byte, no need to le convert */
-       pSMB->Reserved3 = 0;
-       pSMB->SubCommand = cpu_to_le16(TRANS2_FIND_FIRST);
-       byte_count = params + 1 /* pad */ ;
-       pSMB->TotalParameterCount = cpu_to_le16(params);
-       pSMB->ParameterCount = pSMB->TotalParameterCount;
-       pSMB->SearchAttributes =
-           cpu_to_le16(ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM |
-                       ATTR_DIRECTORY);
-       pSMB->SearchCount = cpu_to_le16(16);    /* BB increase */
-       pSMB->SearchFlags = cpu_to_le16(1);
-       pSMB->InformationLevel = cpu_to_le16(SMB_FIND_FILE_DIRECTORY_INFO);
-       pSMB->SearchStorageType = 0;    /* BB what should we set this to? BB */
-       pSMB->hdr.smb_buf_length += byte_count;
-       pSMB->ByteCount = cpu_to_le16(byte_count);
-
-       rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
-                        (struct smb_hdr *) pSMBr, &bytes_returned, 0);
-
-       if (rc) {
-               cFYI(1, ("Send error in FindFileDirInfo = %d", rc));
-       } else {                /* decode response */
-               cifs_stats_inc(&tcon->num_ffirst);
-               /* BB fill in */
-       }
-
-       cifs_buf_release(pSMB);
-       if (rc == -EAGAIN)
-               goto findUniqueRetry;
-
-       return rc;
-}
-#endif /* end unused (temporarily) function */
-
 /* xid, tcon, searchName and codepage are input parms, rest are returned */
 int
 CIFSFindFirst(const int xid, struct cifsTconInfo *tcon,
@@ -3566,7 +3481,7 @@ CIFSFindFirst(const int xid, struct cifsTconInfo *tcon,
 /* level 257 SMB_ */
        TRANSACTION2_FFIRST_REQ *pSMB = NULL;
        TRANSACTION2_FFIRST_RSP *pSMBr = NULL;
-       T2_FFIRST_RSP_PARMS * parms;
+       T2_FFIRST_RSP_PARMS *parms;
        int rc = 0;
        int bytes_returned = 0;
        int name_len;
@@ -3697,7 +3612,7 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon,
 {
        TRANSACTION2_FNEXT_REQ *pSMB = NULL;
        TRANSACTION2_FNEXT_RSP *pSMBr = NULL;
-       T2_FNEXT_RSP_PARMS * parms;
+       T2_FNEXT_RSP_PARMS *parms;
        char *response_data;
        int rc = 0;
        int bytes_returned, name_len;
@@ -3836,9 +3751,9 @@ CIFSFindClose(const int xid, struct cifsTconInfo *tcon,
        pSMB->FileID = searchHandle;
        pSMB->ByteCount = 0;
        rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0);
-       if (rc) {
+       if (rc)
                cERROR(1, ("Send error in FindClose = %d", rc));
-       }
+
        cifs_stats_inc(&tcon->num_fclose);
 
        /* Since session is dead, search handle closed on server already */
@@ -3851,7 +3766,7 @@ CIFSFindClose(const int xid, struct cifsTconInfo *tcon,
 int
 CIFSGetSrvInodeNumber(const int xid, struct cifsTconInfo *tcon,
                      const unsigned char *searchName,
-                     __u64 * inode_number,
+                     __u64 *inode_number,
                      const struct nls_table *nls_codepage, int remap)
 {
        int rc = 0;
@@ -4560,9 +4475,8 @@ SETFSUnixRetry:
                cERROR(1, ("Send error in SETFSUnixInfo = %d", rc));
        } else {                /* decode response */
                rc = validate_t2((struct smb_t2_rsp *)pSMBr);
-               if (rc) {
+               if (rc)
                        rc = -EIO;      /* bad smb */
-               }
        }
        cifs_buf_release(pSMB);
 
@@ -4744,9 +4658,8 @@ SetEOFRetry:
        pSMB->ByteCount = cpu_to_le16(byte_count);
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
-       if (rc) {
+       if (rc)
                cFYI(1, ("SetPathInfo (file size) returned %d", rc));
-       }
 
        cifs_buf_release(pSMB);
 
@@ -4897,9 +4810,8 @@ CIFSSMBSetFileTimes(const int xid, struct cifsTconInfo *tcon,
        pSMB->ByteCount = cpu_to_le16(byte_count);
        memcpy(data_offset, data, sizeof(FILE_BASIC_INFO));
        rc = SendReceiveNoRsp(xid, tcon->ses, (struct smb_hdr *) pSMB, 0);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Send error in Set Time (SetFileInfo) = %d", rc));
-       }
 
        /* Note: On -EAGAIN error only caller can retry on handle based calls
                since file handle passed in no longer valid */
@@ -4975,9 +4887,8 @@ SetTimesRetry:
        pSMB->ByteCount = cpu_to_le16(byte_count);
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
-       if (rc) {
+       if (rc)
                cFYI(1, ("SetPathInfo (times) returned %d", rc));
-       }
 
        cifs_buf_release(pSMB);
 
@@ -5027,9 +4938,8 @@ SetAttrLgcyRetry:
        pSMB->ByteCount = cpu_to_le16(name_len + 1);
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
-       if (rc) {
+       if (rc)
                cFYI(1, ("Error in LegacySetAttr = %d", rc));
-       }
 
        cifs_buf_release(pSMB);
 
@@ -5138,9 +5048,8 @@ setPermsRetry:
        pSMB->ByteCount = cpu_to_le16(byte_count);
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
-       if (rc) {
+       if (rc)
                cFYI(1, ("SetPathInfo (perms) returned %d", rc));
-       }
 
        if (pSMB)
                cifs_buf_release(pSMB);
@@ -5615,9 +5524,8 @@ SetEARetry:
        pSMB->ByteCount = cpu_to_le16(byte_count);
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
                         (struct smb_hdr *) pSMBr, &bytes_returned, 0);
-       if (rc) {
+       if (rc)
                cFYI(1, ("SetPathInfo (EA) returned %d", rc));
-       }
 
        cifs_buf_release(pSMB);
 
index 65d0ba72e78f1e304af44941c74a4a1f9adb2a5d..8dbfa97cd18ca6ae60ba6621e8e9214cb7a1641d 100644 (file)
@@ -1722,8 +1722,15 @@ void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon,
                           originally at mount time */
                        if ((saved_cap & CIFS_UNIX_POSIX_ACL_CAP) == 0)
                                cap &= ~CIFS_UNIX_POSIX_ACL_CAP;
-                       if ((saved_cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0)
+                       if ((saved_cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) {
+                               if (cap & CIFS_UNIX_POSIX_PATHNAMES_CAP)
+                                       cERROR(1, ("POSIXPATH support change"));
                                cap &= ~CIFS_UNIX_POSIX_PATHNAMES_CAP;
+                       } else if ((cap & CIFS_UNIX_POSIX_PATHNAMES_CAP) == 0) {
+                               cERROR(1, ("possible reconnect error"));
+                               cERROR(1,
+                                       ("server disabled POSIX path support"));
+                       }
                }
 
                cap &= CIFS_UNIX_CAP_MASK;
@@ -1753,9 +1760,8 @@ void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon,
                if (sb && (CIFS_SB(sb)->rsize > 127 * 1024)) {
                        if ((cap & CIFS_UNIX_LARGE_READ_CAP) == 0) {
                                CIFS_SB(sb)->rsize = 127 * 1024;
-#ifdef CONFIG_CIFS_DEBUG2
-                               cFYI(1, ("larger reads not supported by srv"));
-#endif
+                               cFYI(DBG2,
+                                       ("larger reads not supported by srv"));
                        }
                }
 
@@ -1792,6 +1798,26 @@ void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon,
        }
 }
 
+static void
+convert_delimiter(char *path, char delim)
+{
+       int i;
+       char old_delim;
+
+       if (path == NULL)
+               return;
+
+       if (delim == '/') 
+               old_delim = '\\';
+       else
+               old_delim = '/';
+
+       for (i = 0; path[i] != '\0'; i++) {
+               if (path[i] == old_delim)
+                       path[i] = delim;
+       }
+}
+
 int
 cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
           char *mount_data, const char *devname)
@@ -2057,7 +2083,11 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                cifs_sb->prepath = volume_info.prepath;
                if (cifs_sb->prepath) {
                        cifs_sb->prepathlen = strlen(cifs_sb->prepath);
-                       cifs_sb->prepath[0] = CIFS_DIR_SEP(cifs_sb);
+                       /* we can not convert the / to \ in the path
+                       separators in the prefixpath yet because we do not
+                       know (until reset_cifs_unix_caps is called later)
+                       whether POSIX PATH CAP is available. We normalize
+                       the / to \ after reset_cifs_unix_caps is called */
                        volume_info.prepath = NULL;
                } else
                        cifs_sb->prepathlen = 0;
@@ -2225,11 +2255,15 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                else
                        tcon->unix_ext = 0; /* server does not support them */
 
+               /* convert forward to back slashes in prepath here if needed */
+               if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) == 0)
+                       convert_delimiter(cifs_sb->prepath,
+                                         CIFS_DIR_SEP(cifs_sb));
+
                if ((tcon->unix_ext == 0) && (cifs_sb->rsize > (1024 * 127))) {
                        cifs_sb->rsize = 1024 * 127;
-#ifdef CONFIG_CIFS_DEBUG2
-                       cFYI(1, ("no very large read support, rsize now 127K"));
-#endif
+                       cFYI(DBG2,
+                               ("no very large read support, rsize now 127K"));
                }
                if (!(tcon->ses->capabilities & CAP_LARGE_WRITE_X))
                        cifs_sb->wsize = min(cifs_sb->wsize,
index 699ec11984099bf432cfb44bd780235623321ff4..4e83b47c4b34328c35f9d49fc042440e35623fc6 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   vfs operations that deal with dentries
  *
- *   Copyright (C) International Business Machines  Corp., 2002,2007
+ *   Copyright (C) International Business Machines  Corp., 2002,2008
  *   Author(s): Steve French (sfrench@us.ibm.com)
  *
  *   This library is free software; you can redistribute it and/or modify
@@ -111,16 +111,6 @@ cifs_bp_rename_retry:
        return full_path;
 }
 
-/* char * build_wildcard_path_from_dentry(struct dentry *direntry)
-{
-       if(full_path == NULL)
-               return full_path;
-
-       full_path[namelen] = '\\';
-       full_path[namelen+1] = '*';
-       full_path[namelen+2] = 0;
-BB remove above eight lines BB */
-
 /* Inode operations in similar order to how they appear in Linux file fs.h */
 
 int
@@ -171,9 +161,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
                        disposition = FILE_OVERWRITE_IF;
                else if ((oflags & O_CREAT) == O_CREAT)
                        disposition = FILE_OPEN_IF;
-               else {
+               else
                        cFYI(1, ("Create flag not set in create function"));
-               }
        }
 
        /* BB add processing to set equivalent of mode - e.g. via CreateX with
@@ -367,7 +356,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
                if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
                        int oplock = 0;
                        u16 fileHandle;
-                       FILE_ALL_INFO * buf;
+                       FILE_ALL_INFO *buf;
 
                        cFYI(1, ("sfu compat create special file"));
 
@@ -534,9 +523,8 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
        int isValid = 1;
 
        if (direntry->d_inode) {
-               if (cifs_revalidate(direntry)) {
+               if (cifs_revalidate(direntry))
                        return 0;
-               }
        } else {
                cFYI(1, ("neg dentry 0x%p name = %s",
                         direntry, direntry->d_name.name));
index 073fdc3db41950ba15c022deda18bc00ac4718de..966e9288930be75bc9d952cde2960ef3191db212 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *   fs/cifs/dns_resolve.h -- DNS Resolver upcall management for CIFS DFS
  *                            Handles host name to IP address resolution
- * 
+ *
  *   Copyright (c) International Business Machines  Corp., 2008
  *   Author(s): Steve French (sfrench@us.ibm.com)
  *
index 995474c90885c6dab51e2d4e0b86be6fa23d87bb..7d1d5aa4c430b6c904c08a5c65c8be32ba0a0298 100644 (file)
@@ -35,9 +35,8 @@ static __u32 convert_to_cifs_notify_flags(unsigned long fcntl_notify_flags)
 
        /* No way on Linux VFS to ask to monitor xattr
        changes (and no stream support either */
-       if (fcntl_notify_flags & DN_ACCESS) {
+       if (fcntl_notify_flags & DN_ACCESS)
                cifs_ntfy_flags |= FILE_NOTIFY_CHANGE_LAST_ACCESS;
-       }
        if (fcntl_notify_flags & DN_MODIFY) {
                /* What does this mean on directories? */
                cifs_ntfy_flags |= FILE_NOTIFY_CHANGE_LAST_WRITE |
@@ -47,9 +46,8 @@ static __u32 convert_to_cifs_notify_flags(unsigned long fcntl_notify_flags)
                cifs_ntfy_flags |= FILE_NOTIFY_CHANGE_CREATION |
                        FILE_NOTIFY_CHANGE_LAST_WRITE;
        }
-       if (fcntl_notify_flags & DN_DELETE) {
+       if (fcntl_notify_flags & DN_DELETE)
                cifs_ntfy_flags |= FILE_NOTIFY_CHANGE_LAST_WRITE;
-       }
        if (fcntl_notify_flags & DN_RENAME) {
                /* BB review this - checking various server behaviors */
                cifs_ntfy_flags |= FILE_NOTIFY_CHANGE_DIR_NAME |
index 5f7c374ae89c7b833f45f4a9cdeda5ef006bdc0c..fa849c91d323e605b7696a1592288054ae068ccb 100644 (file)
@@ -353,9 +353,9 @@ static int cifs_reopen_file(struct file *file, int can_flush)
        int disposition = FILE_OPEN;
        __u16 netfid;
 
-       if (file->private_data) {
+       if (file->private_data)
                pCifsFile = (struct cifsFileInfo *)file->private_data;
-       else
+       else
                return -EBADF;
 
        xid = GetXid();
@@ -499,9 +499,8 @@ int cifs_close(struct inode *inode, struct file *file)
                                        the struct would be in each open file,
                                        but this should give enough time to
                                        clear the socket */
-#ifdef CONFIG_CIFS_DEBUG2
-                                       cFYI(1, ("close delay, write pending"));
-#endif /* DEBUG2 */
+                                       cFYI(DBG2,
+                                               ("close delay, write pending"));
                                        msleep(timeout);
                                        timeout *= 4;
                                }
@@ -1423,9 +1422,8 @@ static int cifs_writepage(struct page *page, struct writeback_control *wbc)
        xid = GetXid();
 /* BB add check for wbc flags */
        page_cache_get(page);
-       if (!PageUptodate(page)) {
+       if (!PageUptodate(page))
                cFYI(1, ("ppw - page not up to date"));
-       }
 
        /*
         * Set the "writeback" flag, and clear "dirty" in the radix tree.
@@ -1460,9 +1458,9 @@ static int cifs_commit_write(struct file *file, struct page *page,
        cFYI(1, ("commit write for page %p up to position %lld for %d",
                 page, position, to));
        spin_lock(&inode->i_lock);
-       if (position > inode->i_size) {
+       if (position > inode->i_size)
                i_size_write(inode, position);
-       }
+
        spin_unlock(&inode->i_lock);
        if (!PageUptodate(page)) {
                position =  ((loff_t)page->index << PAGE_CACHE_SHIFT) + offset;
@@ -1596,9 +1594,9 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
        }
        open_file = (struct cifsFileInfo *)file->private_data;
 
-       if ((file->f_flags & O_ACCMODE) == O_WRONLY) {
+       if ((file->f_flags & O_ACCMODE) == O_WRONLY)
                cFYI(1, ("attempting read on write only file instance"));
-       }
+
        for (total_read = 0, current_offset = read_data;
             read_size > total_read;
             total_read += bytes_read, current_offset += bytes_read) {
@@ -1625,9 +1623,8 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
                                                smb_read_data +
                                                4 /* RFC1001 length field */ +
                                                le16_to_cpu(pSMBr->DataOffset),
-                                               bytes_read)) {
+                                               bytes_read))
                                        rc = -EFAULT;
-                               }
 
                                if (buf_type == CIFS_SMALL_BUFFER)
                                        cifs_small_buf_release(smb_read_data);
@@ -1814,9 +1811,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
        pTcon = cifs_sb->tcon;
 
        pagevec_init(&lru_pvec, 0);
-#ifdef CONFIG_CIFS_DEBUG2
-               cFYI(1, ("rpages: num pages %d", num_pages));
-#endif
+               cFYI(DBG2, ("rpages: num pages %d", num_pages));
        for (i = 0; i < num_pages; ) {
                unsigned contig_pages;
                struct page *tmp_page;
@@ -1849,10 +1844,8 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
                /* Read size needs to be in multiples of one page */
                read_size = min_t(const unsigned int, read_size,
                                  cifs_sb->rsize & PAGE_CACHE_MASK);
-#ifdef CONFIG_CIFS_DEBUG2
-               cFYI(1, ("rpages: read size 0x%x  contiguous pages %d",
+               cFYI(DBG2, ("rpages: read size 0x%x  contiguous pages %d",
                                read_size, contig_pages));
-#endif
                rc = -EAGAIN;
                while (rc == -EAGAIN) {
                        if ((open_file->invalidHandle) &&
@@ -2026,7 +2019,7 @@ int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file)
                struct cifs_sb_info *cifs_sb;
 
                cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb);
-               if ( cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO ) {
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) {
                        /* since no page cache to corrupt on directio
                        we can change size safely */
                        return 1;
index b1a4a65eaa08e0b24f1c1daf83700113f38a742b..24eb4d392155b8d4482e7ff94f369c0a8c3a035d 100644 (file)
 #include "cifs_debug.h"
 #include "cifs_fs_sb.h"
 
+
+static void cifs_set_ops(struct inode *inode)
+{
+       struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
+
+       switch (inode->i_mode & S_IFMT) {
+       case S_IFREG:
+               inode->i_op = &cifs_file_inode_ops;
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) {
+                       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
+                               inode->i_fop = &cifs_file_direct_nobrl_ops;
+                       else
+                               inode->i_fop = &cifs_file_direct_ops;
+               } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
+                       inode->i_fop = &cifs_file_nobrl_ops;
+               else { /* not direct, send byte range locks */
+                       inode->i_fop = &cifs_file_ops;
+               }
+
+
+               /* check if server can support readpages */
+               if (cifs_sb->tcon->ses->server->maxBuf <
+                               PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE)
+                       inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
+               else
+                       inode->i_data.a_ops = &cifs_addr_ops;
+               break;
+       case S_IFDIR:
+               inode->i_op = &cifs_dir_inode_ops;
+               inode->i_fop = &cifs_dir_ops;
+               break;
+       case S_IFLNK:
+               inode->i_op = &cifs_symlink_inode_ops;
+               break;
+       default:
+               init_special_inode(inode, inode->i_mode, inode->i_rdev);
+               break;
+       }
+}
+
+static void cifs_unix_info_to_inode(struct inode *inode,
+               FILE_UNIX_BASIC_INFO *info, int force_uid_gid)
+{
+       struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
+       struct cifsInodeInfo *cifsInfo = CIFS_I(inode);
+       __u64 num_of_bytes = le64_to_cpu(info->NumOfBytes);
+       __u64 end_of_file = le64_to_cpu(info->EndOfFile);
+
+       inode->i_atime = cifs_NTtimeToUnix(le64_to_cpu(info->LastAccessTime));
+       inode->i_mtime =
+               cifs_NTtimeToUnix(le64_to_cpu(info->LastModificationTime));
+       inode->i_ctime = cifs_NTtimeToUnix(le64_to_cpu(info->LastStatusChange));
+       inode->i_mode = le64_to_cpu(info->Permissions);
+
+       /*
+        * Since we set the inode type below we need to mask off
+        * to avoid strange results if bits set above.
+        */
+       inode->i_mode &= ~S_IFMT;
+       switch (le32_to_cpu(info->Type)) {
+       case UNIX_FILE:
+               inode->i_mode |= S_IFREG;
+               break;
+       case UNIX_SYMLINK:
+               inode->i_mode |= S_IFLNK;
+               break;
+       case UNIX_DIR:
+               inode->i_mode |= S_IFDIR;
+               break;
+       case UNIX_CHARDEV:
+               inode->i_mode |= S_IFCHR;
+               inode->i_rdev = MKDEV(le64_to_cpu(info->DevMajor),
+                                     le64_to_cpu(info->DevMinor) & MINORMASK);
+               break;
+       case UNIX_BLOCKDEV:
+               inode->i_mode |= S_IFBLK;
+               inode->i_rdev = MKDEV(le64_to_cpu(info->DevMajor),
+                                     le64_to_cpu(info->DevMinor) & MINORMASK);
+               break;
+       case UNIX_FIFO:
+               inode->i_mode |= S_IFIFO;
+               break;
+       case UNIX_SOCKET:
+               inode->i_mode |= S_IFSOCK;
+               break;
+       default:
+               /* safest to call it a file if we do not know */
+               inode->i_mode |= S_IFREG;
+               cFYI(1, ("unknown type %d", le32_to_cpu(info->Type)));
+               break;
+       }
+
+       if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) &&
+           !force_uid_gid)
+               inode->i_uid = cifs_sb->mnt_uid;
+       else
+               inode->i_uid = le64_to_cpu(info->Uid);
+
+       if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) &&
+           !force_uid_gid)
+               inode->i_gid = cifs_sb->mnt_gid;
+       else
+               inode->i_gid = le64_to_cpu(info->Gid);
+
+       inode->i_nlink = le64_to_cpu(info->Nlinks);
+
+       spin_lock(&inode->i_lock);
+       if (is_size_safe_to_change(cifsInfo, end_of_file)) {
+               /*
+                * We can not safely change the file size here if the client
+                * is writing to it due to potential races.
+                */
+               i_size_write(inode, end_of_file);
+
+               /*
+                * i_blocks is not related to (i_size / i_blksize),
+                * but instead 512 byte (2**9) size is required for
+                * calculating num blocks.
+                */
+               inode->i_blocks = (512 - 1 + num_of_bytes) >> 9;
+       }
+       spin_unlock(&inode->i_lock);
+}
+
 int cifs_get_inode_info_unix(struct inode **pinode,
        const unsigned char *search_path, struct super_block *sb, int xid)
 {
@@ -74,7 +198,6 @@ int cifs_get_inode_info_unix(struct inode **pinode,
                }
        } else {
                struct cifsInodeInfo *cifsInfo;
-               __u32 type = le32_to_cpu(findData.Type);
                __u64 num_of_bytes = le64_to_cpu(findData.NumOfBytes);
                __u64 end_of_file = le64_to_cpu(findData.EndOfFile);
 
@@ -105,112 +228,16 @@ int cifs_get_inode_info_unix(struct inode **pinode,
                /* this is ok to set on every inode revalidate */
                atomic_set(&cifsInfo->inUse, 1);
 
-               inode->i_atime =
-                   cifs_NTtimeToUnix(le64_to_cpu(findData.LastAccessTime));
-               inode->i_mtime =
-                   cifs_NTtimeToUnix(le64_to_cpu
-                               (findData.LastModificationTime));
-               inode->i_ctime =
-                   cifs_NTtimeToUnix(le64_to_cpu(findData.LastStatusChange));
-               inode->i_mode = le64_to_cpu(findData.Permissions);
-               /* since we set the inode type below we need to mask off
-                  to avoid strange results if bits set above */
-               inode->i_mode &= ~S_IFMT;
-               if (type == UNIX_FILE) {
-                       inode->i_mode |= S_IFREG;
-               } else if (type == UNIX_SYMLINK) {
-                       inode->i_mode |= S_IFLNK;
-               } else if (type == UNIX_DIR) {
-                       inode->i_mode |= S_IFDIR;
-               } else if (type == UNIX_CHARDEV) {
-                       inode->i_mode |= S_IFCHR;
-                       inode->i_rdev = MKDEV(le64_to_cpu(findData.DevMajor),
-                               le64_to_cpu(findData.DevMinor) & MINORMASK);
-               } else if (type == UNIX_BLOCKDEV) {
-                       inode->i_mode |= S_IFBLK;
-                       inode->i_rdev = MKDEV(le64_to_cpu(findData.DevMajor),
-                               le64_to_cpu(findData.DevMinor) & MINORMASK);
-               } else if (type == UNIX_FIFO) {
-                       inode->i_mode |= S_IFIFO;
-               } else if (type == UNIX_SOCKET) {
-                       inode->i_mode |= S_IFSOCK;
-               } else {
-                       /* safest to call it a file if we do not know */
-                       inode->i_mode |= S_IFREG;
-                       cFYI(1, ("unknown type %d", type));
-               }
+               cifs_unix_info_to_inode(inode, &findData, 0);
 
-               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID)
-                       inode->i_uid = cifs_sb->mnt_uid;
-               else
-                       inode->i_uid = le64_to_cpu(findData.Uid);
-
-               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID)
-                       inode->i_gid = cifs_sb->mnt_gid;
-               else
-                       inode->i_gid = le64_to_cpu(findData.Gid);
-
-               inode->i_nlink = le64_to_cpu(findData.Nlinks);
-
-               spin_lock(&inode->i_lock);
-               if (is_size_safe_to_change(cifsInfo, end_of_file)) {
-               /* can not safely change the file size here if the
-                  client is writing to it due to potential races */
-                       i_size_write(inode, end_of_file);
-
-               /* blksize needs to be multiple of two. So safer to default to
-               blksize and blkbits set in superblock so 2**blkbits and blksize
-               will match rather than setting to:
-               (pTcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE) & 0xFFFFFE00;*/
-
-               /* This seems incredibly stupid but it turns out that i_blocks
-                  is not related to (i_size / i_blksize), instead 512 byte size
-                  is required for calculating num blocks */
-
-               /* 512 bytes (2**9) is the fake blocksize that must be used */
-               /* for this calculation */
-                       inode->i_blocks = (512 - 1 + num_of_bytes) >> 9;
-               }
-               spin_unlock(&inode->i_lock);
 
                if (num_of_bytes < end_of_file)
                        cFYI(1, ("allocation size less than end of file"));
                cFYI(1, ("Size %ld and blocks %llu",
                        (unsigned long) inode->i_size,
                        (unsigned long long)inode->i_blocks));
-               if (S_ISREG(inode->i_mode)) {
-                       cFYI(1, ("File inode"));
-                       inode->i_op = &cifs_file_inode_ops;
-                       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) {
-                               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
-                                       inode->i_fop =
-                                               &cifs_file_direct_nobrl_ops;
-                               else
-                                       inode->i_fop = &cifs_file_direct_ops;
-                       } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
-                               inode->i_fop = &cifs_file_nobrl_ops;
-                       else /* not direct, send byte range locks */
-                               inode->i_fop = &cifs_file_ops;
-
-                       /* check if server can support readpages */
-                       if (pTcon->ses->server->maxBuf <
-                           PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE)
-                               inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
-                       else
-                               inode->i_data.a_ops = &cifs_addr_ops;
-               } else if (S_ISDIR(inode->i_mode)) {
-                       cFYI(1, ("Directory inode"));
-                       inode->i_op = &cifs_dir_inode_ops;
-                       inode->i_fop = &cifs_dir_ops;
-               } else if (S_ISLNK(inode->i_mode)) {
-                       cFYI(1, ("Symbolic Link inode"));
-                       inode->i_op = &cifs_symlink_inode_ops;
-               /* tmp_inode->i_fop = */ /* do not need to set to anything */
-               } else {
-                       cFYI(1, ("Init special inode"));
-                       init_special_inode(inode, inode->i_mode,
-                                          inode->i_rdev);
-               }
+
+               cifs_set_ops(inode);
        }
        return rc;
 }
@@ -490,9 +517,9 @@ int cifs_get_inode_info(struct inode **pinode,
                        if (decode_sfu_inode(inode,
                                         le64_to_cpu(pfindData->EndOfFile),
                                         search_path,
-                                        cifs_sb, xid)) {
+                                        cifs_sb, xid))
                                cFYI(1, ("Unrecognized sfu inode type"));
-                       }
+
                        cFYI(1, ("sfu mode 0%o", inode->i_mode));
                } else {
                        inode->i_mode |= S_IFREG;
@@ -546,36 +573,7 @@ int cifs_get_inode_info(struct inode **pinode,
                        atomic_set(&cifsInfo->inUse, 1);
                }
 
-               if (S_ISREG(inode->i_mode)) {
-                       cFYI(1, ("File inode"));
-                       inode->i_op = &cifs_file_inode_ops;
-                       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) {
-                               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
-                                       inode->i_fop =
-                                               &cifs_file_direct_nobrl_ops;
-                               else
-                                       inode->i_fop = &cifs_file_direct_ops;
-                       } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
-                               inode->i_fop = &cifs_file_nobrl_ops;
-                       else /* not direct, send byte range locks */
-                               inode->i_fop = &cifs_file_ops;
-
-                       if (pTcon->ses->server->maxBuf <
-                            PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE)
-                               inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
-                       else
-                               inode->i_data.a_ops = &cifs_addr_ops;
-               } else if (S_ISDIR(inode->i_mode)) {
-                       cFYI(1, ("Directory inode"));
-                       inode->i_op = &cifs_dir_inode_ops;
-                       inode->i_fop = &cifs_dir_ops;
-               } else if (S_ISLNK(inode->i_mode)) {
-                       cFYI(1, ("Symbolic Link inode"));
-                       inode->i_op = &cifs_symlink_inode_ops;
-               } else {
-                       init_special_inode(inode, inode->i_mode,
-                                          inode->i_rdev);
-               }
+               cifs_set_ops(inode);
        }
        kfree(buf);
        return rc;
@@ -792,17 +790,12 @@ psx_del_no_retry:
 }
 
 static void posix_fill_in_inode(struct inode *tmp_inode,
-       FILE_UNIX_BASIC_INFO *pData, int *pobject_type, int isNewInode)
+       FILE_UNIX_BASIC_INFO *pData, int isNewInode)
 {
+       struct cifsInodeInfo *cifsInfo = CIFS_I(tmp_inode);
        loff_t local_size;
        struct timespec local_mtime;
 
-       struct cifsInodeInfo *cifsInfo = CIFS_I(tmp_inode);
-       struct cifs_sb_info *cifs_sb = CIFS_SB(tmp_inode->i_sb);
-
-       __u32 type = le32_to_cpu(pData->Type);
-       __u64 num_of_bytes = le64_to_cpu(pData->NumOfBytes);
-       __u64 end_of_file = le64_to_cpu(pData->EndOfFile);
        cifsInfo->time = jiffies;
        atomic_inc(&cifsInfo->inUse);
 
@@ -810,115 +803,27 @@ static void posix_fill_in_inode(struct inode *tmp_inode,
        local_mtime = tmp_inode->i_mtime;
        local_size  = tmp_inode->i_size;
 
-       tmp_inode->i_atime =
-           cifs_NTtimeToUnix(le64_to_cpu(pData->LastAccessTime));
-       tmp_inode->i_mtime =
-           cifs_NTtimeToUnix(le64_to_cpu(pData->LastModificationTime));
-       tmp_inode->i_ctime =
-           cifs_NTtimeToUnix(le64_to_cpu(pData->LastStatusChange));
-
-       tmp_inode->i_mode = le64_to_cpu(pData->Permissions);
-       /* since we set the inode type below we need to mask off type
-          to avoid strange results if bits above were corrupt */
-       tmp_inode->i_mode &= ~S_IFMT;
-       if (type == UNIX_FILE) {
-               *pobject_type = DT_REG;
-               tmp_inode->i_mode |= S_IFREG;
-       } else if (type == UNIX_SYMLINK) {
-               *pobject_type = DT_LNK;
-               tmp_inode->i_mode |= S_IFLNK;
-       } else if (type == UNIX_DIR) {
-               *pobject_type = DT_DIR;
-               tmp_inode->i_mode |= S_IFDIR;
-       } else if (type == UNIX_CHARDEV) {
-               *pobject_type = DT_CHR;
-               tmp_inode->i_mode |= S_IFCHR;
-               tmp_inode->i_rdev = MKDEV(le64_to_cpu(pData->DevMajor),
-                               le64_to_cpu(pData->DevMinor) & MINORMASK);
-       } else if (type == UNIX_BLOCKDEV) {
-               *pobject_type = DT_BLK;
-               tmp_inode->i_mode |= S_IFBLK;
-               tmp_inode->i_rdev = MKDEV(le64_to_cpu(pData->DevMajor),
-                               le64_to_cpu(pData->DevMinor) & MINORMASK);
-       } else if (type == UNIX_FIFO) {
-               *pobject_type = DT_FIFO;
-               tmp_inode->i_mode |= S_IFIFO;
-       } else if (type == UNIX_SOCKET) {
-               *pobject_type = DT_SOCK;
-               tmp_inode->i_mode |= S_IFSOCK;
-       } else {
-               /* safest to just call it a file */
-               *pobject_type = DT_REG;
-               tmp_inode->i_mode |= S_IFREG;
-               cFYI(1, ("unknown inode type %d", type));
-       }
-
-#ifdef CONFIG_CIFS_DEBUG2
-       cFYI(1, ("object type: %d", type));
-#endif
-       tmp_inode->i_uid = le64_to_cpu(pData->Uid);
-       tmp_inode->i_gid = le64_to_cpu(pData->Gid);
-       tmp_inode->i_nlink = le64_to_cpu(pData->Nlinks);
-
-       spin_lock(&tmp_inode->i_lock);
-       if (is_size_safe_to_change(cifsInfo, end_of_file)) {
-               /* can not safely change the file size here if the
-               client is writing to it due to potential races */
-               i_size_write(tmp_inode, end_of_file);
+       cifs_unix_info_to_inode(tmp_inode, pData, 1);
+       cifs_set_ops(tmp_inode);
 
-       /* 512 bytes (2**9) is the fake blocksize that must be used */
-       /* for this calculation, not the real blocksize */
-               tmp_inode->i_blocks = (512 - 1 + num_of_bytes) >> 9;
-       }
-       spin_unlock(&tmp_inode->i_lock);
-
-       if (S_ISREG(tmp_inode->i_mode)) {
-               cFYI(1, ("File inode"));
-               tmp_inode->i_op = &cifs_file_inode_ops;
-
-               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) {
-                       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
-                               tmp_inode->i_fop = &cifs_file_direct_nobrl_ops;
-                       else
-                               tmp_inode->i_fop = &cifs_file_direct_ops;
+       if (!S_ISREG(tmp_inode->i_mode))
+               return;
 
-               } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
-                       tmp_inode->i_fop = &cifs_file_nobrl_ops;
-               else
-                       tmp_inode->i_fop = &cifs_file_ops;
-
-               if ((cifs_sb->tcon) && (cifs_sb->tcon->ses) &&
-                  (cifs_sb->tcon->ses->server->maxBuf <
-                       PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE))
-                       tmp_inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
-               else
-                       tmp_inode->i_data.a_ops = &cifs_addr_ops;
-
-               if (isNewInode)
-                       return; /* No sense invalidating pages for new inode
-                                  since we we have not started caching
-                                  readahead file data yet */
+       /*
+        * No sense invalidating pages for new inode
+        * since we we have not started caching
+        * readahead file data yet.
+        */
+       if (isNewInode)
+               return;
 
-               if (timespec_equal(&tmp_inode->i_mtime, &local_mtime) &&
-                       (local_size == tmp_inode->i_size)) {
-                       cFYI(1, ("inode exists but unchanged"));
-               } else {
-                       /* file may have changed on server */
-                       cFYI(1, ("invalidate inode, readdir detected change"));
-                       invalidate_remote_inode(tmp_inode);
-               }
-       } else if (S_ISDIR(tmp_inode->i_mode)) {
-               cFYI(1, ("Directory inode"));
-               tmp_inode->i_op = &cifs_dir_inode_ops;
-               tmp_inode->i_fop = &cifs_dir_ops;
-       } else if (S_ISLNK(tmp_inode->i_mode)) {
-               cFYI(1, ("Symbolic Link inode"));
-               tmp_inode->i_op = &cifs_symlink_inode_ops;
-/* tmp_inode->i_fop = *//* do not need to set to anything */
+       if (timespec_equal(&tmp_inode->i_mtime, &local_mtime) &&
+               (local_size == tmp_inode->i_size)) {
+               cFYI(1, ("inode exists but unchanged"));
        } else {
-               cFYI(1, ("Special inode"));
-               init_special_inode(tmp_inode, tmp_inode->i_mode,
-                                  tmp_inode->i_rdev);
+               /* file may have changed on server */
+               cFYI(1, ("invalidate inode, readdir detected change"));
+               invalidate_remote_inode(tmp_inode);
        }
 }
 
@@ -968,7 +873,6 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
                        cFYI(1, ("posix mkdir returned 0x%x", rc));
                        d_drop(direntry);
                } else {
-                       int obj_type;
                        if (pInfo->Type == cpu_to_le32(-1)) {
                                /* no return info, go query for it */
                                kfree(pInfo);
@@ -1004,7 +908,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
                        /* we already checked in POSIXCreate whether
                           frame was long enough */
                        posix_fill_in_inode(direntry->d_inode,
-                                       pInfo, &obj_type, 1 /* NewInode */);
+                                       pInfo, 1 /* NewInode */);
 #ifdef CONFIG_CIFS_DEBUG2
                        cFYI(1, ("instantiated dentry %p %s to inode %p",
                                direntry, direntry->d_name.name, newinode));
@@ -1214,9 +1118,8 @@ int cifs_rename(struct inode *source_inode, struct dentry *source_direntry,
                } /* if we can not get memory just leave rc as EEXIST */
        }
 
-       if (rc) {
+       if (rc)
                cFYI(1, ("rename rc %d", rc));
-       }
 
        if ((rc == -EIO) || (rc == -EEXIST)) {
                int oplock = FALSE;
index d24fe6880a04e63f1ea370ef67ca92f0205f3fb5..5c792df13d62f518224378a0c9a795d9440040a7 100644 (file)
@@ -30,7 +30,7 @@
 
 #define CIFS_IOC_CHECKUMOUNT _IO(0xCF, 2)
 
-int cifs_ioctl (struct inode *inode, struct file *filep,
+int cifs_ioctl(struct inode *inode, struct file *filep,
                unsigned int command, unsigned long arg)
 {
        int rc = -ENOTTY; /* strange error - but the precedent */
index a2415c1a14dbbe297326ffd6c00ba2b9c0631361..a725c2609d672f36eab258996163cd476fca354b 100644 (file)
@@ -56,7 +56,7 @@ lshift(__u32 x, int s)
 
 /* this applies md4 to 64 byte chunks */
 static void
-mdfour64(__u32 * M, __u32 * A, __u32 *B, __u32 * C, __u32 *D)
+mdfour64(__u32 *M, __u32 *A, __u32 *B, __u32 *C, __u32 *D)
 {
        int j;
        __u32 AA, BB, CC, DD;
@@ -137,7 +137,7 @@ mdfour64(__u32 * M, __u32 * A, __u32 *B, __u32 * C, __u32 *D)
 }
 
 static void
-copy64(__u32 * M, unsigned char *in)
+copy64(__u32 *M, unsigned char *in)
 {
        int i;
 
index f13f96d42fcf63ebdfe4c76a1914a3d0afd03738..462bbfefd4b671771a52658ec08fa0efd72e9e5c 100644 (file)
@@ -161,7 +161,7 @@ MD5Final(unsigned char digest[16], struct MD5Context *ctx)
 
 /* This is the central step in the MD5 algorithm. */
 #define MD5STEP(f, w, x, y, z, data, s) \
-       ( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
+       (w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x)
 
 /*
  * The core of the MD5 algorithm, this alters an existing MD5 hash to
@@ -302,9 +302,8 @@ hmac_md5_init_limK_to_64(const unsigned char *key, int key_len,
        int i;
 
        /* if key is longer than 64 bytes truncate it */
-       if (key_len > 64) {
+       if (key_len > 64)
                key_len = 64;
-       }
 
        /* start out by storing key in pads */
        memset(ctx->k_ipad, 0, sizeof(ctx->k_ipad));
@@ -359,9 +358,9 @@ hmac_md5(unsigned char key[16], unsigned char *data, int data_len,
 {
        struct HMACMD5Context ctx;
        hmac_md5_init_limK_to_64(key, 16, &ctx);
-       if (data_len != 0) {
+       if (data_len != 0)
                hmac_md5_update(data, data_len, &ctx);
-       }
+
        hmac_md5_final(digest, &ctx);
 }
 #endif
index 15546c2354c5800b7930860304a0d043273db7fb..2a42d9fedbb266751f7f9e96dd4fb4a079d75b7e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *   fs/cifs/misc.c
  *
- *   Copyright (C) International Business Machines  Corp., 2002,2007
+ *   Copyright (C) International Business Machines  Corp., 2002,2008
  *   Author(s): Steve French (sfrench@us.ibm.com)
  *
  *   This library is free software; you can redistribute it and/or modify
@@ -320,9 +320,9 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ ,
                if (treeCon->ses) {
                        if (treeCon->ses->capabilities & CAP_UNICODE)
                                buffer->Flags2 |= SMBFLG2_UNICODE;
-                       if (treeCon->ses->capabilities & CAP_STATUS32) {
+                       if (treeCon->ses->capabilities & CAP_STATUS32)
                                buffer->Flags2 |= SMBFLG2_ERR_STATUS;
-                       }
+
                        /* Uid is not converted */
                        buffer->Uid = treeCon->ses->Suid;
                        buffer->Mid = GetNextMid(treeCon->ses->server);
@@ -610,7 +610,8 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length)
 
        buffer = (unsigned char *) smb_buf;
        for (i = 0, j = 0; i < smb_buf_length; i++, j++) {
-               if (i % 8 == 0) {       /* have reached the beginning of line */
+               if (i % 8 == 0) {
+                       /* have reached the beginning of line */
                        printk(KERN_DEBUG "| ");
                        j = 0;
                }
@@ -621,7 +622,8 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length)
                else
                        debug_line[1 + (2 * j)] = '_';
 
-               if (i % 8 == 7) { /* reached end of line, time to print ascii */
+               if (i % 8 == 7) {
+                       /* reached end of line, time to print ascii */
                        debug_line[16] = 0;
                        printk(" | %s\n", debug_line);
                }
@@ -631,7 +633,7 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length)
                debug_line[2 * j] = ' ';
                debug_line[1 + (2 * j)] = ' ';
        }
-       printk( " | %s\n", debug_line);
+       printk(" | %s\n", debug_line);
        return;
 }
 
index 646e1f06941b5c8062e9c8e590c2e2790736ab7f..3b5a5ce882b63083f492c34a3e1b007fe54be87f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *   fs/cifs/netmisc.c
  *
- *   Copyright (c) International Business Machines  Corp., 2002
+ *   Copyright (c) International Business Machines  Corp., 2002,2008
  *   Author(s): Steve French (sfrench@us.ibm.com)
  *
  *   Error mapping routines from Samba libsmb/errormap.c
@@ -150,9 +150,7 @@ static int canonicalize_unc(char *cp)
                if (cp[i] == '\\')
                        break;
                if (cp[i] == '/') {
-#ifdef CONFIG_CIFS_DEBUG2
-                       cFYI(1, ("change slash to backslash in malformed UNC"));
-#endif
+                       cFYI(DBG2, ("change slash to \\ in malformed UNC"));
                        cp[i] = '\\';
                        return 1;
                }
@@ -178,9 +176,7 @@ cifs_inet_pton(int address_family, char *cp, void *dst)
        } else if (address_family == AF_INET6) {
                ret = in6_pton(cp, -1 /* len */, dst , '\\', NULL);
        }
-#ifdef CONFIG_CIFS_DEBUG2
-       cFYI(1, ("address conversion returned %d for %s", ret, cp));
-#endif
+       cFYI(DBG2, ("address conversion returned %d for %s", ret, cp));
        if (ret > 0)
                ret = 1;
        return ret;
@@ -253,7 +249,8 @@ static const struct {
        ERRDOS, 87, NT_STATUS_INVALID_PARAMETER_MIX}, {
        ERRHRD, ERRgeneral, NT_STATUS_INVALID_QUOTA_LOWER}, {
        ERRHRD, ERRgeneral, NT_STATUS_DISK_CORRUPT_ERROR}, {
-       ERRDOS, ERRbadfile, NT_STATUS_OBJECT_NAME_INVALID}, {   /* mapping changed since shell does lookup on * and expects file not found */
+        /* mapping changed since shell does lookup on * expects FileNotFound */
+       ERRDOS, ERRbadfile, NT_STATUS_OBJECT_NAME_INVALID}, {
        ERRDOS, ERRbadfile, NT_STATUS_OBJECT_NAME_NOT_FOUND}, {
        ERRDOS, ERRalreadyexists, NT_STATUS_OBJECT_NAME_COLLISION}, {
        ERRHRD, ERRgeneral, NT_STATUS_HANDLE_NOT_WAITABLE}, {
@@ -820,7 +817,8 @@ map_smb_to_linux_error(struct smb_hdr *smb, int logErr)
        /* old style errors */
 
        /* DOS class smb error codes - map DOS */
-       if (smberrclass == ERRDOS) {  /* 1 byte field no need to byte reverse */
+       if (smberrclass == ERRDOS) {
+               /* 1 byte field no need to byte reverse */
                for (i = 0;
                     i <
                     sizeof(mapping_table_ERRDOS) /
@@ -834,7 +832,8 @@ map_smb_to_linux_error(struct smb_hdr *smb, int logErr)
                        }
                        /* else try next error mapping one to see if match */
                }
-       } else if (smberrclass == ERRSRV) {   /* server class of error codes */
+       } else if (smberrclass == ERRSRV) {
+               /* server class of error codes */
                for (i = 0;
                     i <
                     sizeof(mapping_table_ERRSRV) /
@@ -922,8 +921,8 @@ struct timespec cnvrtDosUnixTm(__u16 date, __u16 time)
 {
        struct timespec ts;
        int sec, min, days, month, year;
-       SMB_TIME * st = (SMB_TIME *)&time;
-       SMB_DATE * sd = (SMB_DATE *)&date;
+       SMB_TIME *st = (SMB_TIME *)&time;
+       SMB_DATE *sd = (SMB_DATE *)&date;
 
        cFYI(1, ("date %d time %d", date, time));
 
index 0f22def4bdff47e30300dec9bcad5be12cd193d6..32b445edc88282d2ce55ab1bd5a8f7bc2b9d7b3d 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Directory search handling
  *
- *   Copyright (C) International Business Machines  Corp., 2004, 2007
+ *   Copyright (C) International Business Machines  Corp., 2004, 2008
  *   Author(s): Steve French (sfrench@us.ibm.com)
  *
  *   This library is free software; you can redistribute it and/or modify
@@ -42,17 +42,18 @@ static void dump_cifs_file_struct(struct file *file, char *label)
                        cFYI(1, ("empty cifs private file data"));
                        return;
                }
-               if (cf->invalidHandle) {
+               if (cf->invalidHandle)
                        cFYI(1, ("invalid handle"));
-               }
-               if (cf->srch_inf.endOfSearch) {
+               if (cf->srch_inf.endOfSearch)
                        cFYI(1, ("end of search"));
-               }
-               if (cf->srch_inf.emptyDir) {
+               if (cf->srch_inf.emptyDir)
                        cFYI(1, ("empty dir"));
-               }
        }
 }
+#else
+static inline void dump_cifs_file_struct(struct file *file, char *label)
+{
+}
 #endif /* DEBUG2 */
 
 /* Returns one if new inode created (which therefore needs to be hashed) */
@@ -150,7 +151,7 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
                      cifs_NTtimeToUnix(le64_to_cpu(pfindData->ChangeTime));
        } else { /* legacy, OS2 and DOS style */
 /*             struct timespec ts;*/
-               FIND_FILE_STANDARD_INFO * pfindData =
+               FIND_FILE_STANDARD_INFO *pfindData =
                        (FIND_FILE_STANDARD_INFO *)buf;
 
                tmp_inode->i_mtime = cnvrtDosUnixTm(
@@ -198,9 +199,8 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
        if (attr & ATTR_DIRECTORY) {
                *pobject_type = DT_DIR;
                /* override default perms since we do not lock dirs */
-               if (atomic_read(&cifsInfo->inUse) == 0) {
+               if (atomic_read(&cifsInfo->inUse) == 0)
                        tmp_inode->i_mode = cifs_sb->mnt_dir_mode;
-               }
                tmp_inode->i_mode |= S_IFDIR;
        } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
                   (attr & ATTR_SYSTEM)) {
@@ -231,9 +231,8 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type,
        } /* could add code here - to validate if device or weird share type? */
 
        /* can not fill in nlink here as in qpathinfo version and Unx search */
-       if (atomic_read(&cifsInfo->inUse) == 0) {
+       if (atomic_read(&cifsInfo->inUse) == 0)
                atomic_set(&cifsInfo->inUse, 1);
-       }
 
        spin_lock(&tmp_inode->i_lock);
        if (is_size_safe_to_change(cifsInfo, end_of_file)) {
@@ -461,9 +460,8 @@ static int initiate_cifs_search(const int xid, struct file *file)
 
        full_path = build_path_from_dentry(file->f_path.dentry);
 
-       if (full_path == NULL) {
+       if (full_path == NULL)
                return -ENOMEM;
-       }
 
        cFYI(1, ("Full path: %s start at: %lld", full_path, file->f_pos));
 
@@ -471,9 +469,9 @@ ffirst_retry:
        /* test for Unix extensions */
        /* but now check for them on the share/mount not on the SMB session */
 /*     if (pTcon->ses->capabilities & CAP_UNIX) { */
-       if (pTcon->unix_ext) {
+       if (pTcon->unix_ext)
                cifsFile->srch_inf.info_level = SMB_FIND_FILE_UNIX;
-       else if ((pTcon->ses->capabilities &
+       else if ((pTcon->ses->capabilities &
                        (CAP_NT_SMBS | CAP_NT_FIND)) == 0) {
                cifsFile->srch_inf.info_level = SMB_FIND_FILE_INFO_STANDARD;
        } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
@@ -514,10 +512,10 @@ static int cifs_unicode_bytelen(char *str)
 static char *nxt_dir_entry(char *old_entry, char *end_of_smb, int level)
 {
        char *new_entry;
-       FILE_DIRECTORY_INFO * pDirInfo = (FILE_DIRECTORY_INFO *)old_entry;
+       FILE_DIRECTORY_INFO *pDirInfo = (FILE_DIRECTORY_INFO *)old_entry;
 
        if (level == SMB_FIND_FILE_INFO_STANDARD) {
-               FIND_FILE_STANDARD_INFO * pfData;
+               FIND_FILE_STANDARD_INFO *pfData;
                pfData = (FIND_FILE_STANDARD_INFO *)pDirInfo;
 
                new_entry = old_entry + sizeof(FIND_FILE_STANDARD_INFO) +
@@ -553,7 +551,7 @@ static int cifs_entry_is_dot(char *current_entry, struct cifsFileInfo *cfile)
        int len = 0;
 
        if (cfile->srch_inf.info_level == SMB_FIND_FILE_UNIX) {
-               FILE_UNIX_INFO * pFindData = (FILE_UNIX_INFO *)current_entry;
+               FILE_UNIX_INFO *pFindData = (FILE_UNIX_INFO *)current_entry;
                filename = &pFindData->FileName[0];
                if (cfile->srch_inf.unicode) {
                        len = cifs_unicode_bytelen(filename);
@@ -562,30 +560,30 @@ static int cifs_entry_is_dot(char *current_entry, struct cifsFileInfo *cfile)
                        len = strnlen(filename, 5);
                }
        } else if (cfile->srch_inf.info_level == SMB_FIND_FILE_DIRECTORY_INFO) {
-               FILE_DIRECTORY_INFO * pFindData =
+               FILE_DIRECTORY_INFO *pFindData =
                        (FILE_DIRECTORY_INFO *)current_entry;
                filename = &pFindData->FileName[0];
                len = le32_to_cpu(pFindData->FileNameLength);
        } else if (cfile->srch_inf.info_level ==
                        SMB_FIND_FILE_FULL_DIRECTORY_INFO) {
-               FILE_FULL_DIRECTORY_INFO * pFindData =
+               FILE_FULL_DIRECTORY_INFO *pFindData =
                        (FILE_FULL_DIRECTORY_INFO *)current_entry;
                filename = &pFindData->FileName[0];
                len = le32_to_cpu(pFindData->FileNameLength);
        } else if (cfile->srch_inf.info_level ==
                        SMB_FIND_FILE_ID_FULL_DIR_INFO) {
-               SEARCH_ID_FULL_DIR_INFO * pFindData =
+               SEARCH_ID_FULL_DIR_INFO *pFindData =
                        (SEARCH_ID_FULL_DIR_INFO *)current_entry;
                filename = &pFindData->FileName[0];
                len = le32_to_cpu(pFindData->FileNameLength);
        } else if (cfile->srch_inf.info_level ==
                        SMB_FIND_FILE_BOTH_DIRECTORY_INFO) {
-               FILE_BOTH_DIRECTORY_INFO * pFindData =
+               FILE_BOTH_DIRECTORY_INFO *pFindData =
                        (FILE_BOTH_DIRECTORY_INFO *)current_entry;
                filename = &pFindData->FileName[0];
                len = le32_to_cpu(pFindData->FileNameLength);
        } else if (cfile->srch_inf.info_level == SMB_FIND_FILE_INFO_STANDARD) {
-               FIND_FILE_STANDARD_INFO * pFindData =
+               FIND_FILE_STANDARD_INFO *pFindData =
                        (FIND_FILE_STANDARD_INFO *)current_entry;
                filename = &pFindData->FileName[0];
                len = pFindData->FileNameLength;
@@ -666,9 +664,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
        . and .. for the root of a drive and for those we need
        to start two entries earlier */
 
-#ifdef CONFIG_CIFS_DEBUG2
        dump_cifs_file_struct(file, "In fce ");
-#endif
        if (((index_to_find < cifsFile->srch_inf.index_of_last_entry) &&
             is_dir_changed(file)) ||
           (index_to_find < first_entry_in_buffer)) {
@@ -718,7 +714,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
                pos_in_buf = index_to_find - first_entry_in_buffer;
                cFYI(1, ("found entry - pos_in_buf %d", pos_in_buf));
 
-               for (i=0; (i < (pos_in_buf)) && (current_entry != NULL); i++) {
+               for (i = 0; (i < (pos_in_buf)) && (current_entry != NULL); i++) {
                        /* go entry by entry figuring out which is first */
                        current_entry = nxt_dir_entry(current_entry, end_of_smb,
                                                cifsFile->srch_inf.info_level);
@@ -793,7 +789,7 @@ static int cifs_get_name_from_search_buf(struct qstr *pqst,
                filename = &pFindData->FileName[0];
                len = le32_to_cpu(pFindData->FileNameLength);
        } else if (level == SMB_FIND_FILE_INFO_STANDARD) {
-               FIND_FILE_STANDARD_INFO * pFindData =
+               FIND_FILE_STANDARD_INFO *pFindData =
                        (FIND_FILE_STANDARD_INFO *)current_entry;
                filename = &pFindData->FileName[0];
                /* one byte length, no name conversion */
@@ -928,7 +924,7 @@ static int cifs_save_resume_key(const char *current_entry,
        level = cifsFile->srch_inf.info_level;
 
        if (level == SMB_FIND_FILE_UNIX) {
-               FILE_UNIX_INFO * pFindData = (FILE_UNIX_INFO *)current_entry;
+               FILE_UNIX_INFO *pFindData = (FILE_UNIX_INFO *)current_entry;
 
                filename = &pFindData->FileName[0];
                if (cifsFile->srch_inf.unicode) {
index d2153abcba6d7983678e8e08df39eee7bf4083a3..ed150efbe27c93fbec1834767262453c47619e14 100644 (file)
@@ -417,10 +417,6 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
 
                calc_lanman_hash(ses, lnm_session_key);
                ses->flags |= CIFS_SES_LANMAN;
-/* #ifdef CONFIG_CIFS_DEBUG2
-               cifs_dump_mem("cryptkey: ",ses->server->cryptKey,
-                       CIFS_SESS_KEY_SIZE);
-#endif */
                memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_SESS_KEY_SIZE);
                bcc_ptr += CIFS_SESS_KEY_SIZE;
 
index cfa6d21fb4e871c4e09a94be0271d0eaf490a531..04943c976f98d1df3810d42d2a362cc940c27131 100644 (file)
@@ -114,42 +114,42 @@ static uchar sbox[8][4][16] = {
        {{14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7},
         {0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8},
         {4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0},
-        {15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13}},
+        {15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13} },
 
        {{15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10},
         {3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5},
         {0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15},
-        {13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9}},
+        {13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9} },
 
        {{10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8},
         {13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1},
         {13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7},
-        {1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12}},
+        {1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12} },
 
        {{7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15},
         {13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9},
         {10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4},
-        {3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14}},
+        {3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14} },
 
        {{2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9},
         {14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6},
         {4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14},
-        {11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3}},
+        {11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3} },
 
        {{12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11},
         {10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8},
         {9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6},
-        {4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13}},
+        {4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13} },
 
        {{4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1},
         {13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6},
         {1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2},
-        {6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12}},
+        {6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12} },
 
        {{13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7},
         {1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2},
         {7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8},
-        {2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11}}
+        {2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11} }
 };
 
 static void
@@ -313,9 +313,8 @@ str_to_key(unsigned char *str, unsigned char *key)
        key[5] = ((str[4] & 0x1F) << 2) | (str[5] >> 6);
        key[6] = ((str[5] & 0x3F) << 1) | (str[6] >> 7);
        key[7] = str[6] & 0x7F;
-       for (i = 0; i < 8; i++) {
+       for (i = 0; i < 8; i++)
                key[i] = (key[i] << 1);
-       }
 }
 
 static void
@@ -344,9 +343,8 @@ smbhash(unsigned char *out, unsigned char *in, unsigned char *key, int forw)
 
        dohash(outb, inb, keyb, forw);
 
-       for (i = 0; i < 8; i++) {
+       for (i = 0; i < 8; i++)
                out[i] = 0;
-       }
 
        for (i = 0; i < 64; i++) {
                if (outb[i])
index 50b623ad93205700822888e00c1e684186aac05e..3612d6c0a0bbc1a4c9f64c2ce0f674517ce86d72 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *   fs/cifs/transport.c
  *
- *   Copyright (C) International Business Machines  Corp., 2002,2007
+ *   Copyright (C) International Business Machines  Corp., 2002,2008
  *   Author(s): Steve French (sfrench@us.ibm.com)
  *   Jeremy Allison (jra@samba.org) 2006.
  *
@@ -358,9 +358,9 @@ static int allocate_mid(struct cifsSesInfo *ses, struct smb_hdr *in_buf,
        } else if (ses->status != CifsGood) {
                /* check if SMB session is bad because we are setting it up */
                if ((in_buf->Command != SMB_COM_SESSION_SETUP_ANDX) &&
-                       (in_buf->Command != SMB_COM_NEGOTIATE)) {
+                       (in_buf->Command != SMB_COM_NEGOTIATE))
                        return -EAGAIN;
-               /* else ok - we are setting up session */
+               /* else ok - we are setting up session */
        }
        *ppmidQ = AllocMidQEntry(in_buf, ses);
        if (*ppmidQ == NULL)
@@ -437,9 +437,8 @@ SendReceiveNoRsp(const unsigned int xid, struct cifsSesInfo *ses,
        iov[0].iov_len = in_buf->smb_buf_length + 4;
        flags |= CIFS_NO_RESP;
        rc = SendReceive2(xid, ses, iov, 1, &resp_buf_type, flags);
-#ifdef CONFIG_CIFS_DEBUG2
-       cFYI(1, ("SendRcvNoR flags %d rc %d", flags, rc));
-#endif
+       cFYI(DBG2, ("SendRcvNoRsp flags %d rc %d", flags, rc));
+
        return rc;
 }
 
index 54e8ef96cb7930c07734aa9f0b808eaa2e215953..8cd6a445b017ae62c2028b083dce8593d5c894fc 100644 (file)
@@ -139,9 +139,9 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
        } else if (strncmp(ea_name, CIFS_XATTR_USER_PREFIX, 5) == 0) {
                if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
                        goto set_ea_exit;
-               if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0) {
+               if (strncmp(ea_name, CIFS_XATTR_DOS_ATTRIB, 14) == 0)
                        cFYI(1, ("attempt to set cifs inode metadata"));
-               }
+
                ea_name += 5; /* skip past user. prefix */
                rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value,
                        (__u16)value_size, cifs_sb->local_nls,
@@ -262,7 +262,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
                                cifs_sb->mnt_cifs_flags &
                                        CIFS_MOUNT_MAP_SPECIAL_CHR);
 #ifdef CONFIG_CIFS_EXPERIMENTAL
-               else if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
+               else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
                        __u16 fid;
                        int oplock = FALSE;
                        struct cifs_ntsd *pacl = NULL;
@@ -303,11 +303,10 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
        } else if (strncmp(ea_name,
                  CIFS_XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) == 0) {
                cFYI(1, ("Security xattr namespace not supported yet"));
-       } else {
+       } else
                cFYI(1,
                    ("illegal xattr request %s (only user namespace supported)",
                        ea_name));
-       }
 
        /* We could add an additional check for streams ie
            if proc/fs/cifs/streamstoxattr is set then
index d26e2826ba5b8242ec3a4ad1bcf3b849d64b5a8a..e9602d85c11d0220d5cbccf7817c25b10a6d068e 100644 (file)
 
 #define DEBUGFS_MAGIC  0x64626720
 
-/* declared over in file.c */
-extern struct file_operations debugfs_file_operations;
-extern struct inode_operations debugfs_link_operations;
-
 static struct vfsmount *debugfs_mount;
 static int debugfs_mount_count;
 
index dc74b186145d74db8a56470d5ef2e63ea5c0a3c0..6df1debdccce14aabbf0e63193b66ec0c8366d3e 100644 (file)
@@ -263,52 +263,102 @@ out:
        return 0;
 }
 
-/* This function must zero any hole we create */
+/**
+ * ecryptfs_prepare_write
+ * @file: The eCryptfs file
+ * @page: The eCryptfs page
+ * @from: The start byte from which we will write
+ * @to: The end byte to which we will write
+ *
+ * This function must zero any hole we create
+ *
+ * Returns zero on success; non-zero otherwise
+ */
 static int ecryptfs_prepare_write(struct file *file, struct page *page,
                                  unsigned from, unsigned to)
 {
-       int rc = 0;
        loff_t prev_page_end_size;
+       int rc = 0;
 
        if (!PageUptodate(page)) {
-               rc = ecryptfs_read_lower_page_segment(page, page->index, 0,
-                                                     PAGE_CACHE_SIZE,
-                                                     page->mapping->host);
-               if (rc) {
-                       printk(KERN_ERR "%s: Error attemping to read lower "
-                              "page segment; rc = [%d]\n", __FUNCTION__, rc);
-                       ClearPageUptodate(page);
-                       goto out;
-               } else
+               struct ecryptfs_crypt_stat *crypt_stat =
+                       &ecryptfs_inode_to_private(
+                               file->f_path.dentry->d_inode)->crypt_stat;
+
+               if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)
+                   || (crypt_stat->flags & ECRYPTFS_NEW_FILE)) {
+                       rc = ecryptfs_read_lower_page_segment(
+                               page, page->index, 0, PAGE_CACHE_SIZE,
+                               page->mapping->host);
+                       if (rc) {
+                               printk(KERN_ERR "%s: Error attemping to read "
+                                      "lower page segment; rc = [%d]\n",
+                                      __FUNCTION__, rc);
+                               ClearPageUptodate(page);
+                               goto out;
+                       } else
+                               SetPageUptodate(page);
+               } else if (crypt_stat->flags & ECRYPTFS_VIEW_AS_ENCRYPTED) {
+                       if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) {
+                               rc = ecryptfs_copy_up_encrypted_with_header(
+                                       page, crypt_stat);
+                               if (rc) {
+                                       printk(KERN_ERR "%s: Error attempting "
+                                              "to copy the encrypted content "
+                                              "from the lower file whilst "
+                                              "inserting the metadata from "
+                                              "the xattr into the header; rc "
+                                              "= [%d]\n", __FUNCTION__, rc);
+                                       ClearPageUptodate(page);
+                                       goto out;
+                               }
+                               SetPageUptodate(page);
+                       } else {
+                               rc = ecryptfs_read_lower_page_segment(
+                                       page, page->index, 0, PAGE_CACHE_SIZE,
+                                       page->mapping->host);
+                               if (rc) {
+                                       printk(KERN_ERR "%s: Error reading "
+                                              "page; rc = [%d]\n",
+                                              __FUNCTION__, rc);
+                                       ClearPageUptodate(page);
+                                       goto out;
+                               }
+                               SetPageUptodate(page);
+                       }
+               } else {
+                       rc = ecryptfs_decrypt_page(page);
+                       if (rc) {
+                               printk(KERN_ERR "%s: Error decrypting page "
+                                      "at index [%ld]; rc = [%d]\n",
+                                      __FUNCTION__, page->index, rc);
+                               ClearPageUptodate(page);
+                               goto out;
+                       }
                        SetPageUptodate(page);
+               }
        }
-
        prev_page_end_size = ((loff_t)page->index << PAGE_CACHE_SHIFT);
-
-       /*
-        * If creating a page or more of holes, zero them out via truncate.
-        * Note, this will increase i_size.
-        */
+       /* If creating a page or more of holes, zero them out via truncate.
+        * Note, this will increase i_size. */
        if (page->index != 0) {
                if (prev_page_end_size > i_size_read(page->mapping->host)) {
                        rc = ecryptfs_truncate(file->f_path.dentry,
                                               prev_page_end_size);
                        if (rc) {
-                               printk(KERN_ERR "Error on attempt to "
+                               printk(KERN_ERR "%s: Error on attempt to "
                                       "truncate to (higher) offset [%lld];"
-                                      " rc = [%d]\n", prev_page_end_size, rc);
+                                      " rc = [%d]\n", __FUNCTION__,
+                                      prev_page_end_size, rc);
                                goto out;
                        }
                }
        }
-       /*
-        * Writing to a new page, and creating a small hole from start of page?
-        * Zero it out.
-        */
-       if ((i_size_read(page->mapping->host) == prev_page_end_size) &&
-           (from != 0)) {
+       /* Writing to a new page, and creating a small hole from start
+        * of page?  Zero it out. */
+       if ((i_size_read(page->mapping->host) == prev_page_end_size)
+           && (from != 0))
                zero_user(page, 0, PAGE_CACHE_SIZE);
-       }
 out:
        return rc;
 }
index a44b142fb4607baee2d832b1056103b5d157e5a7..54a0a557b6781ecf379015bbd60dc6f3fd37c176 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -173,8 +173,15 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
                return NULL;
 
        if (write) {
-               struct rlimit *rlim = current->signal->rlim;
                unsigned long size = bprm->vma->vm_end - bprm->vma->vm_start;
+               struct rlimit *rlim;
+
+               /*
+                * We've historically supported up to 32 pages (ARG_MAX)
+                * of argument strings even with small stacks
+                */
+               if (size <= ARG_MAX)
+                       return page;
 
                /*
                 * Limit to 1/4-th the stack size for the argv+env strings.
@@ -183,6 +190,7 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
                 *  - the program will have a reasonable amount of stack left
                 *    to work from.
                 */
+               rlim = current->signal->rlim;
                if (size > rlim[RLIMIT_STACK].rlim_cur / 4) {
                        put_page(page);
                        return NULL;
index 18769cc3237703e3426012378b31ca2e8c6024aa..ad536066408229da9955e41e27a0f5e72756cccd 100644 (file)
@@ -806,8 +806,8 @@ static match_table_t tokens = {
        {Opt_quota, "quota"},
        {Opt_usrquota, "usrquota"},
        {Opt_barrier, "barrier=%u"},
-       {Opt_err, NULL},
        {Opt_resize, "resize"},
+       {Opt_err, NULL},
 };
 
 static ext3_fsblk_t get_sb_block(void **data)
index 038ed743619911799dfff8e27623e75f593fc60c..c6cbb6cd59b25588ea68b49c69062362c65b3e0b 100644 (file)
@@ -369,7 +369,7 @@ out:
 
 
 /**
- * int journal_restart() - restart a handle .
+ * int journal_restart() - restart a handle.
  * @handle:  handle to restart
  * @nblocks: nr credits requested
  *
@@ -844,8 +844,7 @@ out:
 }
 
 /**
- * int journal_get_undo_access() -  Notify intent to modify metadata with
- *     non-rewindable consequences
+ * int journal_get_undo_access() - Notify intent to modify metadata with non-rewindable consequences
  * @handle: transaction
  * @bh: buffer to undo
  * @credits: store the number of taken credits here (if not NULL)
@@ -921,12 +920,14 @@ out:
 }
 
 /**
- * int journal_dirty_data() -  mark a buffer as containing dirty data which
- *                             needs to be flushed before we can commit the
- *                             current transaction.
+ * int journal_dirty_data() - mark a buffer as containing dirty data to be flushed
  * @handle: transaction
  * @bh: bufferhead to mark
  *
+ * Description:
+ * Mark a buffer as containing dirty data which needs to be flushed before
+ * we can commit the current transaction.
+ *
  * The buffer is placed on the transaction's data list and is marked as
  * belonging to the transaction.
  *
@@ -1098,11 +1099,11 @@ no_journal:
 }
 
 /**
- * int journal_dirty_metadata() -  mark a buffer as containing dirty metadata
+ * int journal_dirty_metadata() - mark a buffer as containing dirty metadata
  * @handle: transaction to add buffer to.
  * @bh: buffer to mark
  *
- * mark dirty metadata which needs to be journaled as part of the current
+ * Mark dirty metadata which needs to be journaled as part of the current
  * transaction.
  *
  * The buffer is placed on the transaction's metadata list and is marked
index 5df564366f36b5ea287245b3b5fd060ab1012f31..235e4d3873a88d17837f1a9551f09664c8ffcb54 100644 (file)
@@ -325,16 +325,12 @@ confused:
 }
 
 /**
- * mpage_readpages - populate an address space with some pages, and
- *                       start reads against them.
- *
+ * mpage_readpages - populate an address space with some pages & start reads against them
  * @mapping: the address_space
  * @pages: The address of a list_head which contains the target pages.  These
  *   pages have their ->index populated and are otherwise uninitialised.
- *
  *   The page at @pages->prev has the lowest file offset, and reads should be
  *   issued in @pages->prev to @pages->next order.
- *
  * @nr_pages: The number of pages at *@pages
  * @get_block: The filesystem's block mapper function.
  *
@@ -360,6 +356,7 @@ confused:
  * So an mpage read of the first 16 blocks of an ext2 file will cause I/O to be
  * submitted in the following order:
  *     12 0 1 2 3 4 5 6 7 8 9 10 11 13 14 15 16
+ *
  * because the indirect block has to be read to get the mappings of blocks
  * 13,14,15,16.  Obviously, this impacts performance.
  *
@@ -656,9 +653,7 @@ out:
 }
 
 /**
- * mpage_writepages - walk the list of dirty pages of the given
- * address space and writepage() all of them.
- * 
+ * mpage_writepages - walk the list of dirty pages of the given address space & writepage() all of them
  * @mapping: address space structure to write
  * @wbc: subtract the number of written pages from *@wbc->nr_to_write
  * @get_block: the filesystem's block mapper function.
index 0f5619611b8dc5d313accd81658fd6dd32e6a647..931992763e68c2e68f7e1f3501de25a8340dc50b 100644 (file)
@@ -3,6 +3,7 @@
  */
 
 #include <linux/mount.h>
+#include <linux/security.h>
 
 struct nfs_string;
 
@@ -57,6 +58,8 @@ struct nfs_parsed_mount_data {
                char                    *export_path;
                int                     protocol;
        } nfs_server;
+
+       struct security_mnt_opts lsm_opts;
 };
 
 /* client.c */
index 1fb3818436501bc7bfd7637d7744576fe09e6041..fcf4b982c88580bca2d841d13c8e00e75f281627 100644 (file)
@@ -684,8 +684,9 @@ static void nfs_parse_server_address(char *value,
 static int nfs_parse_mount_options(char *raw,
                                   struct nfs_parsed_mount_data *mnt)
 {
-       char *p, *string;
+       char *p, *string, *secdata;
        unsigned short port = 0;
+       int rc;
 
        if (!raw) {
                dfprintk(MOUNT, "NFS: mount options string was NULL.\n");
@@ -693,6 +694,20 @@ static int nfs_parse_mount_options(char *raw,
        }
        dfprintk(MOUNT, "NFS: nfs mount opts='%s'\n", raw);
 
+       secdata = alloc_secdata();
+       if (!secdata)
+               goto out_nomem;
+
+       rc = security_sb_copy_data(raw, secdata);
+       if (rc)
+               goto out_security_failure;
+
+       rc = security_sb_parse_opts_str(secdata, &mnt->lsm_opts);
+       if (rc)
+               goto out_security_failure;
+
+       free_secdata(secdata);
+
        while ((p = strsep(&raw, ",")) != NULL) {
                substring_t args[MAX_OPT_ARGS];
                int option, token;
@@ -1042,7 +1057,10 @@ static int nfs_parse_mount_options(char *raw,
 out_nomem:
        printk(KERN_INFO "NFS: not enough memory to parse option\n");
        return 0;
-
+out_security_failure:
+       free_secdata(secdata);
+       printk(KERN_INFO "NFS: security options invalid: %d\n", rc);
+       return 0;
 out_unrec_vers:
        printk(KERN_INFO "NFS: unrecognized NFS version number\n");
        return 0;
@@ -1214,6 +1232,33 @@ static int nfs_validate_mount_data(void *options,
                args->namlen            = data->namlen;
                args->bsize             = data->bsize;
                args->auth_flavors[0]   = data->pseudoflavor;
+
+               /*
+                * The legacy version 6 binary mount data from userspace has a
+                * field used only to transport selinux information into the
+                * the kernel.  To continue to support that functionality we
+                * have a touch of selinux knowledge here in the NFS code. The
+                * userspace code converted context=blah to just blah so we are
+                * converting back to the full string selinux understands.
+                */
+               if (data->context[0]){
+#ifdef CONFIG_SECURITY_SELINUX
+                       int rc;
+                       char *opts_str = kmalloc(sizeof(data->context) + 8, GFP_KERNEL);
+                       if (!opts_str)
+                               return -ENOMEM;
+                       strcpy(opts_str, "context=");
+                       data->context[NFS_MAX_CONTEXT_LEN] = '\0';
+                       strcat(opts_str, &data->context[0]);
+                       rc = security_sb_parse_opts_str(opts_str, &args->lsm_opts);
+                       kfree(opts_str);
+                       if (rc)
+                               return rc;
+#else
+                       return -EINVAL;
+#endif
+               }
+
                break;
        default: {
                unsigned int len;
@@ -1476,6 +1521,8 @@ static int nfs_get_sb(struct file_system_type *fs_type,
        };
        int error;
 
+       security_init_mnt_opts(&data.lsm_opts);
+
        /* Validate the mount data */
        error = nfs_validate_mount_data(raw_data, &data, &mntfh, dev_name);
        if (error < 0)
@@ -1515,6 +1562,10 @@ static int nfs_get_sb(struct file_system_type *fs_type,
                goto error_splat_super;
        }
 
+       error = security_sb_set_mnt_opts(s, &data.lsm_opts);
+       if (error)
+               goto error_splat_root;
+
        s->s_flags |= MS_ACTIVE;
        mnt->mnt_sb = s;
        mnt->mnt_root = mntroot;
@@ -1523,12 +1574,15 @@ static int nfs_get_sb(struct file_system_type *fs_type,
 out:
        kfree(data.nfs_server.hostname);
        kfree(data.mount_server.hostname);
+       security_free_mnt_opts(&data.lsm_opts);
        return error;
 
 out_err_nosb:
        nfs_free_server(server);
        goto out;
 
+error_splat_root:
+       dput(mntroot);
 error_splat_super:
        up_write(&s->s_umount);
        deactivate_super(s);
@@ -1608,6 +1662,9 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
        mnt->mnt_sb = s;
        mnt->mnt_root = mntroot;
 
+       /* clone any lsm security options from the parent to the new sb */
+       security_sb_clone_mnt_opts(data->sb, s);
+
        dprintk("<-- nfs_xdev_get_sb() = 0\n");
        return 0;
 
@@ -1850,6 +1907,8 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
        };
        int error;
 
+       security_init_mnt_opts(&data.lsm_opts);
+
        /* Validate the mount data */
        error = nfs4_validate_mount_data(raw_data, &data, dev_name);
        if (error < 0)
@@ -1898,6 +1957,7 @@ out:
        kfree(data.client_address);
        kfree(data.nfs_server.export_path);
        kfree(data.nfs_server.hostname);
+       security_free_mnt_opts(&data.lsm_opts);
        return error;
 
 out_free:
index 82243127eebf6b81d80acd239609bdc1fd26ae43..90383ed6100530d6d10e5edae9b437278138fa0e 100644 (file)
@@ -257,7 +257,7 @@ static int ocfs2_readpage_inline(struct inode *inode, struct page *page)
        struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 
        BUG_ON(!PageLocked(page));
-       BUG_ON(!OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL);
+       BUG_ON(!(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL));
 
        ret = ocfs2_read_block(osb, OCFS2_I(inode)->ip_blkno, &di_bh,
                               OCFS2_BH_CACHED, inode);
index e280833ceb9aa76bd8404ded84b6047948b0ca9d..8a18758480805504c453ed291908b36764b9f722 100644 (file)
@@ -390,9 +390,8 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir,
                                goto bail;
                        }
                        if (pde)
-                               pde->rec_len =
-                                       cpu_to_le16(le16_to_cpu(pde->rec_len) +
-                                                   le16_to_cpu(de->rec_len));
+                               le16_add_cpu(&pde->rec_len,
+                                               le16_to_cpu(de->rec_len));
                        else
                                de->inode = 0;
                        dir->i_version++;
index a54d33d95ada49f6a993c0518168870e1b58c1a2..c92d1b19fc0bbb51c0c98cbe27847f98ac6fce10 100644 (file)
@@ -1695,9 +1695,9 @@ send_response:
  * can periodically run all locks owned by this node
  * and re-assert across the cluster...
  */
-int dlm_do_assert_master(struct dlm_ctxt *dlm,
-                        struct dlm_lock_resource *res,
-                        void *nodemap, u32 flags)
+static int dlm_do_assert_master(struct dlm_ctxt *dlm,
+                               struct dlm_lock_resource *res,
+                               void *nodemap, u32 flags)
 {
        struct dlm_assert_master assert;
        int to, tmpret;
index 351130c9b7346c7d26faa5d4215720baa8e92f1a..f7794306b2bd20a0dc2e1d1c9aec72e559bd4b8c 100644 (file)
@@ -3042,7 +3042,7 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres,
                inode = ocfs2_lock_res_inode(lockres);
        mapping = inode->i_mapping;
 
-       if (S_ISREG(inode->i_mode))
+       if (!S_ISREG(inode->i_mode))
                goto out;
 
        /*
@@ -3219,8 +3219,8 @@ static int ocfs2_dentry_convert_worker(struct ocfs2_lock_res *lockres,
        return UNBLOCK_CONTINUE_POST;
 }
 
-void ocfs2_process_blocked_lock(struct ocfs2_super *osb,
-                               struct ocfs2_lock_res *lockres)
+static void ocfs2_process_blocked_lock(struct ocfs2_super *osb,
+                                      struct ocfs2_lock_res *lockres)
 {
        int status;
        struct ocfs2_unblock_ctl ctl = {0, 0,};
@@ -3356,7 +3356,7 @@ static int ocfs2_downconvert_thread_should_wake(struct ocfs2_super *osb)
        return should_wake;
 }
 
-int ocfs2_downconvert_thread(void *arg)
+static int ocfs2_downconvert_thread(void *arg)
 {
        int status = 0;
        struct ocfs2_super *osb = arg;
index 1d5b0699d0a9bb0adc67a85d4720778be9f81773..e3cf902404b45e3caaec642d450cf626d09ecb74 100644 (file)
@@ -109,8 +109,6 @@ void ocfs2_simple_drop_lockres(struct ocfs2_super *osb,
                               struct ocfs2_lock_res *lockres);
 
 /* for the downconvert thread */
-void ocfs2_process_blocked_lock(struct ocfs2_super *osb,
-                               struct ocfs2_lock_res *lockres);
 void ocfs2_wake_downconvert_thread(struct ocfs2_super *osb);
 
 struct ocfs2_dlm_debug *ocfs2_new_dlm_debug(void);
index c0efd9489fe8168f88d28c1abe6acdb2cedb3385..0758daf64da07c41fcf4f73a7b55d634589ab87d 100644 (file)
@@ -49,10 +49,15 @@ static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map,
 static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map,
                                              int bit);
 static inline int __ocfs2_node_map_is_empty(struct ocfs2_node_map *map);
-static void __ocfs2_node_map_dup(struct ocfs2_node_map *target,
-                                struct ocfs2_node_map *from);
-static void __ocfs2_node_map_set(struct ocfs2_node_map *target,
-                                struct ocfs2_node_map *from);
+
+/* special case -1 for now
+ * TODO: should *really* make sure the calling func never passes -1!!  */
+static void ocfs2_node_map_init(struct ocfs2_node_map *map)
+{
+       map->num_nodes = OCFS2_NODE_MAP_MAX_NODES;
+       memset(map->map, 0, BITS_TO_LONGS(OCFS2_NODE_MAP_MAX_NODES) *
+              sizeof(unsigned long));
+}
 
 void ocfs2_init_node_maps(struct ocfs2_super *osb)
 {
@@ -136,15 +141,6 @@ void ocfs2_stop_heartbeat(struct ocfs2_super *osb)
                mlog_errno(ret);
 }
 
-/* special case -1 for now
- * TODO: should *really* make sure the calling func never passes -1!!  */
-void ocfs2_node_map_init(struct ocfs2_node_map *map)
-{
-       map->num_nodes = OCFS2_NODE_MAP_MAX_NODES;
-       memset(map->map, 0, BITS_TO_LONGS(OCFS2_NODE_MAP_MAX_NODES) *
-              sizeof(unsigned long));
-}
-
 static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map,
                                            int bit)
 {
@@ -216,6 +212,8 @@ int ocfs2_node_map_is_empty(struct ocfs2_super *osb,
        return ret;
 }
 
+#if 0
+
 static void __ocfs2_node_map_dup(struct ocfs2_node_map *target,
                                 struct ocfs2_node_map *from)
 {
@@ -254,6 +252,8 @@ static void __ocfs2_node_map_set(struct ocfs2_node_map *target,
                target->map[i] = from->map[i];
 }
 
+#endif  /*  0  */
+
 /* Returns whether the recovery bit was actually set - it may not be
  * if a node is still marked as needing recovery */
 int ocfs2_recovery_map_set(struct ocfs2_super *osb,
index 56859211888a18cd6f22ed9a9fecf20eaba040ce..eac63aed7611c2105d5026c58affea7f2b562ed4 100644 (file)
@@ -33,7 +33,6 @@ void ocfs2_stop_heartbeat(struct ocfs2_super *osb);
 
 /* node map functions - used to keep track of mounted and in-recovery
  * nodes. */
-void ocfs2_node_map_init(struct ocfs2_node_map *map);
 int ocfs2_node_map_is_empty(struct ocfs2_super *osb,
                            struct ocfs2_node_map *map);
 void ocfs2_node_map_set_bit(struct ocfs2_super *osb,
@@ -57,9 +56,5 @@ int ocfs2_recovery_map_set(struct ocfs2_super *osb,
                           int num);
 void ocfs2_recovery_map_clear(struct ocfs2_super *osb,
                              int num);
-/* returns 1 if bit is the only bit set in target, 0 otherwise */
-int ocfs2_node_map_is_only(struct ocfs2_super *osb,
-                          struct ocfs2_node_map *target,
-                          int bit);
 
 #endif /* OCFS2_HEARTBEAT_H */
index add1ffdc5c6c75bb2accdb65972466f2651e80c8..ab83fd5624294561541dba9663f128336f296116 100644 (file)
@@ -120,9 +120,6 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb)
 
        mlog_entry_void();
 
-       if (ocfs2_mount_local(osb))
-               goto bail;
-
        if (osb->local_alloc_size == 0)
                goto bail;
 
@@ -588,8 +585,7 @@ int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb,
        while(bits_wanted--)
                ocfs2_set_bit(start++, bitmap);
 
-       alloc->id1.bitmap1.i_used = cpu_to_le32(*num_bits +
-                               le32_to_cpu(alloc->id1.bitmap1.i_used));
+       le32_add_cpu(&alloc->id1.bitmap1.i_used, *num_bits);
 
        status = ocfs2_journal_dirty(handle, osb->local_alloc_bh);
        if (status < 0) {
index 468805d40e2bdb44daeb43bfccf4a1b5919c7add..2d563979cb025412dce7847bd79979c34a8456eb 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/interrupt.h>
 #include <linux/swap.h>
 #include <linux/slab.h>
+#include <linux/genhd.h>
 #include <linux/smp.h>
 #include <linux/signal.h>
 #include <linux/module.h>
@@ -377,7 +378,6 @@ static int stram_read_proc(char *page, char **start, off_t off,
 #endif
 
 #ifdef CONFIG_BLOCK
-extern const struct seq_operations partitions_op;
 static int partitions_open(struct inode *inode, struct file *file)
 {
        return seq_open(file, &partitions_op);
@@ -389,7 +389,6 @@ static const struct file_operations proc_partitions_operations = {
        .release        = seq_release,
 };
 
-extern const struct seq_operations diskstats_op;
 static int diskstats_open(struct inode *inode, struct file *file)
 {
        return seq_open(file, &diskstats_op);
index 6841452e0dea00620cd2053f9cd02356f94f6169..393cc22c1717d582dc9e03d401ec514fd8ac4c99 100644 (file)
@@ -2031,7 +2031,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
                return -EXDEV;
        }
        /* We must not pack tails for quota files on reiserfs for quota IO to work */
-       if (!REISERFS_I(nd.path.dentry->d_inode)->i_flags & i_nopack_mask) {
+       if (!(REISERFS_I(nd.path.dentry->d_inode)->i_flags & i_nopack_mask)) {
                reiserfs_warning(sb,
                                 "reiserfs: Quota file must have tail packing disabled.");
                path_put(&nd.path);
index 9b559ee711a8e59f8e12fb0029b4d5a0356b7df4..0670c915cd35c5e8b653494d4d5b1efe76867e2e 100644 (file)
@@ -1669,6 +1669,13 @@ static int link_pipe(struct pipe_inode_info *ipipe,
                i++;
        } while (len);
 
+       /*
+        * return EAGAIN if we have the potential of some data in the
+        * future, otherwise just return 0
+        */
+       if (!ret && ipipe->waiting_writers && (flags & SPLICE_F_NONBLOCK))
+               ret = -EAGAIN;
+
        inode_double_unlock(ipipe->inode, opipe->inode);
 
        /*
@@ -1709,11 +1716,8 @@ static long do_tee(struct file *in, struct file *out, size_t len,
                ret = link_ipipe_prep(ipipe, flags);
                if (!ret) {
                        ret = link_opipe_prep(opipe, flags);
-                       if (!ret) {
+                       if (!ret)
                                ret = link_pipe(ipipe, opipe, len, flags);
-                               if (!ret && (flags & SPLICE_F_NONBLOCK))
-                                       ret = -EAGAIN;
-                       }
                }
        }
 
index 88811f60c8de517829ce7828c1971bfb4f90d8a1..010446d8c40a03512e4c1a8dc689581a67c5bbf3 100644 (file)
@@ -870,12 +870,12 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
        if (!mnt)
                goto out;
 
-       if (data) {
+       if (data && !(type->fs_flags & FS_BINARY_MOUNTDATA)) {
                secdata = alloc_secdata();
                if (!secdata)
                        goto out_mnt;
 
-               error = security_sb_copy_data(type, data, secdata);
+               error = security_sb_copy_data(data, secdata);
                if (error)
                        goto out_free_secdata;
        }
index f01b07687faf93103ff7964f266607b3a6a3ce17..8e09b71f4104a91e0e6e2ba00ce8384d1b780499 100644 (file)
@@ -235,6 +235,7 @@ finish_inode:
         */
        new_icl = kmem_zone_alloc(xfs_icluster_zone, KM_SLEEP);
        if (radix_tree_preload(GFP_KERNEL)) {
+               xfs_idestroy(ip);
                delay(1);
                goto again;
        }
index 4d6330eddc8d32e60ddfc8228290d904665b7cf6..76d470d8a1e63b8ece4dc74ffb69881f057eeb13 100644 (file)
@@ -261,16 +261,19 @@ xfsaild_push(
                xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE);
        }
 
-       /*
-        * We reached the target so wait a bit longer for I/O to complete and
-        * remove pushed items from the AIL before we start the next scan from
-        * the start of the AIL.
-        */
-       if ((XFS_LSN_CMP(lsn, target) >= 0)) {
+       if (!count) {
+               /* We're past our target or empty, so idle */
+               tout = 1000;
+       } else if (XFS_LSN_CMP(lsn, target) >= 0) {
+               /*
+                * We reached the target so wait a bit longer for I/O to
+                * complete and remove pushed items from the AIL before we
+                * start the next scan from the start of the AIL.
+                */
                tout += 20;
                last_pushed_lsn = 0;
        } else if ((restarts > XFS_TRANS_PUSH_AIL_RESTARTS) ||
-                  (count && ((stuck * 100) / count > 90))) {
+                  ((stuck * 100) / count > 90)) {
                /*
                 * Either there is a lot of contention on the AIL or we
                 * are stuck due to operations in progress. "Stuck" in this
index 4e7bd32288ae6196a2fa5082173d5510cacd0b7a..c042194d3ab55fc19be196d9db37640d260f224b 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/ptrace.h>
 #include <linux/percpu.h>
 
-#define ARCH_SUPPORTS_KRETPROBES
 #define __ARCH_WANT_KPROBES_INSN_SLOT
 #define MAX_INSN_SIZE                  2
 #define MAX_STACK_SIZE                 64      /* 32 would probably be OK */
index b5eb67596ad59e79df4e891d4c42541b57b341d0..f55ec3c23a924eacd227f23ece059d4d06936933 100644 (file)
@@ -73,7 +73,7 @@ static inline void destroy_context(struct mm_struct *mm)
        struct sram_list_struct *tmp;
 
        if (current_l1_stack_save == mm->context.l1_stack_save)
-               current_l1_stack_save = 0;
+               current_l1_stack_save = NULL;
        if (mm->context.l1_stack_save)
                free_l1stack();
 
index e98167358d262a6a847bb7d791f565700b6f12e9..c18a399f6e3ed863a64693eeaa573b04465cd0d0 100644 (file)
 #define __NR_epoll_pwait       346
 #define __NR_utimensat         347
 #define __NR_signalfd          348
-#define __NR_timerfd           349
+#define __NR_timerfd_create    349
 #define __NR_eventfd           350
 #define __NR_pread64           351
 #define __NR_pwrite64          352
 #define __NR_get_robust_list   355
 #define __NR_fallocate         356
 #define __NR_semtimedop                357
+#define __NR_timerfd_settime   358
+#define __NR_timerfd_gettime   359
 
-#define __NR_syscall           358
+#define __NR_syscall           360
 #define NR_syscalls            __NR_syscall
 
 /* Old optional stuff no one actually uses */
index 69d48a2dc8e13ee15fa7c493fbe89eadc9bbaac9..ea11eaf0e922dfef1018ddae25fbee4625595e26 100644 (file)
@@ -1,43 +1,6 @@
 /* 
  * Authors:    Bjorn Wesen (bjornw@axis.com)
  *            Hans-Peter Nilsson (hp@axis.com)
- *
- * $Log: uaccess.h,v $
- * Revision 1.8  2001/10/29 13:01:48  bjornw
- * Removed unused variable tmp2 in strnlen_user
- *
- * Revision 1.7  2001/10/02 12:44:52  hp
- * Add support for 64-bit put_user/get_user
- *
- * Revision 1.6  2001/10/01 14:51:17  bjornw
- * Added register prefixes and removed underscores
- *
- * Revision 1.5  2000/10/25 03:33:21  hp
- * - Provide implementation for everything else but get_user and put_user;
- *   copying inline to/from user for constant length 0..16, 20, 24, and
- *   clearing for 0..4, 8, 12, 16, 20, 24, strncpy_from_user and strnlen_user
- *   always inline.
- * - Constraints for destination addr in get_user cannot be memory, only reg.
- * - Correct labels for PC at expected fault points.
- * - Nits with assembly code.
- * - Don't use statement expressions without value; use "do {} while (0)".
- * - Return correct values from __generic_... functions.
- *
- * Revision 1.4  2000/09/12 16:28:25  bjornw
- * * Removed comments from the get/put user asm code
- * * Constrains for destination addr in put_user cannot be memory, only reg
- *
- * Revision 1.3  2000/09/12 14:30:20  bjornw
- * MAX_ADDR_USER does not exist anymore
- *
- * Revision 1.2  2000/07/13 15:52:48  bjornw
- * New user-access functions
- *
- * Revision 1.1.1.1  2000/07/10 16:32:31  bjornw
- * CRIS architecture, working draft
- *
- *
- *
  */
 
 /* Asm:s have been tweaked (within the domain of correctness) to give
@@ -209,9 +172,9 @@ extern long __get_user_bad(void);
 /* More complex functions.  Most are inline, but some call functions that
    live in lib/usercopy.c  */
 
-extern unsigned long __copy_user(void *to, const void *from, unsigned long n);
-extern unsigned long __copy_user_zeroing(void *to, const void *from, unsigned long n);
-extern unsigned long __do_clear_user(void *to, unsigned long n);
+extern unsigned long __copy_user(void __user *to, const void *from, unsigned long n);
+extern unsigned long __copy_user_zeroing(void *to, const void __user *from, unsigned long n);
+extern unsigned long __do_clear_user(void __user *to, unsigned long n);
 
 static inline unsigned long
 __generic_copy_to_user(void __user *to, const void *from, unsigned long n)
@@ -253,7 +216,7 @@ strncpy_from_user(char *dst, const char __user *src, long count)
 }
 
 
-/* Note that if these expand awfully if made into switch constructs, so
+/* Note that these expand awfully if made into switch constructs, so
    don't do that.  */
 
 static inline unsigned long
@@ -407,19 +370,21 @@ __constant_clear_user(void __user *to, unsigned long n)
  */
 
 static inline unsigned long
-__generic_copy_from_user_nocheck(void *to, const void *from, unsigned long n)
+__generic_copy_from_user_nocheck(void *to, const void __user *from,
+                                unsigned long n)
 {
        return __copy_user_zeroing(to,from,n);
 }
 
 static inline unsigned long
-__generic_copy_to_user_nocheck(void *to, const void *from, unsigned long n)
+__generic_copy_to_user_nocheck(void __user *to, const void *from,
+                              unsigned long n)
 {
        return __copy_user(to,from,n);
 }
 
 static inline unsigned long
-__generic_clear_user_nocheck(void *to, unsigned long n)
+__generic_clear_user_nocheck(void __user *to, unsigned long n)
 {
        return __do_clear_user(to,n);
 }
index 007cb16a6b5b7cc4b59606485ecf24aaf28a9858..76398ef87e9bcb730c864a624ed77b88be08068a 100644 (file)
 #define __NR_timerfd_create    322
 #define __NR_eventfd           323
 #define __NR_fallocate         324
-#define __NR_timerfd_settime    315
-#define __NR_timerfd_gettime    316
+#define __NR_timerfd_settime   325
+#define __NR_timerfd_gettime   326
 
 #ifdef __KERNEL__
 
-#define NR_syscalls 325
+#define NR_syscalls 327
 
 #include <asm/arch/unistd.h>
 
index 4a1e48b9f4031b2808d973d2679e7a52cdbbab11..eb24a3f47caa212b94b7d2c1736ea7be2b59e992 100644 (file)
@@ -3,7 +3,6 @@ include include/asm-generic/Kbuild.asm
 header-y += break.h
 header-y += fpu.h
 header-y += fpswa.h
-header-y += gcc_intrin.h
 header-y += ia64regs.h
 header-y += intel_intrin.h
 header-y += intrinsics.h
@@ -12,5 +11,6 @@ header-y += ptrace_offsets.h
 header-y += rse.h
 header-y += ucontext.h
 
+unifdef-y += gcc_intrin.h
 unifdef-y += perfmon.h
 unifdef-y += ustack.h
index 7e6e3779670a3c82690a92d357d0d992247fba12..76366dc9c1a0473ead7124ddce204252537d8ebc 100644 (file)
@@ -93,6 +93,9 @@ extern __u8 isa_irq_to_vector_map[16];
 struct irq_cfg {
        ia64_vector vector;
        cpumask_t domain;
+       cpumask_t old_domain;
+       unsigned move_cleanup_count;
+       u8 move_in_progress : 1;
 };
 extern spinlock_t vector_lock;
 extern struct irq_cfg irq_cfg[NR_IRQS];
@@ -106,12 +109,19 @@ extern int assign_irq_vector (int irq);   /* allocate a free vector */
 extern void free_irq_vector (int vector);
 extern int reserve_irq_vector (int vector);
 extern void __setup_vector_irq(int cpu);
-extern int reassign_irq_vector(int irq, int cpu);
 extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
 extern void register_percpu_irq (ia64_vector vec, struct irqaction *action);
 extern int check_irq_used (int irq);
 extern void destroy_and_reserve_irq (unsigned int irq);
 
+#if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG))
+extern int irq_prepare_move(int irq, int cpu);
+extern void irq_complete_move(unsigned int irq);
+#else
+static inline int irq_prepare_move(int irq, int cpu) { return 0; }
+static inline void irq_complete_move(unsigned int irq) {}
+#endif
+
 static inline void ia64_resend_irq(unsigned int vector)
 {
        platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0);
index a93ce9ef07ff7a5497a4806d99df460030b080aa..d03bf9ff68e376b76aa3a27545c55f9cf164d982 100644 (file)
@@ -82,7 +82,6 @@ struct kprobe_ctlblk {
        struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ];
 };
 
-#define ARCH_SUPPORTS_KRETPROBES
 #define kretprobe_blacklist_size 0
 
 #define SLOT0_OPCODE_SHIFT     (37)
@@ -118,14 +117,10 @@ struct arch_specific_insn {
        unsigned short slot;
 };
 
-extern int kprobes_fault_handler(struct pt_regs *regs, int trapnr);
+extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
 extern int kprobe_exceptions_notify(struct notifier_block *self,
                                    unsigned long val, void *data);
 
-/* ia64 does not need this */
-static inline void jprobe_return(void)
-{
-}
 extern void invalidate_stacked_regs(void);
 extern void flush_register_stack(void);
 extern void arch_remove_kprobe(struct kprobe *p);
index 0bdce7dde1b01b6f75067447b10d2a4b6d2c036a..4b2a8d40ebc5ed398538a5aa63650605b561d803 100644 (file)
@@ -233,8 +233,6 @@ struct switch_stack {
 #include <asm/current.h>
 #include <asm/page.h>
 
-#define __ARCH_SYS_PTRACE      1
-
 /*
  * We use the ia64_psr(regs)->ri to determine which of the three
  * instructions in bundle (16 bytes) took the sample. Generate
@@ -314,6 +312,13 @@ struct switch_stack {
   #define arch_ptrace_attach(child) \
        ptrace_attach_sync_user_rbs(child)
 
+  #define arch_has_single_step()  (1)
+  extern void user_enable_single_step(struct task_struct *);
+  extern void user_disable_single_step(struct task_struct *);
+
+  #define arch_has_block_step()   (1)
+  extern void user_enable_block_step(struct task_struct *);
+
 #endif /* !__KERNEL__ */
 
 /* pt_all_user_regs is used for PTRACE_GETREGS PTRACE_SETREGS */
index 2251118894ae0005f193a2befa8c5a11b963f4e0..f4904db3b0573c486d7bfe303076245d8d76a8f1 100644 (file)
@@ -807,6 +807,10 @@ static inline s64
 ia64_sal_physical_id_info(u16 *splid)
 {
        struct ia64_sal_retval isrv;
+
+       if (sal_revision < SAL_VERSION_CODE(3,2))
+               return -1;
+
        SAL_CALL(isrv, SAL_PHYSICAL_ID_INFO, 0, 0, 0, 0, 0, 0, 0);
        if (splid)
                *splid = isrv.v0;
index 87f77b11931772245001d68e10ea863d3de446eb..e72ba563f10229389eb429417e39815e370662e4 100644 (file)
 #define __NR_epoll_pwait       315
 #define __NR_utimensat         316
 #define __NR_signalfd          317
-#define __NR_timerfd           318
+#define __NR_timerfd_create    318
 #define __NR_eventfd           319
 #define __NR_fallocate         320
+#define __NR_timerfd_settime   321
+#define __NR_timerfd_gettime   322
 
 #ifdef __KERNEL__
 
-#define NR_syscalls            321
+#define NR_syscalls            323
 
 #define __ARCH_WANT_IPC_PARSE_VERSION
 #define __ARCH_WANT_OLD_READDIR
index 1cf26d240d839922d97e2aceb8cbcc5618b477c7..de9f47a51cc215e04d19f1a40fb413045d9d572b 100644 (file)
@@ -21,4 +21,6 @@ extern void (*mach_power_off)( void );
 
 extern void config_BSP(char *command, int len);
 
+extern void do_IRQ(int irq, struct pt_regs *fp);
+
 #endif /* _M68KNOMMU_MACHDEP_H */
index 27c2f9bb4dbdd7a6528203ccd3a98e95b17486ab..4ba98b9c5d799abc7b6df69f1477bd57fd1d3eaf 100644 (file)
 #define __NR_epoll_pwait       315
 #define __NR_utimensat         316
 #define __NR_signalfd          317
-#define __NR_timerfd           318
+#define __NR_timerfd_create    318
 #define __NR_eventfd           319
 #define __NR_fallocate         320
+#define __NR_timerfd_settime   321
+#define __NR_timerfd_gettime   322
 
 #ifdef __KERNEL__
 
-#define NR_syscalls            321
+#define NR_syscalls            323
 
 #define __ARCH_WANT_IPC_PARSE_VERSION
 #define __ARCH_WANT_OLD_READDIR
index 79384c537dc6299c9d352ed1cbcea52b03704542..c68e1680da0173d5754d1a1df4944120a5239e58 100644 (file)
@@ -1,5 +1 @@
 include include/asm-generic/Kbuild.asm
-
-unifdef-y += termios.h
-unifdef-y += ptrace.h
-unifdef-y += page.h
index afabad230dbb4f212d057449f03f3fec3b79d171..d0e7701fa1f6cbff19370ef0a2dc6e4856e5a27f 100644 (file)
@@ -80,7 +80,6 @@ typedef unsigned int kprobe_opcode_t;
 #define is_trap(instr) (IS_TW(instr) || IS_TWI(instr))
 #endif
 
-#define ARCH_SUPPORTS_KRETPROBES
 #define flush_insn_slot(p)     do { } while (0)
 #define kretprobe_blacklist_size 0
 
index d1332bbcbd9ba29eee90b389cffdc6ea90d3e5ca..2c79f550272bf08bade81d3ec7cd3eb88e02895a 100644 (file)
@@ -339,14 +339,6 @@ extern int icache_44x_need_flush;
 #define _PMD_PAGE_MASK 0x000c
 #define _PMD_PAGE_8M   0x000c
 
-/*
- * The 8xx TLB miss handler allegedly sets _PAGE_ACCESSED in the PTE
- * for an address even if _PAGE_PRESENT is not set, as a performance
- * optimization.  This is a bug if you ever want to use swap unless
- * _PAGE_ACCESSED is 2, which it isn't, or unless you have 8xx-specific
- * definitions for __swp_entry etc. below, which would be gross.
- *  -- paulus
- */
 #define _PTE_NONE_MASK _PAGE_ACCESSED
 
 #else /* CONFIG_6xx */
index 69347bdbb4015617eb2ac5c30d615a32d0af654b..70435d32129a5dd3ea43335ed46755148ac4fe3e 100644 (file)
@@ -299,14 +299,6 @@ extern unsigned long ioremap_bot, ioremap_base;
 #define _PMD_PAGE_MASK 0x000c
 #define _PMD_PAGE_8M   0x000c
 
-/*
- * The 8xx TLB miss handler allegedly sets _PAGE_ACCESSED in the PTE
- * for an address even if _PAGE_PRESENT is not set, as a performance
- * optimization.  This is a bug if you ever want to use swap unless
- * _PAGE_ACCESSED is 2, which it isn't, or unless you have 8xx-specific
- * definitions for __swp_entry etc. below, which would be gross.
- *  -- paulus
- */
 #define _PTE_NONE_MASK _PAGE_ACCESSED
 
 #else /* CONFIG_6xx */
index 948db3d0d05c194d4715706fe4c932a781d23e4e..330f68caffe4b167eb70ed5d79db31cb48078919 100644 (file)
@@ -46,7 +46,6 @@ typedef u16 kprobe_opcode_t;
        ? (MAX_STACK_SIZE) \
        : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
 
-#define ARCH_SUPPORTS_KRETPROBES
 #define kretprobe_blacklist_size 0
 
 #define KPROBE_SWAP_INST       0x10
index d5d464041003bb68104895c2e54ca5d32a46f195..4b16bf9b56bdcefb528b7115ea9954dd154c8b59 100644 (file)
@@ -15,7 +15,6 @@ extern void __ndelay(unsigned long nsecs);
 extern void __const_udelay(unsigned long xloops);
 extern void __delay(unsigned long loops);
 
-#ifdef CONFIG_SUPERH32
 #define udelay(n) (__builtin_constant_p(n) ? \
        ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
        __udelay(n))
@@ -23,9 +22,5 @@ extern void __delay(unsigned long loops);
 #define ndelay(n) (__builtin_constant_p(n) ? \
        ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
        __ndelay(n))
-#else
-extern void udelay(unsigned long usecs);
-extern void ndelay(unsigned long nsecs);
-#endif
 
 #endif /* __ASM_SH_DELAY_H */
index 45e47c159a6e55316e74a35cdd2303b8fb0586a0..4e08210cd4c2a33b22eceb46c1788071deae9cdc 100644 (file)
@@ -44,6 +44,8 @@ extern enum sparc_cpu sparc_cpu_model;
 
 #define SUN4M_NCPUS            4              /* Architectural limit of sun4m. */
 
+extern char reboot_command[];
+
 extern struct thread_info *current_set[NR_CPUS];
 
 extern unsigned long empty_bad_page;
index 7237dd87663ec4857f9ae957c54acad25831745e..5879d71afdaa799b2bd18f038ee390e680390c4c 100644 (file)
@@ -14,8 +14,6 @@ typedef u32 kprobe_opcode_t;
 
 #define arch_remove_kprobe(p)  do {} while (0)
 
-#define ARCH_SUPPORTS_KRETPROBES
-
 #define flush_insn_slot(p)             \
 do {   flushi(&(p)->ainsn.insn[0]);    \
        flushi(&(p)->ainsn.insn[1]);    \
index ed91a5d8d4f05dce3c5ebe2f54d5e3f0ce510907..53eae091a171920d90dbc083d5fb96d0a8f67b3e 100644 (file)
@@ -30,6 +30,8 @@ enum sparc_cpu {
 #define ARCH_SUN4C_SUN4 0
 #define ARCH_SUN4 0
 
+extern char reboot_command[];
+
 /* These are here in an effort to more fully work around Spitfire Errata
  * #51.  Essentially, if a memory barrier occurs soon after a mispredicted
  * branch, the chip can stop executing instructions until a trap occurs.
index b04a7ff46df17c2261476741b6e704c8d65ccd52..3b8160a2b47e0eaa145610a3b092b40769a9cd92 100644 (file)
@@ -16,7 +16,6 @@ unifdef-y += ist.h
 unifdef-y += mce.h
 unifdef-y += msr.h
 unifdef-y += mtrr.h
-unifdef-y += page.h
 unifdef-y += posix_types_32.h
 unifdef-y += posix_types_64.h
 unifdef-y += ptrace.h
index 143476a3cb52c8328dc653c5b60b535ea5248f30..61ad7b5d142e1d4cc1baae2d18e186369c7907c9 100644 (file)
@@ -42,7 +42,6 @@ typedef u8 kprobe_opcode_t;
        : (((unsigned long)current_thread_info()) + THREAD_SIZE \
           - (unsigned long)(ADDR)))
 
-#define ARCH_SUPPORTS_KRETPROBES
 #define flush_insn_slot(p)     do { } while (0)
 
 extern const int kretprobe_blacklist_size;
index b478efa971e0e80ef27cc7fff3bff4aefdd410ce..a842c7222b1eef0f598a8de4a4c5375506e0b2c5 100644 (file)
@@ -91,9 +91,7 @@ extern unsigned long pg0[];
 /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */
 #define pmd_none(x)    (!(unsigned long)pmd_val(x))
 #define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT)
-#define        pmd_bad(x)      ((pmd_val(x) \
-                         & ~(PAGE_MASK | _PAGE_USER | _PAGE_PSE | _PAGE_NX)) \
-                        != _KERNPG_TABLE)
+#define        pmd_bad(x)      ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
 
 
 #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
index 0a9258333cbd013ab05b5154375054aab61d6fe0..0a0b77bc736a82171beb2f50d39df7a6e2aae947 100644 (file)
@@ -153,14 +153,12 @@ static inline unsigned long pgd_bad(pgd_t pgd)
 
 static inline unsigned long pud_bad(pud_t pud)
 {
-       return pud_val(pud) &
-               ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER | _PAGE_PSE | _PAGE_NX);
+       return pud_val(pud) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
 }
 
 static inline unsigned long pmd_bad(pmd_t pmd)
 {
-       return pmd_val(pmd) &
-               ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER | _PAGE_PSE | _PAGE_NX);
+       return pmd_val(pmd) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
 }
 
 #define pte_none(x)    (!pte_val(x))
index 2ba42cd7d6aa4c4fa708ba2733b6a20a59c3c526..a8f12644a13c73f6a7044ca0d1d206ca0b0565d9 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <crypto/algapi.h>
 #include <crypto/skcipher.h>
+#include <linux/init.h>
 #include <linux/types.h>
 
 struct rtattr;
@@ -64,6 +65,11 @@ void skcipher_geniv_free(struct crypto_instance *inst);
 int skcipher_geniv_init(struct crypto_tfm *tfm);
 void skcipher_geniv_exit(struct crypto_tfm *tfm);
 
+int __init eseqiv_module_init(void);
+void __exit eseqiv_module_exit(void);
+int __init chainiv_module_init(void);
+void __exit chainiv_module_exit(void);
+
 static inline struct crypto_ablkcipher *skcipher_geniv_cipher(
        struct crypto_ablkcipher *geniv)
 {
index aada32fffec2b18fa0ae39516ea0622fcfcba631..994df3780007c7da7ea42f773cb67b50ffd9e81b 100644 (file)
@@ -61,6 +61,7 @@ header-y += efs_fs_sb.h
 header-y += elf-fdpic.h
 header-y += elf-em.h
 header-y += fadvise.h
+header-y += falloc.h
 header-y += fd.h
 header-y += fdreg.h
 header-y += fib_rules.h
index 6fe67d1939c27919c0f53396da0718d58ef71b42..6f79d40dd3c01f25c105b9bdae4f5e70a7c88e1e 100644 (file)
@@ -216,8 +216,8 @@ struct request {
        unsigned int cmd_len;
        unsigned char cmd[BLK_MAX_CDB];
 
-       unsigned int raw_data_len;
        unsigned int data_len;
+       unsigned int extra_len; /* length of alignment and padding */
        unsigned int sense_len;
        void *data;
        void *sense;
@@ -362,6 +362,7 @@ struct request_queue
        unsigned long           seg_boundary_mask;
        void                    *dma_drain_buffer;
        unsigned int            dma_drain_size;
+       unsigned int            dma_pad_mask;
        unsigned int            dma_alignment;
 
        struct blk_queue_tag    *queue_tags;
@@ -701,6 +702,7 @@ extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short);
 extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
 extern void blk_queue_hardsect_size(struct request_queue *, unsigned short);
 extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b);
+extern void blk_queue_dma_pad(struct request_queue *, unsigned int);
 extern int blk_queue_dma_drain(struct request_queue *q,
                               dma_drain_needed_fn *dma_drain_needed,
                               void *buf, unsigned int size);
index ac6aad98b6073ef7cd3a16b088b02ffccaadae32..1ddebfc52565f3eb4894c422c1fc5dd831ae523c 100644 (file)
@@ -37,7 +37,7 @@ SUBSYS(cpuacct)
 
 /* */
 
-#ifdef CONFIG_CGROUP_MEM_CONT
+#ifdef CONFIG_CGROUP_MEM_RES_CTLR
 SUBSYS(mem_cgroup)
 #endif
 
index d0e17e1657dca11b86f151084a10bc87204c80a1..dcae0c8d97e6e2d04a8db04494e899eb403e1c18 100644 (file)
@@ -138,6 +138,12 @@ extern void __chk_io_ptr(const volatile void __iomem *);
 #define noinline
 #endif
 
+/*
+ * Rather then using noinline to prevent stack consumption, use
+ * noinline_for_stack instead.  For documentaiton reasons.
+ */
+#define noinline_for_stack noinline
+
 #ifndef __always_inline
 #define __always_inline inline
 #endif
index f592d6de3b971592a2b289e57175d776c212f3b1..7266124361b44f24259db727c7dc23d0694fb8de 100644 (file)
@@ -27,6 +27,11 @@ struct debugfs_blob_wrapper {
 };
 
 #if defined(CONFIG_DEBUG_FS)
+
+/* declared over in file.c */
+extern const struct file_operations debugfs_file_operations;
+extern const struct inode_operations debugfs_link_operations;
+
 struct dentry *debugfs_create_file(const char *name, mode_t mode,
                                   struct dentry *parent, void *data,
                                   const struct file_operations *fops);
index 17ddb55430ae19c28704a3da24f230b7a2e2ff6a..54552d21296efe9037de1d034ef45cafa4199067 100644 (file)
@@ -7,6 +7,8 @@
  * Delay routines, using a pre-computed "loops_per_jiffy" value.
  */
 
+#include <linux/kernel.h>
+
 extern unsigned long loops_per_jiffy;
 
 #include <asm/delay.h>
@@ -32,7 +34,11 @@ extern unsigned long loops_per_jiffy;
 #endif
 
 #ifndef ndelay
-#define ndelay(x)      udelay(((x)+999)/1000)
+static inline void ndelay(unsigned long x)
+{
+       udelay(DIV_ROUND_UP(x, 1000));
+}
+#define ndelay(x) ndelay(x)
 #endif
 
 void calibrate_delay(void);
index acbb364674ff1f8516f50747d0d48375f15df49a..261e43a4c873042c687138db87e9e1a242e6ffd8 100644 (file)
@@ -366,7 +366,7 @@ __dma_has_cap(enum dma_transaction_type tx_type, dma_cap_mask_t *srcp)
  */
 static inline void dma_async_issue_pending(struct dma_chan *chan)
 {
-       return chan->device->device_issue_pending(chan);
+       chan->device->device_issue_pending(chan);
 }
 
 #define dma_async_memcpy_issue_pending(chan) dma_async_issue_pending(chan)
index 09a3b18918c70d89c9ab795ce40620d4c0067803..32c2ac49a07071c67264c854707aebe8ae03850f 100644 (file)
 #define dev_to_disk(device) container_of(device, struct gendisk, dev)
 #define dev_to_part(device) container_of(device, struct hd_struct, dev)
 
-extern struct device_type disk_type;
 extern struct device_type part_type;
 extern struct kobject *block_depr;
 extern struct class block_class;
 
+extern const struct seq_operations partitions_op;
+extern const struct seq_operations diskstats_op;
+
 enum {
 /* These three have identical behaviour; use the second one if DOS FDISK gets
    confused about extended/logical partitions starting past cylinder 1023. */
@@ -556,7 +558,6 @@ extern struct gendisk *alloc_disk_node(int minors, int node_id);
 extern struct gendisk *alloc_disk(int minors);
 extern struct kobject *get_disk(struct gendisk *disk);
 extern void put_disk(struct gendisk *disk);
-extern void genhd_media_change_notify(struct gendisk *disk);
 extern void blk_register_region(dev_t devt, unsigned long range,
                        struct module *module,
                        struct kobject *(*probe)(dev_t, int *, void *),
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
new file mode 100644 (file)
index 0000000..4987a84
--- /dev/null
@@ -0,0 +1,95 @@
+#ifndef __LINUX_GPIO_H
+#define __LINUX_GPIO_H
+
+/* see Documentation/gpio.txt */
+
+#ifdef CONFIG_GENERIC_GPIO
+#include <asm/gpio.h>
+
+#else
+
+/*
+ * Some platforms don't support the GPIO programming interface.
+ *
+ * In case some driver uses it anyway (it should normally have
+ * depended on GENERIC_GPIO), these routines help the compiler
+ * optimize out much GPIO-related code ... or trigger a runtime
+ * warning when something is wrongly called.
+ */
+
+static inline int gpio_is_valid(int number)
+{
+       return 0;
+}
+
+static inline int gpio_request(unsigned gpio, const char *label)
+{
+       return -ENOSYS;
+}
+
+static inline void gpio_free(unsigned gpio)
+{
+       /* GPIO can never have been requested */
+       WARN_ON(1);
+}
+
+static inline int gpio_direction_input(unsigned gpio)
+{
+       return -ENOSYS;
+}
+
+static inline int gpio_direction_output(unsigned gpio, int value)
+{
+       return -ENOSYS;
+}
+
+static inline int gpio_get_value(unsigned gpio)
+{
+       /* GPIO can never have been requested or set as {in,out}put */
+       WARN_ON(1);
+       return 0;
+}
+
+static inline void gpio_set_value(unsigned gpio, int value)
+{
+       /* GPIO can never have been requested or set as output */
+       WARN_ON(1);
+}
+
+static inline int gpio_cansleep(unsigned gpio)
+{
+       /* GPIO can never have been requested or set as {in,out}put */
+       WARN_ON(1);
+       return 0;
+}
+
+static inline int gpio_get_value_cansleep(unsigned gpio)
+{
+       /* GPIO can never have been requested or set as {in,out}put */
+       WARN_ON(1);
+       return 0;
+}
+
+static inline void gpio_set_value_cansleep(unsigned gpio, int value)
+{
+       /* GPIO can never have been requested or set as output */
+       WARN_ON(1);
+}
+
+static inline int gpio_to_irq(unsigned gpio)
+{
+       /* GPIO can never have been requested or set as input */
+       WARN_ON(1);
+       return -EINVAL;
+}
+
+static inline int irq_to_gpio(unsigned irq)
+{
+       /* irq can never have been returned from gpio_to_irq() */
+       WARN_ON(1);
+       return -EINVAL;
+}
+
+#endif
+
+#endif /* __LINUX_GPIO_H */
index 4dd4c04ff2f468a1fddbbeb47cbf7c69bea1ed1b..c975caf75385d2e634cdb151dae416e2487533a0 100644 (file)
@@ -1,3 +1,6 @@
+extern int iommu_is_span_boundary(unsigned int index, unsigned int nr,
+                                 unsigned long shift,
+                                 unsigned long boundary_size);
 extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
                                      unsigned long start, unsigned int nr,
                                      unsigned long shift,
index 4a6ce82ba03971f832a8f325eb150907090213bc..0f28486f636067677cf9b80c1279c7da88ffc4c9 100644 (file)
@@ -125,11 +125,11 @@ struct jprobe {
 DECLARE_PER_CPU(struct kprobe *, current_kprobe);
 DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
 
-#ifdef ARCH_SUPPORTS_KRETPROBES
+#ifdef CONFIG_KRETPROBES
 extern void arch_prepare_kretprobe(struct kretprobe_instance *ri,
                                   struct pt_regs *regs);
 extern int arch_trampoline_kprobe(struct kprobe *p);
-#else /* ARCH_SUPPORTS_KRETPROBES */
+#else /* CONFIG_KRETPROBES */
 static inline void arch_prepare_kretprobe(struct kretprobe *rp,
                                        struct pt_regs *regs)
 {
@@ -138,7 +138,7 @@ static inline int arch_trampoline_kprobe(struct kprobe *p)
 {
        return 0;
 }
-#endif /* ARCH_SUPPORTS_KRETPROBES */
+#endif /* CONFIG_KRETPROBES */
 /*
  * Function-return probe -
  * Note:
index 4de4fd2d8607d19df5f9eb4cb3a88325fd3d60f8..c1ec04fd000d42d27d310ce79c92944f09d63c5f 100644 (file)
@@ -221,6 +221,7 @@ struct kvm_vapic_addr {
  * Get size for mmap(vcpu_fd)
  */
 #define KVM_GET_VCPU_MMAP_SIZE    _IO(KVMIO,   0x04) /* in bytes */
+#define KVM_GET_SUPPORTED_CPUID   _IOWR(KVMIO, 0x05, struct kvm_cpuid2)
 
 /*
  * Extension capability list.
@@ -230,8 +231,8 @@ struct kvm_vapic_addr {
 #define KVM_CAP_MMU_SHADOW_CACHE_CONTROL 2
 #define KVM_CAP_USER_MEMORY 3
 #define KVM_CAP_SET_TSS_ADDR 4
-#define KVM_CAP_EXT_CPUID 5
 #define KVM_CAP_VAPIC 6
+#define KVM_CAP_EXT_CPUID 7
 
 /*
  * ioctls for VM fds
@@ -249,7 +250,6 @@ struct kvm_vapic_addr {
 #define KVM_CREATE_VCPU           _IO(KVMIO,  0x41)
 #define KVM_GET_DIRTY_LOG         _IOW(KVMIO, 0x42, struct kvm_dirty_log)
 #define KVM_SET_MEMORY_ALIAS      _IOW(KVMIO, 0x43, struct kvm_memory_alias)
-#define KVM_GET_SUPPORTED_CPUID   _IOWR(KVMIO, 0x48, struct kvm_cpuid2)
 /* Device model IOC */
 #define KVM_CREATE_IRQCHIP       _IO(KVMIO,  0x60)
 #define KVM_IRQ_LINE             _IOW(KVMIO, 0x61, struct kvm_irq_level)
index ea4764b0a2f49dc40772be7e0ad98053a83d3084..928b0d59e9ba07d64686975f5db6022ad608ef8d 100644 (file)
@@ -107,6 +107,7 @@ struct kvm_memory_slot {
 struct kvm {
        struct mutex lock; /* protects the vcpus array and APIC accesses */
        spinlock_t mmu_lock;
+       struct rw_semaphore slots_lock;
        struct mm_struct *mm; /* userspace tied to this vm */
        int nmemslots;
        struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +
index 5df879dc3776c732dc62e017850f0eb4739429e3..430f6adf9762d175096246d92dfe999f6b6bba9c 100644 (file)
@@ -104,10 +104,16 @@ static inline void marker_update_probe_range(struct marker *begin,
 #define MARK_NOARGS " "
 
 /* To be used for string format validity checking with gcc */
-static inline void __printf(1, 2) __mark_check_format(const char *fmt, ...)
+static inline void __printf(1, 2) ___mark_check_format(const char *fmt, ...)
 {
 }
 
+#define __mark_check_format(format, args...)                           \
+       do {                                                            \
+               if (0)                                                  \
+                       ___mark_check_format(format, ## args);          \
+       } while (0)
+
 extern marker_probe_func __mark_empty_function;
 
 extern void marker_probe_cb(const struct marker *mdata,
index 04075628cb9a315d31acc90bf2bc165606d80e15..8b1c4295848b77b6808c1f451434e02e599fffb2 100644 (file)
@@ -25,18 +25,20 @@ struct page_cgroup;
 struct page;
 struct mm_struct;
 
-#ifdef CONFIG_CGROUP_MEM_CONT
+#ifdef CONFIG_CGROUP_MEM_RES_CTLR
 
 extern void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p);
 extern void mm_free_cgroup(struct mm_struct *mm);
-extern void page_assign_page_cgroup(struct page *page,
-                                       struct page_cgroup *pc);
+
+#define page_reset_bad_cgroup(page)    ((page)->page_cgroup = 0)
+
 extern struct page_cgroup *page_get_page_cgroup(struct page *page);
 extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm,
                                gfp_t gfp_mask);
-extern void mem_cgroup_uncharge(struct page_cgroup *pc);
+extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
+                                       gfp_t gfp_mask);
 extern void mem_cgroup_uncharge_page(struct page *page);
-extern void mem_cgroup_move_lists(struct page_cgroup *pc, bool active);
+extern void mem_cgroup_move_lists(struct page *page, bool active);
 extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
                                        struct list_head *dst,
                                        unsigned long *scanned, int order,
@@ -44,11 +46,9 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
                                        struct mem_cgroup *mem_cont,
                                        int active);
 extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
-extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
-                                       gfp_t gfp_mask);
 int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
 
-#define vm_match_cgroup(mm, cgroup)    \
+#define mm_match_cgroup(mm, cgroup)    \
        ((cgroup) == rcu_dereference((mm)->mem_cgroup))
 
 extern int mem_cgroup_prepare_migration(struct page *page);
@@ -72,7 +72,7 @@ extern long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem,
 extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem,
                                struct zone *zone, int priority);
 
-#else /* CONFIG_CGROUP_MEM_CONT */
+#else /* CONFIG_CGROUP_MEM_RES_CTLR */
 static inline void mm_init_cgroup(struct mm_struct *mm,
                                        struct task_struct *p)
 {
@@ -82,8 +82,7 @@ static inline void mm_free_cgroup(struct mm_struct *mm)
 {
 }
 
-static inline void page_assign_page_cgroup(struct page *page,
-                                               struct page_cgroup *pc)
+static inline void page_reset_bad_cgroup(struct page *page)
 {
 }
 
@@ -92,33 +91,27 @@ static inline struct page_cgroup *page_get_page_cgroup(struct page *page)
        return NULL;
 }
 
-static inline int mem_cgroup_charge(struct page *page, struct mm_struct *mm,
-                                       gfp_t gfp_mask)
+static inline int mem_cgroup_charge(struct page *page,
+                                       struct mm_struct *mm, gfp_t gfp_mask)
 {
        return 0;
 }
 
-static inline void mem_cgroup_uncharge(struct page_cgroup *pc)
+static inline int mem_cgroup_cache_charge(struct page *page,
+                                       struct mm_struct *mm, gfp_t gfp_mask)
 {
+       return 0;
 }
 
 static inline void mem_cgroup_uncharge_page(struct page *page)
 {
 }
 
-static inline void mem_cgroup_move_lists(struct page_cgroup *pc,
-                                               bool active)
-{
-}
-
-static inline int mem_cgroup_cache_charge(struct page *page,
-                                               struct mm_struct *mm,
-                                               gfp_t gfp_mask)
+static inline void mem_cgroup_move_lists(struct page *page, bool active)
 {
-       return 0;
 }
 
-static inline int vm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem)
+static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem)
 {
        return 1;
 }
index bfee0bd1d43545742504225e0ab0754a315e7aa9..af190ceab9719dc68b148e3b22b05b28a54c64d2 100644 (file)
@@ -64,10 +64,7 @@ struct page {
 #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
            spinlock_t ptl;
 #endif
-           struct {
-                  struct kmem_cache *slab;     /* SLUB: Pointer to slab */
-                  void *end;                   /* SLUB: end marker */
-           };
+           struct kmem_cache *slab;    /* SLUB: Pointer to slab */
            struct page *first_page;    /* Compound tail pages */
        };
        union {
@@ -91,7 +88,7 @@ struct page {
        void *virtual;                  /* Kernel virtual address (NULL if
                                           not kmapped, ie. highmem) */
 #endif /* WANT_PAGE_VIRTUAL */
-#ifdef CONFIG_CGROUP_MEM_CONT
+#ifdef CONFIG_CGROUP_MEM_RES_CTLR
        unsigned long page_cgroup;
 #endif
 };
@@ -225,7 +222,7 @@ struct mm_struct {
        /* aio bits */
        rwlock_t                ioctx_list_lock;
        struct kioctx           *ioctx_list;
-#ifdef CONFIG_CGROUP_MEM_CONT
+#ifdef CONFIG_CGROUP_MEM_RES_CTLR
        struct mem_cgroup *mem_cgroup;
 #endif
 };
index a0525a1f4715d7cce2e1e883070b75a655b12359..e3d79593fb3a53186523071b4e22d6fbee47e79a 100644 (file)
@@ -25,6 +25,7 @@ struct netpoll {
 
 struct netpoll_info {
        atomic_t refcnt;
+       int rx_flags;
        spinlock_t rx_lock;
        struct netpoll *rx_np; /* netpoll that registered an rx_hook */
        struct sk_buff_head arp_tx; /* list of arp requests to reply to */
@@ -50,12 +51,12 @@ static inline int netpoll_rx(struct sk_buff *skb)
        unsigned long flags;
        int ret = 0;
 
-       if (!npinfo || !npinfo->rx_np)
+       if (!npinfo || (!npinfo->rx_np && !npinfo->rx_flags))
                return 0;
 
        spin_lock_irqsave(&npinfo->rx_lock, flags);
-       /* check rx_np again with the lock held */
-       if (npinfo->rx_np && __netpoll_rx(skb))
+       /* check rx_flags again with the lock held */
+       if (npinfo->rx_flags && __netpoll_rx(skb))
                ret = 1;
        spin_unlock_irqrestore(&npinfo->rx_lock, flags);
 
index 87195b62de5261cf0bc6dd31e171386de769ccdf..f3165e7ac4312529b29b81db910855338500f62e 100644 (file)
@@ -388,6 +388,16 @@ struct pci_driver {
 
 #define        to_pci_driver(drv) container_of(drv, struct pci_driver, driver)
 
+/**
+ * DECLARE_PCI_DEVICE_TABLE - macro used to describe a pci device table
+ * @_table: device table name
+ *
+ * This macro is used to create a struct pci_device_id array (a device table)
+ * in a generic manner.
+ */
+#define DECLARE_PCI_DEVICE_TABLE(_table) \
+       const struct pci_device_id _table[] __devinitconst
+
 /**
  * PCI_DEVICE - macro used to describe a specific pci device
  * @vend: the 16 bit PCI Vendor ID
index e51b531cd0b2d970631bc6097019869b74c55830..47fbcba118506c04f628e7a0337067f9ea94fa86 100644 (file)
@@ -235,6 +235,8 @@ struct bitmap {
 
        unsigned long flags;
 
+       int allclean;
+
        unsigned long max_write_behind; /* write-behind mode */
        atomic_t behind_writes;
 
index 85a068bab625a85d9a62e34859eed5e580a31b16..7bb6d1abf71e85944bc20e82243cc88df8353e71 100644 (file)
@@ -83,6 +83,7 @@ struct mdk_rdev_s
 #define        BarriersNotsupp 5               /* BIO_RW_BARRIER is not supported */
 #define        AllReserved     6               /* If whole device is reserved for
                                         * one array */
+#define        AutoDetected    7               /* added by auto-detect */
 
        int desc_nr;                    /* descriptor index in the superblock */
        int raid_disk;                  /* role of device in array */
index 2c9621f8bf872a2224482e509069226f9d08fd30..9ae4030067a934b23293a72fe975ab72eda19d72 100644 (file)
@@ -1542,10 +1542,6 @@ extern unsigned int sysctl_sched_child_runs_first;
 extern unsigned int sysctl_sched_features;
 extern unsigned int sysctl_sched_migration_cost;
 extern unsigned int sysctl_sched_nr_migrate;
-#if defined(CONFIG_FAIR_GROUP_SCHED) && defined(CONFIG_SMP)
-extern unsigned int sysctl_sched_min_bal_int_shares;
-extern unsigned int sysctl_sched_max_bal_int_shares;
-#endif
 
 int sched_nr_latency_handler(struct ctl_table *table, int write,
                struct file *file, void __user *buffer, size_t *length,
index fe52cdeab0a67ba5cd1220383b9bd0872efd78e1..b07357ca2137c6b6b5c3bb031336e84941f6c1a8 100644 (file)
 #include <linux/xfrm.h>
 #include <net/flow.h>
 
-/* only a char in selinux superblock security struct flags */
-#define FSCONTEXT_MNT          0x01
-#define CONTEXT_MNT            0x02
-#define ROOTCONTEXT_MNT                0x04
-#define DEFCONTEXT_MNT         0x08
-
 extern unsigned securebits;
 
 struct ctl_table;
@@ -114,6 +108,32 @@ struct request_sock;
 
 #ifdef CONFIG_SECURITY
 
+struct security_mnt_opts {
+       char **mnt_opts;
+       int *mnt_opts_flags;
+       int num_mnt_opts;
+};
+
+static inline void security_init_mnt_opts(struct security_mnt_opts *opts)
+{
+       opts->mnt_opts = NULL;
+       opts->mnt_opts_flags = NULL;
+       opts->num_mnt_opts = 0;
+}
+
+static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
+{
+       int i;
+       if (opts->mnt_opts)
+               for(i = 0; i < opts->num_mnt_opts; i++)
+                       kfree(opts->mnt_opts[i]);
+       kfree(opts->mnt_opts);
+       opts->mnt_opts = NULL;
+       kfree(opts->mnt_opts_flags);
+       opts->mnt_opts_flags = NULL;
+       opts->num_mnt_opts = 0;
+}
+
 /**
  * struct security_operations - main security structure
  *
@@ -262,19 +282,19 @@ struct request_sock;
  * @sb_get_mnt_opts:
  *     Get the security relevant mount options used for a superblock
  *     @sb the superblock to get security mount options from
- *     @mount_options array for pointers to mount options
- *     @mount_flags array of ints specifying what each mount options is
- *     @num_opts number of options in the arrays
+ *     @opts binary data structure containing all lsm mount data
  * @sb_set_mnt_opts:
  *     Set the security relevant mount options used for a superblock
  *     @sb the superblock to set security mount options for
- *     @mount_options array for pointers to mount options
- *     @mount_flags array of ints specifying what each mount options is
- *     @num_opts number of options in the arrays
+ *     @opts binary data structure containing all lsm mount data
  * @sb_clone_mnt_opts:
  *     Copy all security options from a given superblock to another
  *     @oldsb old superblock which contain information to clone
  *     @newsb new superblock which needs filled in
+ * @sb_parse_opts_str:
+ *     Parse a string of security data filling in the opts structure
+ *     @options string containing all mount options known by the LSM
+ *     @opts binary data structure usable by the LSM
  *
  * Security hooks for inode operations.
  *
@@ -1238,8 +1258,7 @@ struct security_operations {
 
        int (*sb_alloc_security) (struct super_block * sb);
        void (*sb_free_security) (struct super_block * sb);
-       int (*sb_copy_data)(struct file_system_type *type,
-                           void *orig, void *copy);
+       int (*sb_copy_data)(char *orig, char *copy);
        int (*sb_kern_mount) (struct super_block *sb, void *data);
        int (*sb_statfs) (struct dentry *dentry);
        int (*sb_mount) (char *dev_name, struct nameidata * nd,
@@ -1257,12 +1276,12 @@ struct security_operations {
        void (*sb_post_pivotroot) (struct nameidata * old_nd,
                                   struct nameidata * new_nd);
        int (*sb_get_mnt_opts) (const struct super_block *sb,
-                               char ***mount_options, int **flags,
-                               int *num_opts);
-       int (*sb_set_mnt_opts) (struct super_block *sb, char **mount_options,
-                               int *flags, int num_opts);
+                               struct security_mnt_opts *opts);
+       int (*sb_set_mnt_opts) (struct super_block *sb,
+                               struct security_mnt_opts *opts);
        void (*sb_clone_mnt_opts) (const struct super_block *oldsb,
                                   struct super_block *newsb);
+       int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts);
 
        int (*inode_alloc_security) (struct inode *inode);      
        void (*inode_free_security) (struct inode *inode);
@@ -1507,7 +1526,7 @@ int security_bprm_check(struct linux_binprm *bprm);
 int security_bprm_secureexec(struct linux_binprm *bprm);
 int security_sb_alloc(struct super_block *sb);
 void security_sb_free(struct super_block *sb);
-int security_sb_copy_data(struct file_system_type *type, void *orig, void *copy);
+int security_sb_copy_data(char *orig, char *copy);
 int security_sb_kern_mount(struct super_block *sb, void *data);
 int security_sb_statfs(struct dentry *dentry);
 int security_sb_mount(char *dev_name, struct nameidata *nd,
@@ -1520,12 +1539,12 @@ void security_sb_post_remount(struct vfsmount *mnt, unsigned long flags, void *d
 void security_sb_post_addmount(struct vfsmount *mnt, struct nameidata *mountpoint_nd);
 int security_sb_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd);
 void security_sb_post_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd);
-int security_sb_get_mnt_opts(const struct super_block *sb, char ***mount_options,
-                            int **flags, int *num_opts);
-int security_sb_set_mnt_opts(struct super_block *sb, char **mount_options,
-                            int *flags, int num_opts);
+int security_sb_get_mnt_opts(const struct super_block *sb,
+                               struct security_mnt_opts *opts);
+int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts);
 void security_sb_clone_mnt_opts(const struct super_block *oldsb,
                                struct super_block *newsb);
+int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts);
 
 int security_inode_alloc(struct inode *inode);
 void security_inode_free(struct inode *inode);
@@ -1635,6 +1654,16 @@ int security_secctx_to_secid(char *secdata, u32 seclen, u32 *secid);
 void security_release_secctx(char *secdata, u32 seclen);
 
 #else /* CONFIG_SECURITY */
+struct security_mnt_opts {
+};
+
+static inline void security_init_mnt_opts(struct security_mnt_opts *opts)
+{
+}
+
+static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
+{
+}
 
 /*
  * This is the default capabilities functionality.  Most of these functions
@@ -1762,8 +1791,7 @@ static inline int security_sb_alloc (struct super_block *sb)
 static inline void security_sb_free (struct super_block *sb)
 { }
 
-static inline int security_sb_copy_data (struct file_system_type *type,
-                                        void *orig, void *copy)
+static inline int security_sb_copy_data (char *orig, char *copy)
 {
        return 0;
 }
@@ -1819,6 +1847,27 @@ static inline int security_sb_pivotroot (struct nameidata *old_nd,
 static inline void security_sb_post_pivotroot (struct nameidata *old_nd,
                                               struct nameidata *new_nd)
 { }
+static inline int security_sb_get_mnt_opts(const struct super_block *sb,
+                                          struct security_mnt_opts *opts)
+{
+       security_init_mnt_opts(opts);
+       return 0;
+}
+
+static inline int security_sb_set_mnt_opts(struct super_block *sb,
+                                          struct security_mnt_opts *opts)
+{
+       return 0;
+}
+
+static inline void security_sb_clone_mnt_opts(const struct super_block *oldsb,
+                                             struct super_block *newsb)
+{ }
+
+static inline int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts)
+{
+       return 0;
+}
 
 static inline int security_inode_alloc (struct inode *inode)
 {
index 57deecc79d52787800aa98b72d0cefe9e556e495..b00c1c73eb0a7a3108f2fcc76d4c6fd4ee54fbb8 100644 (file)
@@ -61,7 +61,7 @@ struct kmem_cache {
        int size;               /* The size of an object including meta data */
        int objsize;            /* The size of an object without meta data */
        int offset;             /* Free pointer offset. */
-       int order;
+       int order;              /* Current preferred allocation order */
 
        /*
         * Avoid an extra cache line for UP, SMP and for the node local to
@@ -138,11 +138,11 @@ static __always_inline int kmalloc_index(size_t size)
        if (size <=        512) return 9;
        if (size <=       1024) return 10;
        if (size <=   2 * 1024) return 11;
+       if (size <=   4 * 1024) return 12;
 /*
  * The following is only needed to support architectures with a larger page
  * size than 4k.
  */
-       if (size <=   4 * 1024) return 12;
        if (size <=   8 * 1024) return 13;
        if (size <=  16 * 1024) return 14;
        if (size <=  32 * 1024) return 15;
index 64236b73c724e2bb4a8b357d8f8c50539377a9ca..d53642d2d8992d33e234d4f24f7dbe366d86cab7 100644 (file)
 
 #define SM501_DEVICEID_SM501           (0x05010000)
 #define SM501_DEVICEID_IDMASK          (0xffff0000)
+#define SM501_DEVICEID_REVMASK         (0x000000ff)
 
 #define SM501_PLLCLOCK_COUNT           (0x000064)
 #define SM501_MISC_TIMING              (0x000068)
 #define SM501_CURRENT_SDRAM_CLOCK      (0x00006C)
 
+#define SM501_PROGRAMMABLE_PLL_CONTROL (0x000074)
+
 /* GPIO base */
 #define SM501_GPIO                     (0x010000)
 #define SM501_GPIO_DATA_LOW            (0x00)
index 932a9efee8a5c7c9508b6c6a4f1caf565069825e..bca13454470025684a946cc63a59026dced33967 100644 (file)
@@ -24,7 +24,8 @@ extern int sm501_unit_power(struct device *dev,
 extern unsigned long sm501_set_clock(struct device *dev,
                                     int clksrc, unsigned long freq);
 
-extern unsigned long sm501_find_clock(int clksrc, unsigned long req_freq);
+extern unsigned long sm501_find_clock(struct device *dev,
+                                     int clksrc, unsigned long req_freq);
 
 /* sm501_misc_control
  *
index 2372e2e6b5271addb820c2c30f0f2549fe340134..583e0481dfa028cfe137156d74dd342dc5a03f9c 100644 (file)
@@ -94,10 +94,9 @@ enum usb_interface_condition {
  * @altsetting: array of interface structures, one for each alternate
  *     setting that may be selected.  Each one includes a set of
  *     endpoint configurations.  They will be in no particular order.
- * @num_altsetting: number of altsettings defined.
  * @cur_altsetting: the current altsetting.
+ * @num_altsetting: number of altsettings defined.
  * @intf_assoc: interface association descriptor
- * @driver: the USB driver that is bound to this interface.
  * @minor: the minor number assigned to this interface, if this
  *     interface is bound to a driver that uses the USB major number.
  *     If this interface does not use the USB major, this field should
@@ -781,8 +780,7 @@ static inline int usb_endpoint_is_isoc_out(
        .idVendor = (vend), \
        .idProduct = (prod)
 /**
- * USB_DEVICE_VER - macro used to describe a specific usb device with a
- *             version range
+ * USB_DEVICE_VER - describe a specific usb device with a version range
  * @vend: the 16 bit USB Vendor ID
  * @prod: the 16 bit USB Product ID
  * @lo: the bcdDevice_lo value
@@ -799,8 +797,7 @@ static inline int usb_endpoint_is_isoc_out(
        .bcdDevice_hi = (hi)
 
 /**
- * USB_DEVICE_INTERFACE_PROTOCOL - macro used to describe a usb
- *             device with a specific interface protocol
+ * USB_DEVICE_INTERFACE_PROTOCOL - describe a usb device with a specific interface protocol
  * @vend: the 16 bit USB Vendor ID
  * @prod: the 16 bit USB Product ID
  * @pr: bInterfaceProtocol value
@@ -846,8 +843,7 @@ static inline int usb_endpoint_is_isoc_out(
        .bInterfaceProtocol = (pr)
 
 /**
- * USB_DEVICE_AND_INTERFACE_INFO - macro used to describe a specific usb device
- *             with a class of usb interfaces
+ * USB_DEVICE_AND_INTERFACE_INFO - describe a specific usb device with a class of usb interfaces
  * @vend: the 16 bit USB Vendor ID
  * @prod: the 16 bit USB Product ID
  * @cl: bInterfaceClass value
index 70013c5f4e59aba0d83f7e99df4da8898d94b05f..89cd011edb998402912543b4486309055f267b8f 100644 (file)
@@ -175,7 +175,8 @@ extern void build_ehash_secret(void);
 static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport,
                                        const __be32 faddr, const __be16 fport)
 {
-       return jhash_2words((__force __u32) laddr ^ (__force __u32) faddr,
+       return jhash_3words((__force __u32) laddr,
+                           (__force __u32) faddr,
                            ((__u32) lport) << 16 | (__force __u32)fport,
                            inet_ehash_secret);
 }
index 3ffd6b582a97144cb37009ef6ef47d1ff4cd8feb..39e1cac24bb751503fdef353a764292326b32037 100644 (file)
@@ -675,5 +675,6 @@ extern int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
 
 extern void sas_ssp_task_response(struct device *dev, struct sas_task *task,
                                  struct ssp_response_iu *iu);
+struct sas_phy *sas_find_local_phy(struct domain_device *dev);
 
 #endif /* _SASLIB_H_ */
index dbc96ef4cc72020b827e6e04e4dfe0d125091e38..aab1eae2ec4c4a6d310ab79cc214d6e627ec79ea 100644 (file)
@@ -177,6 +177,8 @@ struct iscsi_cls_session {
        struct list_head host_list;
        struct iscsi_transport *transport;
        spinlock_t lock;
+       struct work_struct block_work;
+       struct work_struct unblock_work;
        struct work_struct scan_work;
        struct work_struct unbind_work;
 
index f698a5af500791ae7158457f16c9f00df503cbbb..074ac97f55e32a505ea3479ba85d0c3c619ac9e6 100644 (file)
@@ -366,10 +366,29 @@ config RESOURCE_COUNTERS
           infrastructure that works with cgroups
        depends on CGROUPS
 
+config CGROUP_MEM_RES_CTLR
+       bool "Memory Resource Controller for Control Groups"
+       depends on CGROUPS && RESOURCE_COUNTERS
+       help
+         Provides a memory resource controller that manages both page cache and
+         RSS memory.
+
+         Note that setting this option increases fixed memory overhead
+         associated with each page of memory in the system by 4/8 bytes
+         and also increases cache misses because struct page on many 64bit
+         systems will not fit into a single cache line anymore.
+
+         Only enable when you're ok with these trade offs and really
+         sure you need the memory resource controller.
+
 config SYSFS_DEPRECATED
+       bool
+
+config SYSFS_DEPRECATED_V2
        bool "Create deprecated sysfs files"
        depends on SYSFS
        default y
+       select SYSFS_DEPRECATED
        help
          This option creates deprecated symlinks such as the
          "device"-link, the <subsystem>:<name>-link, and the
@@ -382,25 +401,11 @@ config SYSFS_DEPRECATED
 
          If enabled, this option will also move any device structures
          that belong to a class, back into the /sys/class hierarchy, in
-         order to support older versions of udev.
-
-         If you are using a distro that was released in 2006 or later,
-         it should be safe to say N here.
-
-config CGROUP_MEM_CONT
-       bool "Memory controller for cgroups"
-       depends on CGROUPS && RESOURCE_COUNTERS
-       help
-         Provides a memory controller that manages both page cache and
-         RSS memory.
+         order to support older versions of udev and some userspace
+         programs.
 
-         Note that setting this option increases fixed memory overhead
-         associated with each page of memory in the system by 4/8 bytes
-         and also increases cache misses because struct page on many 64bit
-         systems will not fit into a single cache line anymore.
-
-         Only enable when you're ok with these trade offs and really
-         sure you need the memory controller.
+         If you are using a distro with the most recent userspace
+         packages, it should be safe to say N here.
 
 config PROC_PID_CPUSET
        bool "Include legacy /proc/<pid>/cpuset file"
index 8b1982082ad8ada65bbd1ff4a1c565c2a77feba6..fbb0167c6b8a3532baad7bfeefa5194cc0bb6e40 100644 (file)
@@ -254,7 +254,7 @@ early_param("quiet", quiet_kernel);
 static int __init loglevel(char *str)
 {
        get_option(&str, &console_loglevel);
-       return 1;
+       return 0;
 }
 
 early_param("loglevel", loglevel);
index d8abe996e009702663d9769714f6428f88aac641..e9c2fb01e89bf9e0943c3e7a1230098af3df6243 100644 (file)
@@ -2232,7 +2232,6 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
 
        mutex_lock(&cgroup_mutex);
 
-       cgrp->flags = 0;
        INIT_LIST_HEAD(&cgrp->sibling);
        INIT_LIST_HEAD(&cgrp->children);
        INIT_LIST_HEAD(&cgrp->css_sets);
@@ -2242,6 +2241,9 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
        cgrp->root = parent->root;
        cgrp->top_cgroup = parent->top_cgroup;
 
+       if (notify_on_release(parent))
+               set_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
+
        for_each_subsys(root, ss) {
                struct cgroup_subsys_state *css = ss->create(ss, cgrp);
                if (IS_ERR(css)) {
index 3e296ed81d4da76aefa913e7deed8f76f2032087..a1b61f414228ea031cc40ea9ea17ab95e264ceaf 100644 (file)
@@ -322,8 +322,8 @@ static void guarantee_online_mems(const struct cpuset *cs, nodemask_t *pmask)
  * Call without callback_mutex or task_lock() held.  May be
  * called with or without cgroup_mutex held.  Thanks in part to
  * 'the_top_cpuset_hack', the task's cpuset pointer will never
- * be NULL.  This routine also might acquire callback_mutex and
- * current->mm->mmap_sem during call.
+ * be NULL.  This routine also might acquire callback_mutex during
+ * call.
  *
  * Reading current->cpuset->mems_generation doesn't need task_lock
  * to guard the current->cpuset derefence, because it is guarded
index 506a957b665a69bbf84794e233b8032f2d98b280..cd20bf07e9e3b7bb2260c4a5939642c9e4bcb0a5 100644 (file)
@@ -214,20 +214,19 @@ struct pid *session_of_pgrp(struct pid *pgrp)
 static int will_become_orphaned_pgrp(struct pid *pgrp, struct task_struct *ignored_task)
 {
        struct task_struct *p;
-       int ret = 1;
 
        do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
-               if (p == ignored_task
-                               || p->exit_state
-                               || is_global_init(p->real_parent))
+               if ((p == ignored_task) ||
+                   (p->exit_state && thread_group_empty(p)) ||
+                   is_global_init(p->real_parent))
                        continue;
+
                if (task_pgrp(p->real_parent) != pgrp &&
-                   task_session(p->real_parent) == task_session(p)) {
-                       ret = 0;
-                       break;
-               }
+                   task_session(p->real_parent) == task_session(p))
+                       return 0;
        } while_each_pid_task(pgrp, PIDTYPE_PGID, p);
-       return ret;     /* (sighing) "Often!" */
+
+       return 1;
 }
 
 int is_current_pgrp_orphaned(void)
@@ -255,6 +254,37 @@ static int has_stopped_jobs(struct pid *pgrp)
        return retval;
 }
 
+/*
+ * Check to see if any process groups have become orphaned as
+ * a result of our exiting, and if they have any stopped jobs,
+ * send them a SIGHUP and then a SIGCONT. (POSIX 3.2.2.2)
+ */
+static void
+kill_orphaned_pgrp(struct task_struct *tsk, struct task_struct *parent)
+{
+       struct pid *pgrp = task_pgrp(tsk);
+       struct task_struct *ignored_task = tsk;
+
+       if (!parent)
+                /* exit: our father is in a different pgrp than
+                 * we are and we were the only connection outside.
+                 */
+               parent = tsk->real_parent;
+       else
+               /* reparent: our child is in a different pgrp than
+                * we are, and it was the only connection outside.
+                */
+               ignored_task = NULL;
+
+       if (task_pgrp(parent) != pgrp &&
+           task_session(parent) == task_session(tsk) &&
+           will_become_orphaned_pgrp(pgrp, ignored_task) &&
+           has_stopped_jobs(pgrp)) {
+               __kill_pgrp_info(SIGHUP, SEND_SIG_PRIV, pgrp);
+               __kill_pgrp_info(SIGCONT, SEND_SIG_PRIV, pgrp);
+       }
+}
+
 /**
  * reparent_to_kthreadd - Reparent the calling kernel thread to kthreadd
  *
@@ -635,22 +665,7 @@ reparent_thread(struct task_struct *p, struct task_struct *father, int traced)
            p->exit_signal != -1 && thread_group_empty(p))
                do_notify_parent(p, p->exit_signal);
 
-       /*
-        * process group orphan check
-        * Case ii: Our child is in a different pgrp
-        * than we are, and it was the only connection
-        * outside, so the child pgrp is now orphaned.
-        */
-       if ((task_pgrp(p) != task_pgrp(father)) &&
-           (task_session(p) == task_session(father))) {
-               struct pid *pgrp = task_pgrp(p);
-
-               if (will_become_orphaned_pgrp(pgrp, NULL) &&
-                   has_stopped_jobs(pgrp)) {
-                       __kill_pgrp_info(SIGHUP, SEND_SIG_PRIV, pgrp);
-                       __kill_pgrp_info(SIGCONT, SEND_SIG_PRIV, pgrp);
-               }
-       }
+       kill_orphaned_pgrp(p, father);
 }
 
 /*
@@ -735,11 +750,9 @@ static void forget_original_parent(struct task_struct *father)
  * Send signals to all our closest relatives so that they know
  * to properly mourn us..
  */
-static void exit_notify(struct task_struct *tsk)
+static void exit_notify(struct task_struct *tsk, int group_dead)
 {
        int state;
-       struct task_struct *t;
-       struct pid *pgrp;
 
        /*
         * This does two things:
@@ -753,25 +766,8 @@ static void exit_notify(struct task_struct *tsk)
        exit_task_namespaces(tsk);
 
        write_lock_irq(&tasklist_lock);
-       /*
-        * Check to see if any process groups have become orphaned
-        * as a result of our exiting, and if they have any stopped
-        * jobs, send them a SIGHUP and then a SIGCONT.  (POSIX 3.2.2.2)
-        *
-        * Case i: Our father is in a different pgrp than we are
-        * and we were the only connection outside, so our pgrp
-        * is about to become orphaned.
-        */
-       t = tsk->real_parent;
-
-       pgrp = task_pgrp(tsk);
-       if ((task_pgrp(t) != pgrp) &&
-           (task_session(t) == task_session(tsk)) &&
-           will_become_orphaned_pgrp(pgrp, tsk) &&
-           has_stopped_jobs(pgrp)) {
-               __kill_pgrp_info(SIGHUP, SEND_SIG_PRIV, pgrp);
-               __kill_pgrp_info(SIGCONT, SEND_SIG_PRIV, pgrp);
-       }
+       if (group_dead)
+               kill_orphaned_pgrp(tsk->group_leader, NULL);
 
        /* Let father know we died
         *
@@ -788,8 +784,8 @@ static void exit_notify(struct task_struct *tsk)
         * the same after a fork.
         */
        if (tsk->exit_signal != SIGCHLD && tsk->exit_signal != -1 &&
-           ( tsk->parent_exec_id != t->self_exec_id  ||
-             tsk->self_exec_id != tsk->parent_exec_id)
+           (tsk->parent_exec_id != tsk->real_parent->self_exec_id ||
+            tsk->self_exec_id != tsk->parent_exec_id)
            && !capable(CAP_KILL))
                tsk->exit_signal = SIGCHLD;
 
@@ -986,7 +982,7 @@ NORET_TYPE void do_exit(long code)
                module_put(tsk->binfmt->module);
 
        proc_exit_connector(tsk);
-       exit_notify(tsk);
+       exit_notify(tsk, group_dead);
 #ifdef CONFIG_NUMA
        mpol_free(tsk->mempolicy);
        tsk->mempolicy = NULL;
index 7a86e64323385785bda6e838f01c9637e192844a..fcfb580c3afc847e60fc9fa4f682b33c25650963 100644 (file)
@@ -498,27 +498,36 @@ static int __kprobes in_kprobes_functions(unsigned long addr)
        return 0;
 }
 
+/*
+ * If we have a symbol_name argument, look it up and add the offset field
+ * to it. This way, we can specify a relative address to a symbol.
+ */
+static kprobe_opcode_t __kprobes *kprobe_addr(struct kprobe *p)
+{
+       kprobe_opcode_t *addr = p->addr;
+       if (p->symbol_name) {
+               if (addr)
+                       return NULL;
+               kprobe_lookup_name(p->symbol_name, addr);
+       }
+
+       if (!addr)
+               return NULL;
+       return (kprobe_opcode_t *)(((char *)addr) + p->offset);
+}
+
 static int __kprobes __register_kprobe(struct kprobe *p,
        unsigned long called_from)
 {
        int ret = 0;
        struct kprobe *old_p;
        struct module *probed_mod;
+       kprobe_opcode_t *addr;
 
-       /*
-        * If we have a symbol_name argument look it up,
-        * and add it to the address.  That way the addr
-        * field can either be global or relative to a symbol.
-        */
-       if (p->symbol_name) {
-               if (p->addr)
-                       return -EINVAL;
-               kprobe_lookup_name(p->symbol_name, p->addr);
-       }
-
-       if (!p->addr)
+       addr = kprobe_addr(p);
+       if (!addr)
                return -EINVAL;
-       p->addr = (kprobe_opcode_t *)(((char *)p->addr)+ p->offset);
+       p->addr = addr;
 
        if (!kernel_text_address((unsigned long) p->addr) ||
            in_kprobes_functions((unsigned long) p->addr))
@@ -678,8 +687,7 @@ void __kprobes unregister_jprobe(struct jprobe *jp)
        unregister_kprobe(&jp->kp);
 }
 
-#ifdef ARCH_SUPPORTS_KRETPROBES
-
+#ifdef CONFIG_KRETPROBES
 /*
  * This kprobe pre_handler is registered with every kretprobe. When probe
  * hits it will set up the return probe.
@@ -722,12 +730,12 @@ int __kprobes register_kretprobe(struct kretprobe *rp)
        int ret = 0;
        struct kretprobe_instance *inst;
        int i;
-       void *addr = rp->kp.addr;
+       void *addr;
 
        if (kretprobe_blacklist_size) {
-               if (addr == NULL)
-                       kprobe_lookup_name(rp->kp.symbol_name, addr);
-               addr += rp->kp.offset;
+               addr = kprobe_addr(&rp->kp);
+               if (!addr)
+                       return -EINVAL;
 
                for (i = 0; kretprobe_blacklist[i].name != NULL; i++) {
                        if (kretprobe_blacklist[i].addr == addr)
@@ -769,8 +777,7 @@ int __kprobes register_kretprobe(struct kretprobe *rp)
        return ret;
 }
 
-#else /* ARCH_SUPPORTS_KRETPROBES */
-
+#else /* CONFIG_KRETPROBES */
 int __kprobes register_kretprobe(struct kretprobe *rp)
 {
        return -ENOSYS;
@@ -781,8 +788,7 @@ static int __kprobes pre_handler_kretprobe(struct kprobe *p,
 {
        return 0;
 }
-
-#endif /* ARCH_SUPPORTS_KRETPROBES */
+#endif /* CONFIG_KRETPROBES */
 
 void __kprobes unregister_kretprobe(struct kretprobe *rp)
 {
index 50effc01d9a2e094217c0c920eb0f64677424fcc..48a4ea5afffde0b758a627fb63046f8a65976ff5 100644 (file)
@@ -698,14 +698,12 @@ int marker_probe_unregister(const char *name,
 {
        struct marker_entry *entry;
        struct marker_probe_closure *old;
-       int ret = 0;
+       int ret = -ENOENT;
 
        mutex_lock(&markers_mutex);
        entry = get_marker(name);
-       if (!entry) {
-               ret = -ENOENT;
+       if (!entry)
                goto end;
-       }
        if (entry->rcu_pending)
                rcu_barrier();
        old = marker_entry_remove_probe(entry, probe, probe_private);
@@ -713,12 +711,15 @@ int marker_probe_unregister(const char *name,
        marker_update_probes();         /* may update entry */
        mutex_lock(&markers_mutex);
        entry = get_marker(name);
+       if (!entry)
+               goto end;
        entry->oldptr = old;
        entry->rcu_pending = 1;
        /* write rcu_pending before calling the RCU callback */
        smp_wmb();
        call_rcu(&entry->rcu, free_old_closure);
        remove_marker(name);    /* Ignore busy error message */
+       ret = 0;
 end:
        mutex_unlock(&markers_mutex);
        return ret;
index 901cd6ac2f11d9d4b54d3bff34e10495e86f01a2..be4807fb90e48afd4ec74c460aaf8a214c4b0a4a 100644 (file)
@@ -1933,8 +1933,15 @@ static struct module *load_module(void __user *umod,
        /* Set up license info based on the info section */
        set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
 
+       /*
+        * ndiswrapper is under GPL by itself, but loads proprietary modules.
+        * Don't use add_taint_module(), as it would prevent ndiswrapper from
+        * using GPL-only symbols it needs.
+        */
        if (strcmp(mod->name, "ndiswrapper") == 0)
-               add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
+               add_taint(TAINT_PROPRIETARY_MODULE);
+
+       /* driverloader was caught wrongly pretending to be under GPL */
        if (strcmp(mod->name, "driverloader") == 0)
                add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
 
index 7c2118f9597f3139cfef277233a739d5d717b159..f1d0b345c9ba86a24ac48ee29cc4cb6f800b1c94 100644 (file)
@@ -75,22 +75,15 @@ void refrigerator(void)
        __set_current_state(save);
 }
 
-static void fake_signal_wake_up(struct task_struct *p, int resume)
+static void fake_signal_wake_up(struct task_struct *p)
 {
        unsigned long flags;
 
        spin_lock_irqsave(&p->sighand->siglock, flags);
-       signal_wake_up(p, resume);
+       signal_wake_up(p, 0);
        spin_unlock_irqrestore(&p->sighand->siglock, flags);
 }
 
-static void send_fake_signal(struct task_struct *p)
-{
-       if (task_is_stopped(p))
-               force_sig_specific(SIGSTOP, p);
-       fake_signal_wake_up(p, task_is_stopped(p));
-}
-
 static int has_mm(struct task_struct *p)
 {
        return (p->mm && !(p->flags & PF_BORROWED_MM));
@@ -121,7 +114,7 @@ static int freeze_task(struct task_struct *p, int with_mm_only)
        if (freezing(p)) {
                if (has_mm(p)) {
                        if (!signal_pending(p))
-                               fake_signal_wake_up(p, 0);
+                               fake_signal_wake_up(p);
                } else {
                        if (with_mm_only)
                                ret = 0;
@@ -135,7 +128,7 @@ static int freeze_task(struct task_struct *p, int with_mm_only)
                } else {
                        if (has_mm(p)) {
                                set_freeze_flag(p);
-                               send_fake_signal(p);
+                               fake_signal_wake_up(p);
                        } else {
                                if (with_mm_only) {
                                        ret = 0;
@@ -182,15 +175,17 @@ static int try_to_freeze_tasks(int freeze_user_space)
                        if (frozen(p) || !freezeable(p))
                                continue;
 
-                       if (task_is_traced(p) && frozen(p->parent)) {
-                               cancel_freezing(p);
-                               continue;
-                       }
-
                        if (!freeze_task(p, freeze_user_space))
                                continue;
 
-                       if (!freezer_should_skip(p))
+                       /*
+                        * Now that we've done set_freeze_flag, don't
+                        * perturb a task in TASK_STOPPED or TASK_TRACED.
+                        * It is "frozen enough".  If the task does wake
+                        * up, it will immediately call try_to_freeze.
+                        */
+                       if (!task_is_stopped_or_traced(p) &&
+                           !freezer_should_skip(p))
                                todo++;
                } while_each_thread(g, p);
                read_unlock(&tasklist_lock);
index 16cbec2d5d60514e67c14907e6d11f91cfecafd1..efbfc0fc232f33c49b5b918704b4e13ae5d0f2cc 100644 (file)
@@ -113,6 +113,7 @@ ssize_t res_counter_write(struct res_counter *counter, int member,
 
        ret = -EINVAL;
 
+       strstrip(buf);
        if (write_strategy) {
                if (write_strategy(buf, &tmp)) {
                        goto out_free;
index f06950c8a6ce17b95624bccc63ecfb399d2eb40c..dcd553cc4ee89b52ec511f70361c4f7fd586d976 100644 (file)
@@ -174,41 +174,6 @@ struct task_group {
        struct sched_entity **se;
        /* runqueue "owned" by this group on each cpu */
        struct cfs_rq **cfs_rq;
-
-       /*
-        * shares assigned to a task group governs how much of cpu bandwidth
-        * is allocated to the group. The more shares a group has, the more is
-        * the cpu bandwidth allocated to it.
-        *
-        * For ex, lets say that there are three task groups, A, B and C which
-        * have been assigned shares 1000, 2000 and 3000 respectively. Then,
-        * cpu bandwidth allocated by the scheduler to task groups A, B and C
-        * should be:
-        *
-        *      Bw(A) = 1000/(1000+2000+3000) * 100 = 16.66%
-        *      Bw(B) = 2000/(1000+2000+3000) * 100 = 33.33%
-        *      Bw(C) = 3000/(1000+2000+3000) * 100 = 50%
-        *
-        * The weight assigned to a task group's schedulable entities on every
-        * cpu (task_group.se[a_cpu]->load.weight) is derived from the task
-        * group's shares. For ex: lets say that task group A has been
-        * assigned shares of 1000 and there are two CPUs in a system. Then,
-        *
-        *  tg_A->se[0]->load.weight = tg_A->se[1]->load.weight = 1000;
-        *
-        * Note: It's not necessary that each of a task's group schedulable
-        *       entity have the same weight on all CPUs. If the group
-        *       has 2 of its tasks on CPU0 and 1 task on CPU1, then a
-        *       better distribution of weight could be:
-        *
-        *      tg_A->se[0]->load.weight = 2/3 * 2000 = 1333
-        *      tg_A->se[1]->load.weight = 1/2 * 2000 =  667
-        *
-        * rebalance_shares() is responsible for distributing the shares of a
-        * task groups like this among the group's schedulable entities across
-        * cpus.
-        *
-        */
        unsigned long shares;
 #endif
 
@@ -250,22 +215,12 @@ static DEFINE_SPINLOCK(task_group_lock);
 static DEFINE_MUTEX(doms_cur_mutex);
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-#ifdef CONFIG_SMP
-/* kernel thread that runs rebalance_shares() periodically */
-static struct task_struct *lb_monitor_task;
-static int load_balance_monitor(void *unused);
-#endif
-
-static void set_se_shares(struct sched_entity *se, unsigned long shares);
-
 #ifdef CONFIG_USER_SCHED
 # define INIT_TASK_GROUP_LOAD  (2*NICE_0_LOAD)
 #else
 # define INIT_TASK_GROUP_LOAD  NICE_0_LOAD
 #endif
 
-#define MIN_GROUP_SHARES       2
-
 static int init_task_group_load = INIT_TASK_GROUP_LOAD;
 #endif
 
@@ -1245,16 +1200,6 @@ static void cpuacct_charge(struct task_struct *tsk, u64 cputime);
 static inline void cpuacct_charge(struct task_struct *tsk, u64 cputime) {}
 #endif
 
-static inline void inc_cpu_load(struct rq *rq, unsigned long load)
-{
-       update_load_add(&rq->load, load);
-}
-
-static inline void dec_cpu_load(struct rq *rq, unsigned long load)
-{
-       update_load_sub(&rq->load, load);
-}
-
 #ifdef CONFIG_SMP
 static unsigned long source_load(int cpu, int type);
 static unsigned long target_load(int cpu, int type);
@@ -1272,14 +1217,26 @@ static int task_hot(struct task_struct *p, u64 now, struct sched_domain *sd);
 
 #define sched_class_highest (&rt_sched_class)
 
-static void inc_nr_running(struct rq *rq)
+static inline void inc_load(struct rq *rq, const struct task_struct *p)
+{
+       update_load_add(&rq->load, p->se.load.weight);
+}
+
+static inline void dec_load(struct rq *rq, const struct task_struct *p)
+{
+       update_load_sub(&rq->load, p->se.load.weight);
+}
+
+static void inc_nr_running(struct task_struct *p, struct rq *rq)
 {
        rq->nr_running++;
+       inc_load(rq, p);
 }
 
-static void dec_nr_running(struct rq *rq)
+static void dec_nr_running(struct task_struct *p, struct rq *rq)
 {
        rq->nr_running--;
+       dec_load(rq, p);
 }
 
 static void set_load_weight(struct task_struct *p)
@@ -1371,7 +1328,7 @@ static void activate_task(struct rq *rq, struct task_struct *p, int wakeup)
                rq->nr_uninterruptible--;
 
        enqueue_task(rq, p, wakeup);
-       inc_nr_running(rq);
+       inc_nr_running(p, rq);
 }
 
 /*
@@ -1383,7 +1340,7 @@ static void deactivate_task(struct rq *rq, struct task_struct *p, int sleep)
                rq->nr_uninterruptible++;
 
        dequeue_task(rq, p, sleep);
-       dec_nr_running(rq);
+       dec_nr_running(p, rq);
 }
 
 /**
@@ -2023,7 +1980,7 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
                 * management (if any):
                 */
                p->sched_class->task_new(rq, p);
-               inc_nr_running(rq);
+               inc_nr_running(p, rq);
        }
        check_preempt_curr(rq, p);
 #ifdef CONFIG_SMP
@@ -4362,8 +4319,10 @@ void set_user_nice(struct task_struct *p, long nice)
                goto out_unlock;
        }
        on_rq = p->se.on_rq;
-       if (on_rq)
+       if (on_rq) {
                dequeue_task(rq, p, 0);
+               dec_load(rq, p);
+       }
 
        p->static_prio = NICE_TO_PRIO(nice);
        set_load_weight(p);
@@ -4373,6 +4332,7 @@ void set_user_nice(struct task_struct *p, long nice)
 
        if (on_rq) {
                enqueue_task(rq, p, 0);
+               inc_load(rq, p);
                /*
                 * If the task increased its priority or is running and
                 * lowered its priority, then reschedule its CPU:
@@ -7087,21 +7047,6 @@ void __init sched_init_smp(void)
        if (set_cpus_allowed(current, non_isolated_cpus) < 0)
                BUG();
        sched_init_granularity();
-
-#ifdef CONFIG_FAIR_GROUP_SCHED
-       if (nr_cpu_ids == 1)
-               return;
-
-       lb_monitor_task = kthread_create(load_balance_monitor, NULL,
-                                        "group_balance");
-       if (!IS_ERR(lb_monitor_task)) {
-               lb_monitor_task->flags |= PF_NOFREEZE;
-               wake_up_process(lb_monitor_task);
-       } else {
-               printk(KERN_ERR "Could not create load balance monitor thread"
-                       "(error = %ld) \n", PTR_ERR(lb_monitor_task));
-       }
-#endif
 }
 #else
 void __init sched_init_smp(void)
@@ -7424,157 +7369,6 @@ void set_curr_task(int cpu, struct task_struct *p)
 
 #ifdef CONFIG_GROUP_SCHED
 
-#if defined CONFIG_FAIR_GROUP_SCHED && defined CONFIG_SMP
-/*
- * distribute shares of all task groups among their schedulable entities,
- * to reflect load distribution across cpus.
- */
-static int rebalance_shares(struct sched_domain *sd, int this_cpu)
-{
-       struct cfs_rq *cfs_rq;
-       struct rq *rq = cpu_rq(this_cpu);
-       cpumask_t sdspan = sd->span;
-       int balanced = 1;
-
-       /* Walk thr' all the task groups that we have */
-       for_each_leaf_cfs_rq(rq, cfs_rq) {
-               int i;
-               unsigned long total_load = 0, total_shares;
-               struct task_group *tg = cfs_rq->tg;
-
-               /* Gather total task load of this group across cpus */
-               for_each_cpu_mask(i, sdspan)
-                       total_load += tg->cfs_rq[i]->load.weight;
-
-               /* Nothing to do if this group has no load */
-               if (!total_load)
-                       continue;
-
-               /*
-                * tg->shares represents the number of cpu shares the task group
-                * is eligible to hold on a single cpu. On N cpus, it is
-                * eligible to hold (N * tg->shares) number of cpu shares.
-                */
-               total_shares = tg->shares * cpus_weight(sdspan);
-
-               /*
-                * redistribute total_shares across cpus as per the task load
-                * distribution.
-                */
-               for_each_cpu_mask(i, sdspan) {
-                       unsigned long local_load, local_shares;
-
-                       local_load = tg->cfs_rq[i]->load.weight;
-                       local_shares = (local_load * total_shares) / total_load;
-                       if (!local_shares)
-                               local_shares = MIN_GROUP_SHARES;
-                       if (local_shares == tg->se[i]->load.weight)
-                               continue;
-
-                       spin_lock_irq(&cpu_rq(i)->lock);
-                       set_se_shares(tg->se[i], local_shares);
-                       spin_unlock_irq(&cpu_rq(i)->lock);
-                       balanced = 0;
-               }
-       }
-
-       return balanced;
-}
-
-/*
- * How frequently should we rebalance_shares() across cpus?
- *
- * The more frequently we rebalance shares, the more accurate is the fairness
- * of cpu bandwidth distribution between task groups. However higher frequency
- * also implies increased scheduling overhead.
- *
- * sysctl_sched_min_bal_int_shares represents the minimum interval between
- * consecutive calls to rebalance_shares() in the same sched domain.
- *
- * sysctl_sched_max_bal_int_shares represents the maximum interval between
- * consecutive calls to rebalance_shares() in the same sched domain.
- *
- * These settings allows for the appropriate trade-off between accuracy of
- * fairness and the associated overhead.
- *
- */
-
-/* default: 8ms, units: milliseconds */
-const_debug unsigned int sysctl_sched_min_bal_int_shares = 8;
-
-/* default: 128ms, units: milliseconds */
-const_debug unsigned int sysctl_sched_max_bal_int_shares = 128;
-
-/* kernel thread that runs rebalance_shares() periodically */
-static int load_balance_monitor(void *unused)
-{
-       unsigned int timeout = sysctl_sched_min_bal_int_shares;
-       struct sched_param schedparm;
-       int ret;
-
-       /*
-        * We don't want this thread's execution to be limited by the shares
-        * assigned to default group (init_task_group). Hence make it run
-        * as a SCHED_RR RT task at the lowest priority.
-        */
-       schedparm.sched_priority = 1;
-       ret = sched_setscheduler(current, SCHED_RR, &schedparm);
-       if (ret)
-               printk(KERN_ERR "Couldn't set SCHED_RR policy for load balance"
-                               " monitor thread (error = %d) \n", ret);
-
-       while (!kthread_should_stop()) {
-               int i, cpu, balanced = 1;
-
-               /* Prevent cpus going down or coming up */
-               get_online_cpus();
-               /* lockout changes to doms_cur[] array */
-               lock_doms_cur();
-               /*
-                * Enter a rcu read-side critical section to safely walk rq->sd
-                * chain on various cpus and to walk task group list
-                * (rq->leaf_cfs_rq_list) in rebalance_shares().
-                */
-               rcu_read_lock();
-
-               for (i = 0; i < ndoms_cur; i++) {
-                       cpumask_t cpumap = doms_cur[i];
-                       struct sched_domain *sd = NULL, *sd_prev = NULL;
-
-                       cpu = first_cpu(cpumap);
-
-                       /* Find the highest domain at which to balance shares */
-                       for_each_domain(cpu, sd) {
-                               if (!(sd->flags & SD_LOAD_BALANCE))
-                                       continue;
-                               sd_prev = sd;
-                       }
-
-                       sd = sd_prev;
-                       /* sd == NULL? No load balance reqd in this domain */
-                       if (!sd)
-                               continue;
-
-                       balanced &= rebalance_shares(sd, cpu);
-               }
-
-               rcu_read_unlock();
-
-               unlock_doms_cur();
-               put_online_cpus();
-
-               if (!balanced)
-                       timeout = sysctl_sched_min_bal_int_shares;
-               else if (timeout < sysctl_sched_max_bal_int_shares)
-                       timeout *= 2;
-
-               msleep_interruptible(timeout);
-       }
-
-       return 0;
-}
-#endif /* CONFIG_SMP */
-
 #ifdef CONFIG_FAIR_GROUP_SCHED
 static void free_fair_sched_group(struct task_group *tg)
 {
@@ -7841,29 +7635,25 @@ void sched_move_task(struct task_struct *tsk)
 }
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-/* rq->lock to be locked by caller */
 static void set_se_shares(struct sched_entity *se, unsigned long shares)
 {
        struct cfs_rq *cfs_rq = se->cfs_rq;
        struct rq *rq = cfs_rq->rq;
        int on_rq;
 
-       if (!shares)
-               shares = MIN_GROUP_SHARES;
+       spin_lock_irq(&rq->lock);
 
        on_rq = se->on_rq;
-       if (on_rq) {
+       if (on_rq)
                dequeue_entity(cfs_rq, se, 0);
-               dec_cpu_load(rq, se->load.weight);
-       }
 
        se->load.weight = shares;
        se->load.inv_weight = div64_64((1ULL<<32), shares);
 
-       if (on_rq) {
+       if (on_rq)
                enqueue_entity(cfs_rq, se, 0);
-               inc_cpu_load(rq, se->load.weight);
-       }
+
+       spin_unlock_irq(&rq->lock);
 }
 
 static DEFINE_MUTEX(shares_mutex);
@@ -7873,18 +7663,18 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
        int i;
        unsigned long flags;
 
+       /*
+        * A weight of 0 or 1 can cause arithmetics problems.
+        * (The default weight is 1024 - so there's no practical
+        *  limitation from this.)
+        */
+       if (shares < 2)
+               shares = 2;
+
        mutex_lock(&shares_mutex);
        if (tg->shares == shares)
                goto done;
 
-       if (shares < MIN_GROUP_SHARES)
-               shares = MIN_GROUP_SHARES;
-
-       /*
-        * Prevent any load balance activity (rebalance_shares,
-        * load_balance_fair) from referring to this group first,
-        * by taking it off the rq->leaf_cfs_rq_list on each cpu.
-        */
        spin_lock_irqsave(&task_group_lock, flags);
        for_each_possible_cpu(i)
                unregister_fair_sched_group(tg, i);
@@ -7898,11 +7688,8 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
         * w/o tripping rebalance_share or load_balance_fair.
         */
        tg->shares = shares;
-       for_each_possible_cpu(i) {
-               spin_lock_irq(&cpu_rq(i)->lock);
+       for_each_possible_cpu(i)
                set_se_shares(tg->se[i], shares);
-               spin_unlock_irq(&cpu_rq(i)->lock);
-       }
 
        /*
         * Enable load balance activity on this group, by inserting it back on
index c8e6492c5925f0dea503d48d04b9a12a6f0ade51..3df4d46994ca80ddc861ba44fe8f7ac24b3c50ed 100644 (file)
@@ -727,8 +727,6 @@ static inline struct sched_entity *parent_entity(struct sched_entity *se)
        return se->parent;
 }
 
-#define GROUP_IMBALANCE_PCT    20
-
 #else  /* CONFIG_FAIR_GROUP_SCHED */
 
 #define for_each_sched_entity(se) \
@@ -819,26 +817,15 @@ hrtick_start_fair(struct rq *rq, struct task_struct *p)
 static void enqueue_task_fair(struct rq *rq, struct task_struct *p, int wakeup)
 {
        struct cfs_rq *cfs_rq;
-       struct sched_entity *se = &p->se,
-                           *topse = NULL;      /* Highest schedulable entity */
-       int incload = 1;
+       struct sched_entity *se = &p->se;
 
        for_each_sched_entity(se) {
-               topse = se;
-               if (se->on_rq) {
-                       incload = 0;
+               if (se->on_rq)
                        break;
-               }
                cfs_rq = cfs_rq_of(se);
                enqueue_entity(cfs_rq, se, wakeup);
                wakeup = 1;
        }
-       /* Increment cpu load if we just enqueued the first task of a group on
-        * 'rq->cpu'. 'topse' represents the group to which task 'p' belongs
-        * at the highest grouping level.
-        */
-       if (incload)
-               inc_cpu_load(rq, topse->load.weight);
 
        hrtick_start_fair(rq, rq->curr);
 }
@@ -851,28 +838,16 @@ static void enqueue_task_fair(struct rq *rq, struct task_struct *p, int wakeup)
 static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int sleep)
 {
        struct cfs_rq *cfs_rq;
-       struct sched_entity *se = &p->se,
-                           *topse = NULL;      /* Highest schedulable entity */
-       int decload = 1;
+       struct sched_entity *se = &p->se;
 
        for_each_sched_entity(se) {
-               topse = se;
                cfs_rq = cfs_rq_of(se);
                dequeue_entity(cfs_rq, se, sleep);
                /* Don't dequeue parent if it has other entities besides us */
-               if (cfs_rq->load.weight) {
-                       if (parent_entity(se))
-                               decload = 0;
+               if (cfs_rq->load.weight)
                        break;
-               }
                sleep = 1;
        }
-       /* Decrement cpu load if we just dequeued the last task of a group on
-        * 'rq->cpu'. 'topse' represents the group to which task 'p' belongs
-        * at the highest grouping level.
-        */
-       if (decload)
-               dec_cpu_load(rq, topse->load.weight);
 
        hrtick_start_fair(rq, rq->curr);
 }
@@ -1186,6 +1161,25 @@ static struct task_struct *load_balance_next_fair(void *arg)
        return __load_balance_iterator(cfs_rq, cfs_rq->rb_load_balance_curr);
 }
 
+#ifdef CONFIG_FAIR_GROUP_SCHED
+static int cfs_rq_best_prio(struct cfs_rq *cfs_rq)
+{
+       struct sched_entity *curr;
+       struct task_struct *p;
+
+       if (!cfs_rq->nr_running || !first_fair(cfs_rq))
+               return MAX_PRIO;
+
+       curr = cfs_rq->curr;
+       if (!curr)
+               curr = __pick_next_entity(cfs_rq);
+
+       p = task_of(curr);
+
+       return p->prio;
+}
+#endif
+
 static unsigned long
 load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
                  unsigned long max_load_move,
@@ -1195,45 +1189,28 @@ load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
        struct cfs_rq *busy_cfs_rq;
        long rem_load_move = max_load_move;
        struct rq_iterator cfs_rq_iterator;
-       unsigned long load_moved;
 
        cfs_rq_iterator.start = load_balance_start_fair;
        cfs_rq_iterator.next = load_balance_next_fair;
 
        for_each_leaf_cfs_rq(busiest, busy_cfs_rq) {
 #ifdef CONFIG_FAIR_GROUP_SCHED
-               struct cfs_rq *this_cfs_rq = busy_cfs_rq->tg->cfs_rq[this_cpu];
-               unsigned long maxload, task_load, group_weight;
-               unsigned long thisload, per_task_load;
-               struct sched_entity *se = busy_cfs_rq->tg->se[busiest->cpu];
-
-               task_load = busy_cfs_rq->load.weight;
-               group_weight = se->load.weight;
+               struct cfs_rq *this_cfs_rq;
+               long imbalance;
+               unsigned long maxload;
 
-               /*
-                * 'group_weight' is contributed by tasks of total weight
-                * 'task_load'. To move 'rem_load_move' worth of weight only,
-                * we need to move a maximum task load of:
-                *
-                *      maxload = (remload / group_weight) * task_load;
-                */
-               maxload = (rem_load_move * task_load) / group_weight;
+               this_cfs_rq = cpu_cfs_rq(busy_cfs_rq, this_cpu);
 
-               if (!maxload || !task_load)
+               imbalance = busy_cfs_rq->load.weight - this_cfs_rq->load.weight;
+               /* Don't pull if this_cfs_rq has more load than busy_cfs_rq */
+               if (imbalance <= 0)
                        continue;
 
-               per_task_load = task_load / busy_cfs_rq->nr_running;
-               /*
-                * balance_tasks will try to forcibly move atleast one task if
-                * possible (because of SCHED_LOAD_SCALE_FUZZ). Avoid that if
-                * maxload is less than GROUP_IMBALANCE_FUZZ% the per_task_load.
-                */
-                if (100 * maxload < GROUP_IMBALANCE_PCT * per_task_load)
-                       continue;
+               /* Don't pull more than imbalance/2 */
+               imbalance /= 2;
+               maxload = min(rem_load_move, imbalance);
 
-               /* Disable priority-based load balance */
-               *this_best_prio = 0;
-               thisload = this_cfs_rq->load.weight;
+               *this_best_prio = cfs_rq_best_prio(this_cfs_rq);
 #else
 # define maxload rem_load_move
 #endif
@@ -1242,33 +1219,11 @@ load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
                 * load_balance_[start|next]_fair iterators
                 */
                cfs_rq_iterator.arg = busy_cfs_rq;
-               load_moved = balance_tasks(this_rq, this_cpu, busiest,
+               rem_load_move -= balance_tasks(this_rq, this_cpu, busiest,
                                               maxload, sd, idle, all_pinned,
                                               this_best_prio,
                                               &cfs_rq_iterator);
 
-#ifdef CONFIG_FAIR_GROUP_SCHED
-               /*
-                * load_moved holds the task load that was moved. The
-                * effective (group) weight moved would be:
-                *      load_moved_eff = load_moved/task_load * group_weight;
-                */
-               load_moved = (group_weight * load_moved) / task_load;
-
-               /* Adjust shares on both cpus to reflect load_moved */
-               group_weight -= load_moved;
-               set_se_shares(se, group_weight);
-
-               se = busy_cfs_rq->tg->se[this_cpu];
-               if (!thisload)
-                       group_weight = load_moved;
-               else
-                       group_weight = se->load.weight + load_moved;
-               set_se_shares(se, group_weight);
-#endif
-
-               rem_load_move -= load_moved;
-
                if (rem_load_move <= 0)
                        break;
        }
index f54792b175b26a331df3e133a8b7f854122eefdf..76e828517541b742c960de0b48bd503ea88f99d6 100644 (file)
@@ -393,8 +393,6 @@ static void enqueue_task_rt(struct rq *rq, struct task_struct *p, int wakeup)
         */
        for_each_sched_rt_entity(rt_se)
                enqueue_rt_entity(rt_se);
-
-       inc_cpu_load(rq, p->se.load.weight);
 }
 
 static void dequeue_task_rt(struct rq *rq, struct task_struct *p, int sleep)
@@ -414,8 +412,6 @@ static void dequeue_task_rt(struct rq *rq, struct task_struct *p, int sleep)
                if (rt_rq && rt_rq->rt_nr_running)
                        enqueue_rt_entity(rt_se);
        }
-
-       dec_cpu_load(rq, p->se.load.weight);
 }
 
 /*
index 84917fe507f77b8ff949af7f958e11ac2ed423b7..6af1210092c39a45db3552ecc9199728f8938410 100644 (file)
@@ -1623,7 +1623,6 @@ static void ptrace_stop(int exit_code, int clear_code, siginfo_t *info)
        /* Let the debugger run.  */
        __set_current_state(TASK_TRACED);
        spin_unlock_irq(&current->sighand->siglock);
-       try_to_freeze();
        read_lock(&tasklist_lock);
        if (!unlikely(killed) && may_ptrace_stop()) {
                do_notify_parent_cldstop(current, CLD_TRAPPED);
@@ -1640,6 +1639,13 @@ static void ptrace_stop(int exit_code, int clear_code, siginfo_t *info)
                read_unlock(&tasklist_lock);
        }
 
+       /*
+        * While in TASK_TRACED, we were considered "frozen enough".
+        * Now that we woke up, it's crucial if we're supposed to be
+        * frozen that we freeze now before running anything substantial.
+        */
+       try_to_freeze();
+
        /*
         * We are back.  Now reacquire the siglock before touching
         * last_siginfo, so that we are sure to have synchronized with
@@ -1757,9 +1763,15 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka,
        sigset_t *mask = &current->blocked;
        int signr = 0;
 
+relock:
+       /*
+        * We'll jump back here after any time we were stopped in TASK_STOPPED.
+        * While in TASK_STOPPED, we were considered "frozen enough".
+        * Now that we woke up, it's crucial if we're supposed to be
+        * frozen that we freeze now before running anything substantial.
+        */
        try_to_freeze();
 
-relock:
        spin_lock_irq(&current->sighand->siglock);
        for (;;) {
                struct k_sigaction *ka;
index 8b7e95411795793724f036594e1446e32f1e444b..b2a2d6889babc898794e7c7fb7907ef59a3b487b 100644 (file)
@@ -311,24 +311,6 @@ static struct ctl_table kern_table[] = {
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
-#if defined(CONFIG_FAIR_GROUP_SCHED) && defined(CONFIG_SMP)
-       {
-               .ctl_name       = CTL_UNNUMBERED,
-               .procname       = "sched_min_bal_int_shares",
-               .data           = &sysctl_sched_min_bal_int_shares,
-               .maxlen         = sizeof(unsigned int),
-               .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-       },
-       {
-               .ctl_name       = CTL_UNNUMBERED,
-               .procname       = "sched_max_bal_int_shares",
-               .data           = &sysctl_sched_max_bal_int_shares,
-               .maxlen         = sizeof(unsigned int),
-               .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-       },
-#endif
 #endif
        {
                .ctl_name       = CTL_UNNUMBERED,
index 495575a59ca643f752a2314b44e5e0e77a2963f5..a3b8d4c3f77a5e7e466bd8f5e5591f3dcaa2c3bd 100644 (file)
@@ -40,10 +40,12 @@ static inline void set_bit_area(unsigned long *map, unsigned long i,
        }
 }
 
-static inline int is_span_boundary(unsigned int index, unsigned int nr,
-                                  unsigned long shift,
-                                  unsigned long boundary_size)
+int iommu_is_span_boundary(unsigned int index, unsigned int nr,
+                          unsigned long shift,
+                          unsigned long boundary_size)
 {
+       BUG_ON(!is_power_of_2(boundary_size));
+
        shift = (shift + index) & (boundary_size - 1);
        return shift + nr > boundary_size;
 }
@@ -57,7 +59,7 @@ unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
 again:
        index = find_next_zero_area(map, size, start, nr, align_mask);
        if (index != -1) {
-               if (is_span_boundary(index, nr, shift, boundary_size)) {
+               if (iommu_is_span_boundary(index, nr, shift, boundary_size)) {
                        /* we could do more effectively */
                        start = index + 1;
                        goto again;
index d784daeb8571692e0fed288f17df60651a04366c..0d03252f87a8535db2a9fe00632560c6fa337f24 100644 (file)
@@ -153,6 +153,10 @@ static void kobject_init_internal(struct kobject *kobj)
                return;
        kref_init(&kobj->kref);
        INIT_LIST_HEAD(&kobj->entry);
+       kobj->state_in_sysfs = 0;
+       kobj->state_add_uevent_sent = 0;
+       kobj->state_remove_uevent_sent = 0;
+       kobj->state_initialized = 1;
 }
 
 
@@ -289,13 +293,8 @@ void kobject_init(struct kobject *kobj, struct kobj_type *ktype)
                dump_stack();
        }
 
-       kref_init(&kobj->kref);
-       INIT_LIST_HEAD(&kobj->entry);
+       kobject_init_internal(kobj);
        kobj->ktype = ktype;
-       kobj->state_in_sysfs = 0;
-       kobj->state_add_uevent_sent = 0;
-       kobj->state_remove_uevent_sent = 0;
-       kobj->state_initialized = 1;
        return;
 
 error:
index 9f117bab5322e59b49cba45146b0e54176d206ca..a5b0dd93427a7266d7a26dcc7fd1266c602725fb 100644 (file)
@@ -32,5 +32,5 @@ obj-$(CONFIG_FS_XIP) += filemap_xip.o
 obj-$(CONFIG_MIGRATION) += migrate.o
 obj-$(CONFIG_SMP) += allocpercpu.o
 obj-$(CONFIG_QUICKLIST) += quicklist.o
-obj-$(CONFIG_CGROUP_MEM_CONT) += memcontrol.o
+obj-$(CONFIG_CGROUP_MEM_RES_CTLR) += memcontrol.o
 
index 7e58322b7134ff1d04e40269e030bdd53e1c87f6..b0012e27fea8796da01cfb2172d1d5930c60d22f 100644 (file)
@@ -6,6 +6,10 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 
+#ifndef cache_line_size
+#define cache_line_size()      L1_CACHE_BYTES
+#endif
+
 /**
  * percpu_depopulate - depopulate per-cpu data for given cpu
  * @__pdata: per-cpu data to depopulate
@@ -52,6 +56,11 @@ void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, int cpu)
        struct percpu_data *pdata = __percpu_disguise(__pdata);
        int node = cpu_to_node(cpu);
 
+       /*
+        * We should make sure each CPU gets private memory.
+        */
+       size = roundup(size, cache_line_size());
+
        BUG_ON(pdata->ptrs[cpu]);
        if (node_online(node))
                pdata->ptrs[cpu] = kmalloc_node(size, gfp|__GFP_ZERO, node);
@@ -98,7 +107,11 @@ EXPORT_SYMBOL_GPL(__percpu_populate_mask);
  */
 void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask)
 {
-       void *pdata = kzalloc(nr_cpu_ids * sizeof(void *), gfp);
+       /*
+        * We allocate whole cache lines to avoid false sharing
+        */
+       size_t sz = roundup(nr_cpu_ids * sizeof(void *), cache_line_size());
+       void *pdata = kzalloc(sz, gfp);
        void *__pdata = __percpu_disguise(pdata);
 
        if (unlikely(!pdata))
index 89e6286a7f57823e0427b7eeb84e6e39340764e1..dcacc811e70ede9cda49d4d2cf56a6d5d5404a56 100644 (file)
@@ -71,7 +71,25 @@ static void enqueue_huge_page(struct page *page)
        free_huge_pages_node[nid]++;
 }
 
-static struct page *dequeue_huge_page(struct vm_area_struct *vma,
+static struct page *dequeue_huge_page(void)
+{
+       int nid;
+       struct page *page = NULL;
+
+       for (nid = 0; nid < MAX_NUMNODES; ++nid) {
+               if (!list_empty(&hugepage_freelists[nid])) {
+                       page = list_entry(hugepage_freelists[nid].next,
+                                         struct page, lru);
+                       list_del(&page->lru);
+                       free_huge_pages--;
+                       free_huge_pages_node[nid]--;
+                       break;
+               }
+       }
+       return page;
+}
+
+static struct page *dequeue_huge_page_vma(struct vm_area_struct *vma,
                                unsigned long address)
 {
        int nid;
@@ -296,8 +314,10 @@ static int gather_surplus_pages(int delta)
        int needed, allocated;
 
        needed = (resv_huge_pages + delta) - free_huge_pages;
-       if (needed <= 0)
+       if (needed <= 0) {
+               resv_huge_pages += delta;
                return 0;
+       }
 
        allocated = 0;
        INIT_LIST_HEAD(&surplus_list);
@@ -335,9 +355,12 @@ retry:
         * The surplus_list now contains _at_least_ the number of extra pages
         * needed to accomodate the reservation.  Add the appropriate number
         * of pages to the hugetlb pool and free the extras back to the buddy
-        * allocator.
+        * allocator.  Commit the entire reservation here to prevent another
+        * process from stealing the pages as they are added to the pool but
+        * before they are reserved.
         */
        needed += allocated;
+       resv_huge_pages += delta;
        ret = 0;
 free:
        list_for_each_entry_safe(page, tmp, &surplus_list, lru) {
@@ -371,6 +394,9 @@ static void return_unused_surplus_pages(unsigned long unused_resv_pages)
        struct page *page;
        unsigned long nr_pages;
 
+       /* Uncommit the reservation */
+       resv_huge_pages -= unused_resv_pages;
+
        nr_pages = min(unused_resv_pages, surplus_huge_pages);
 
        while (nr_pages) {
@@ -402,7 +428,7 @@ static struct page *alloc_huge_page_shared(struct vm_area_struct *vma,
        struct page *page;
 
        spin_lock(&hugetlb_lock);
-       page = dequeue_huge_page(vma, addr);
+       page = dequeue_huge_page_vma(vma, addr);
        spin_unlock(&hugetlb_lock);
        return page ? page : ERR_PTR(-VM_FAULT_OOM);
 }
@@ -417,7 +443,7 @@ static struct page *alloc_huge_page_private(struct vm_area_struct *vma,
 
        spin_lock(&hugetlb_lock);
        if (free_huge_pages > resv_huge_pages)
-               page = dequeue_huge_page(vma, addr);
+               page = dequeue_huge_page_vma(vma, addr);
        spin_unlock(&hugetlb_lock);
        if (!page) {
                page = alloc_buddy_huge_page(vma, addr);
@@ -570,7 +596,7 @@ static unsigned long set_max_huge_pages(unsigned long count)
        min_count = max(count, min_count);
        try_to_free_low(min_count);
        while (min_count < persistent_huge_pages) {
-               struct page *page = dequeue_huge_page(NULL, 0);
+               struct page *page = dequeue_huge_page();
                if (!page)
                        break;
                update_and_free_page(page);
@@ -1205,12 +1231,13 @@ static int hugetlb_acct_memory(long delta)
                if (gather_surplus_pages(delta) < 0)
                        goto out;
 
-               if (delta > cpuset_mems_nr(free_huge_pages_node))
+               if (delta > cpuset_mems_nr(free_huge_pages_node)) {
+                       return_unused_surplus_pages(delta);
                        goto out;
+               }
        }
 
        ret = 0;
-       resv_huge_pages += delta;
        if (delta < 0)
                return_unused_surplus_pages((unsigned long) -delta);
 
index 631002d085d1374dfdfe734f761aaf3e6a65dde3..8b9f6cae938e98090a8850ba31a8aaf24cc1a1c7 100644 (file)
@@ -137,14 +137,21 @@ struct mem_cgroup {
         */
        struct mem_cgroup_stat stat;
 };
+static struct mem_cgroup init_mem_cgroup;
 
 /*
  * We use the lower bit of the page->page_cgroup pointer as a bit spin
- * lock. We need to ensure that page->page_cgroup is atleast two
- * byte aligned (based on comments from Nick Piggin)
+ * lock.  We need to ensure that page->page_cgroup is at least two
+ * byte aligned (based on comments from Nick Piggin).  But since
+ * bit_spin_lock doesn't actually set that lock bit in a non-debug
+ * uniprocessor kernel, we should avoid setting it here too.
  */
 #define PAGE_CGROUP_LOCK_BIT   0x0
-#define PAGE_CGROUP_LOCK               (1 << PAGE_CGROUP_LOCK_BIT)
+#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
+#define PAGE_CGROUP_LOCK       (1 << PAGE_CGROUP_LOCK_BIT)
+#else
+#define PAGE_CGROUP_LOCK       0x0
+#endif
 
 /*
  * A page_cgroup page is associated with every page descriptor. The
@@ -154,37 +161,27 @@ struct page_cgroup {
        struct list_head lru;           /* per cgroup LRU list */
        struct page *page;
        struct mem_cgroup *mem_cgroup;
-       atomic_t ref_cnt;               /* Helpful when pages move b/w  */
-                                       /* mapped and cached states     */
-       int      flags;
+       int ref_cnt;                    /* cached, mapped, migrating */
+       int flags;
 };
 #define PAGE_CGROUP_FLAG_CACHE (0x1)   /* charged as cache */
 #define PAGE_CGROUP_FLAG_ACTIVE (0x2)  /* page is active in this cgroup */
 
-static inline int page_cgroup_nid(struct page_cgroup *pc)
+static int page_cgroup_nid(struct page_cgroup *pc)
 {
        return page_to_nid(pc->page);
 }
 
-static inline enum zone_type page_cgroup_zid(struct page_cgroup *pc)
+static enum zone_type page_cgroup_zid(struct page_cgroup *pc)
 {
        return page_zonenum(pc->page);
 }
 
-enum {
-       MEM_CGROUP_TYPE_UNSPEC = 0,
-       MEM_CGROUP_TYPE_MAPPED,
-       MEM_CGROUP_TYPE_CACHED,
-       MEM_CGROUP_TYPE_ALL,
-       MEM_CGROUP_TYPE_MAX,
-};
-
 enum charge_type {
        MEM_CGROUP_CHARGE_TYPE_CACHE = 0,
        MEM_CGROUP_CHARGE_TYPE_MAPPED,
 };
 
-
 /*
  * Always modified under lru lock. Then, not necessary to preempt_disable()
  */
@@ -193,23 +190,21 @@ static void mem_cgroup_charge_statistics(struct mem_cgroup *mem, int flags,
 {
        int val = (charge)? 1 : -1;
        struct mem_cgroup_stat *stat = &mem->stat;
-       VM_BUG_ON(!irqs_disabled());
 
+       VM_BUG_ON(!irqs_disabled());
        if (flags & PAGE_CGROUP_FLAG_CACHE)
-               __mem_cgroup_stat_add_safe(stat,
-                                       MEM_CGROUP_STAT_CACHE, val);
+               __mem_cgroup_stat_add_safe(stat, MEM_CGROUP_STAT_CACHE, val);
        else
                __mem_cgroup_stat_add_safe(stat, MEM_CGROUP_STAT_RSS, val);
 }
 
-static inline struct mem_cgroup_per_zone *
+static struct mem_cgroup_per_zone *
 mem_cgroup_zoneinfo(struct mem_cgroup *mem, int nid, int zid)
 {
-       BUG_ON(!mem->info.nodeinfo[nid]);
        return &mem->info.nodeinfo[nid]->zoneinfo[zid];
 }
 
-static inline struct mem_cgroup_per_zone *
+static struct mem_cgroup_per_zone *
 page_cgroup_zoneinfo(struct page_cgroup *pc)
 {
        struct mem_cgroup *mem = pc->mem_cgroup;
@@ -234,18 +229,14 @@ static unsigned long mem_cgroup_get_all_zonestat(struct mem_cgroup *mem,
        return total;
 }
 
-static struct mem_cgroup init_mem_cgroup;
-
-static inline
-struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont)
+static struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont)
 {
        return container_of(cgroup_subsys_state(cont,
                                mem_cgroup_subsys_id), struct mem_cgroup,
                                css);
 }
 
-static inline
-struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p)
+static struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p)
 {
        return container_of(task_subsys_state(p, mem_cgroup_subsys_id),
                                struct mem_cgroup, css);
@@ -267,81 +258,33 @@ void mm_free_cgroup(struct mm_struct *mm)
 
 static inline int page_cgroup_locked(struct page *page)
 {
-       return bit_spin_is_locked(PAGE_CGROUP_LOCK_BIT,
-                                       &page->page_cgroup);
+       return bit_spin_is_locked(PAGE_CGROUP_LOCK_BIT, &page->page_cgroup);
 }
 
-void page_assign_page_cgroup(struct page *page, struct page_cgroup *pc)
+static void page_assign_page_cgroup(struct page *page, struct page_cgroup *pc)
 {
-       int locked;
-
-       /*
-        * While resetting the page_cgroup we might not hold the
-        * page_cgroup lock. free_hot_cold_page() is an example
-        * of such a scenario
-        */
-       if (pc)
-               VM_BUG_ON(!page_cgroup_locked(page));
-       locked = (page->page_cgroup & PAGE_CGROUP_LOCK);
-       page->page_cgroup = ((unsigned long)pc | locked);
+       VM_BUG_ON(!page_cgroup_locked(page));
+       page->page_cgroup = ((unsigned long)pc | PAGE_CGROUP_LOCK);
 }
 
 struct page_cgroup *page_get_page_cgroup(struct page *page)
 {
-       return (struct page_cgroup *)
-               (page->page_cgroup & ~PAGE_CGROUP_LOCK);
+       return (struct page_cgroup *) (page->page_cgroup & ~PAGE_CGROUP_LOCK);
 }
 
-static void __always_inline lock_page_cgroup(struct page *page)
+static void lock_page_cgroup(struct page *page)
 {
        bit_spin_lock(PAGE_CGROUP_LOCK_BIT, &page->page_cgroup);
-       VM_BUG_ON(!page_cgroup_locked(page));
-}
-
-static void __always_inline unlock_page_cgroup(struct page *page)
-{
-       bit_spin_unlock(PAGE_CGROUP_LOCK_BIT, &page->page_cgroup);
 }
 
-/*
- * Tie new page_cgroup to struct page under lock_page_cgroup()
- * This can fail if the page has been tied to a page_cgroup.
- * If success, returns 0.
- */
-static int page_cgroup_assign_new_page_cgroup(struct page *page,
-                                               struct page_cgroup *pc)
+static int try_lock_page_cgroup(struct page *page)
 {
-       int ret = 0;
-
-       lock_page_cgroup(page);
-       if (!page_get_page_cgroup(page))
-               page_assign_page_cgroup(page, pc);
-       else /* A page is tied to other pc. */
-               ret = 1;
-       unlock_page_cgroup(page);
-       return ret;
+       return bit_spin_trylock(PAGE_CGROUP_LOCK_BIT, &page->page_cgroup);
 }
 
-/*
- * Clear page->page_cgroup member under lock_page_cgroup().
- * If given "pc" value is different from one page->page_cgroup,
- * page->cgroup is not cleared.
- * Returns a value of page->page_cgroup at lock taken.
- * A can can detect failure of clearing by following
- *  clear_page_cgroup(page, pc) == pc
- */
-
-static struct page_cgroup *clear_page_cgroup(struct page *page,
-                                               struct page_cgroup *pc)
+static void unlock_page_cgroup(struct page *page)
 {
-       struct page_cgroup *ret;
-       /* lock and clear */
-       lock_page_cgroup(page);
-       ret = page_get_page_cgroup(page);
-       if (likely(ret == pc))
-               page_assign_page_cgroup(page, NULL);
-       unlock_page_cgroup(page);
-       return ret;
+       bit_spin_unlock(PAGE_CGROUP_LOCK_BIT, &page->page_cgroup);
 }
 
 static void __mem_cgroup_remove_list(struct page_cgroup *pc)
@@ -399,7 +342,7 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem)
        int ret;
 
        task_lock(task);
-       ret = task->mm && vm_match_cgroup(task->mm, mem);
+       ret = task->mm && mm_match_cgroup(task->mm, mem);
        task_unlock(task);
        return ret;
 }
@@ -407,18 +350,30 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem)
 /*
  * This routine assumes that the appropriate zone's lru lock is already held
  */
-void mem_cgroup_move_lists(struct page_cgroup *pc, bool active)
+void mem_cgroup_move_lists(struct page *page, bool active)
 {
+       struct page_cgroup *pc;
        struct mem_cgroup_per_zone *mz;
        unsigned long flags;
 
-       if (!pc)
+       /*
+        * We cannot lock_page_cgroup while holding zone's lru_lock,
+        * because other holders of lock_page_cgroup can be interrupted
+        * with an attempt to rotate_reclaimable_page.  But we cannot
+        * safely get to page_cgroup without it, so just try_lock it:
+        * mem_cgroup_isolate_pages allows for page left on wrong list.
+        */
+       if (!try_lock_page_cgroup(page))
                return;
 
-       mz = page_cgroup_zoneinfo(pc);
-       spin_lock_irqsave(&mz->lru_lock, flags);
-       __mem_cgroup_move_lists(pc, active);
-       spin_unlock_irqrestore(&mz->lru_lock, flags);
+       pc = page_get_page_cgroup(page);
+       if (pc) {
+               mz = page_cgroup_zoneinfo(pc);
+               spin_lock_irqsave(&mz->lru_lock, flags);
+               __mem_cgroup_move_lists(pc, active);
+               spin_unlock_irqrestore(&mz->lru_lock, flags);
+       }
+       unlock_page_cgroup(page);
 }
 
 /*
@@ -437,6 +392,7 @@ int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem)
        rss = (long)mem_cgroup_read_stat(&mem->stat, MEM_CGROUP_STAT_RSS);
        return (int)((rss * 100L) / total);
 }
+
 /*
  * This function is called from vmscan.c. In page reclaiming loop. balance
  * between active and inactive list is calculated. For memory controller
@@ -500,7 +456,6 @@ long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem,
        struct mem_cgroup_per_zone *mz = mem_cgroup_zoneinfo(mem, nid, zid);
 
        nr_inactive = MEM_CGROUP_ZSTAT(mz, MEM_CGROUP_ZSTAT_INACTIVE);
-
        return (nr_inactive >> priority);
 }
 
@@ -586,26 +541,21 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
         * with it
         */
 retry:
-       if (page) {
-               lock_page_cgroup(page);
-               pc = page_get_page_cgroup(page);
-               /*
-                * The page_cgroup exists and
-                * the page has already been accounted.
-                */
-               if (pc) {
-                       if (unlikely(!atomic_inc_not_zero(&pc->ref_cnt))) {
-                               /* this page is under being uncharged ? */
-                               unlock_page_cgroup(page);
-                               cpu_relax();
-                               goto retry;
-                       } else {
-                               unlock_page_cgroup(page);
-                               goto done;
-                       }
-               }
+       lock_page_cgroup(page);
+       pc = page_get_page_cgroup(page);
+       /*
+        * The page_cgroup exists and
+        * the page has already been accounted.
+        */
+       if (pc) {
+               VM_BUG_ON(pc->page != page);
+               VM_BUG_ON(pc->ref_cnt <= 0);
+
+               pc->ref_cnt++;
                unlock_page_cgroup(page);
+               goto done;
        }
+       unlock_page_cgroup(page);
 
        pc = kzalloc(sizeof(struct page_cgroup), gfp_mask);
        if (pc == NULL)
@@ -623,16 +573,11 @@ retry:
        rcu_read_lock();
        mem = rcu_dereference(mm->mem_cgroup);
        /*
-        * For every charge from the cgroup, increment reference
-        * count
+        * For every charge from the cgroup, increment reference count
         */
        css_get(&mem->css);
        rcu_read_unlock();
 
-       /*
-        * If we created the page_cgroup, we should free it on exceeding
-        * the cgroup limit.
-        */
        while (res_counter_charge(&mem->res, PAGE_SIZE)) {
                if (!(gfp_mask & __GFP_WAIT))
                        goto out;
@@ -641,12 +586,12 @@ retry:
                        continue;
 
                /*
-                * try_to_free_mem_cgroup_pages() might not give us a full
-                * picture of reclaim. Some pages are reclaimed and might be
-                * moved to swap cache or just unmapped from the cgroup.
-                * Check the limit again to see if the reclaim reduced the
-                * current usage of the cgroup before giving up
-                */
+                * try_to_free_mem_cgroup_pages() might not give us a full
+                * picture of reclaim. Some pages are reclaimed and might be
+                * moved to swap cache or just unmapped from the cgroup.
+                * Check the limit again to see if the reclaim reduced the
+                * current usage of the cgroup before giving up
+                */
                if (res_counter_check_under_limit(&mem->res))
                        continue;
 
@@ -657,14 +602,16 @@ retry:
                congestion_wait(WRITE, HZ/10);
        }
 
-       atomic_set(&pc->ref_cnt, 1);
+       pc->ref_cnt = 1;
        pc->mem_cgroup = mem;
        pc->page = page;
        pc->flags = PAGE_CGROUP_FLAG_ACTIVE;
        if (ctype == MEM_CGROUP_CHARGE_TYPE_CACHE)
                pc->flags |= PAGE_CGROUP_FLAG_CACHE;
 
-       if (!page || page_cgroup_assign_new_page_cgroup(page, pc)) {
+       lock_page_cgroup(page);
+       if (page_get_page_cgroup(page)) {
+               unlock_page_cgroup(page);
                /*
                 * Another charge has been added to this page already.
                 * We take lock_page_cgroup(page) again and read
@@ -673,17 +620,16 @@ retry:
                res_counter_uncharge(&mem->res, PAGE_SIZE);
                css_put(&mem->css);
                kfree(pc);
-               if (!page)
-                       goto done;
                goto retry;
        }
+       page_assign_page_cgroup(page, pc);
 
        mz = page_cgroup_zoneinfo(pc);
        spin_lock_irqsave(&mz->lru_lock, flags);
-       /* Update statistics vector */
        __mem_cgroup_add_list(pc);
        spin_unlock_irqrestore(&mz->lru_lock, flags);
 
+       unlock_page_cgroup(page);
 done:
        return 0;
 out:
@@ -693,70 +639,61 @@ err:
        return -ENOMEM;
 }
 
-int mem_cgroup_charge(struct page *page, struct mm_struct *mm,
-                       gfp_t gfp_mask)
+int mem_cgroup_charge(struct page *page, struct mm_struct *mm, gfp_t gfp_mask)
 {
        return mem_cgroup_charge_common(page, mm, gfp_mask,
-                       MEM_CGROUP_CHARGE_TYPE_MAPPED);
+                               MEM_CGROUP_CHARGE_TYPE_MAPPED);
 }
 
-/*
- * See if the cached pages should be charged at all?
- */
 int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
                                gfp_t gfp_mask)
 {
-       int ret = 0;
        if (!mm)
                mm = &init_mm;
-
-       ret = mem_cgroup_charge_common(page, mm, gfp_mask,
+       return mem_cgroup_charge_common(page, mm, gfp_mask,
                                MEM_CGROUP_CHARGE_TYPE_CACHE);
-       return ret;
 }
 
 /*
  * Uncharging is always a welcome operation, we never complain, simply
- * uncharge. This routine should be called with lock_page_cgroup held
+ * uncharge.
  */
-void mem_cgroup_uncharge(struct page_cgroup *pc)
+void mem_cgroup_uncharge_page(struct page *page)
 {
+       struct page_cgroup *pc;
        struct mem_cgroup *mem;
        struct mem_cgroup_per_zone *mz;
-       struct page *page;
        unsigned long flags;
 
        /*
         * Check if our page_cgroup is valid
         */
+       lock_page_cgroup(page);
+       pc = page_get_page_cgroup(page);
        if (!pc)
-               return;
+               goto unlock;
 
-       if (atomic_dec_and_test(&pc->ref_cnt)) {
-               page = pc->page;
+       VM_BUG_ON(pc->page != page);
+       VM_BUG_ON(pc->ref_cnt <= 0);
+
+       if (--(pc->ref_cnt) == 0) {
                mz = page_cgroup_zoneinfo(pc);
-               /*
-                * get page->cgroup and clear it under lock.
-                * force_empty can drop page->cgroup without checking refcnt.
-                */
+               spin_lock_irqsave(&mz->lru_lock, flags);
+               __mem_cgroup_remove_list(pc);
+               spin_unlock_irqrestore(&mz->lru_lock, flags);
+
+               page_assign_page_cgroup(page, NULL);
                unlock_page_cgroup(page);
-               if (clear_page_cgroup(page, pc) == pc) {
-                       mem = pc->mem_cgroup;
-                       css_put(&mem->css);
-                       res_counter_uncharge(&mem->res, PAGE_SIZE);
-                       spin_lock_irqsave(&mz->lru_lock, flags);
-                       __mem_cgroup_remove_list(pc);
-                       spin_unlock_irqrestore(&mz->lru_lock, flags);
-                       kfree(pc);
-               }
-               lock_page_cgroup(page);
+
+               mem = pc->mem_cgroup;
+               res_counter_uncharge(&mem->res, PAGE_SIZE);
+               css_put(&mem->css);
+
+               kfree(pc);
+               return;
        }
-}
 
-void mem_cgroup_uncharge_page(struct page *page)
-{
-       lock_page_cgroup(page);
-       mem_cgroup_uncharge(page_get_page_cgroup(page));
+unlock:
        unlock_page_cgroup(page);
 }
 
@@ -764,63 +701,59 @@ void mem_cgroup_uncharge_page(struct page *page)
  * Returns non-zero if a page (under migration) has valid page_cgroup member.
  * Refcnt of page_cgroup is incremented.
  */
-
 int mem_cgroup_prepare_migration(struct page *page)
 {
        struct page_cgroup *pc;
-       int ret = 0;
+
        lock_page_cgroup(page);
        pc = page_get_page_cgroup(page);
-       if (pc && atomic_inc_not_zero(&pc->ref_cnt))
-               ret = 1;
+       if (pc)
+               pc->ref_cnt++;
        unlock_page_cgroup(page);
-       return ret;
+       return pc != NULL;
 }
 
 void mem_cgroup_end_migration(struct page *page)
 {
-       struct page_cgroup *pc;
-
-       lock_page_cgroup(page);
-       pc = page_get_page_cgroup(page);
-       mem_cgroup_uncharge(pc);
-       unlock_page_cgroup(page);
+       mem_cgroup_uncharge_page(page);
 }
+
 /*
- * We know both *page* and *newpage* are now not-on-LRU and Pg_locked.
+ * We know both *page* and *newpage* are now not-on-LRU and PG_locked.
  * And no race with uncharge() routines because page_cgroup for *page*
  * has extra one reference by mem_cgroup_prepare_migration.
  */
-
 void mem_cgroup_page_migration(struct page *page, struct page *newpage)
 {
        struct page_cgroup *pc;
-       struct mem_cgroup *mem;
-       unsigned long flags;
        struct mem_cgroup_per_zone *mz;
-retry:
+       unsigned long flags;
+
+       lock_page_cgroup(page);
        pc = page_get_page_cgroup(page);
-       if (!pc)
+       if (!pc) {
+               unlock_page_cgroup(page);
                return;
-       mem = pc->mem_cgroup;
+       }
+
        mz = page_cgroup_zoneinfo(pc);
-       if (clear_page_cgroup(page, pc) != pc)
-               goto retry;
        spin_lock_irqsave(&mz->lru_lock, flags);
-
        __mem_cgroup_remove_list(pc);
        spin_unlock_irqrestore(&mz->lru_lock, flags);
 
+       page_assign_page_cgroup(page, NULL);
+       unlock_page_cgroup(page);
+
        pc->page = newpage;
        lock_page_cgroup(newpage);
        page_assign_page_cgroup(newpage, pc);
-       unlock_page_cgroup(newpage);
 
        mz = page_cgroup_zoneinfo(pc);
        spin_lock_irqsave(&mz->lru_lock, flags);
        __mem_cgroup_add_list(pc);
        spin_unlock_irqrestore(&mz->lru_lock, flags);
-       return;
+
+       unlock_page_cgroup(newpage);
 }
 
 /*
@@ -829,14 +762,13 @@ retry:
  * *And* this routine doesn't reclaim page itself, just removes page_cgroup.
  */
 #define FORCE_UNCHARGE_BATCH   (128)
-static void
-mem_cgroup_force_empty_list(struct mem_cgroup *mem,
+static void mem_cgroup_force_empty_list(struct mem_cgroup *mem,
                            struct mem_cgroup_per_zone *mz,
                            int active)
 {
        struct page_cgroup *pc;
        struct page *page;
-       int count;
+       int count = FORCE_UNCHARGE_BATCH;
        unsigned long flags;
        struct list_head *list;
 
@@ -845,46 +777,36 @@ mem_cgroup_force_empty_list(struct mem_cgroup *mem,
        else
                list = &mz->inactive_list;
 
-       if (list_empty(list))
-               return;
-retry:
-       count = FORCE_UNCHARGE_BATCH;
        spin_lock_irqsave(&mz->lru_lock, flags);
-
-       while (--count && !list_empty(list)) {
+       while (!list_empty(list)) {
                pc = list_entry(list->prev, struct page_cgroup, lru);
                page = pc->page;
-               /* Avoid race with charge */
-               atomic_set(&pc->ref_cnt, 0);
-               if (clear_page_cgroup(page, pc) == pc) {
-                       css_put(&mem->css);
-                       res_counter_uncharge(&mem->res, PAGE_SIZE);
-                       __mem_cgroup_remove_list(pc);
-                       kfree(pc);
-               } else  /* being uncharged ? ...do relax */
-                       break;
+               get_page(page);
+               spin_unlock_irqrestore(&mz->lru_lock, flags);
+               mem_cgroup_uncharge_page(page);
+               put_page(page);
+               if (--count <= 0) {
+                       count = FORCE_UNCHARGE_BATCH;
+                       cond_resched();
+               }
+               spin_lock_irqsave(&mz->lru_lock, flags);
        }
        spin_unlock_irqrestore(&mz->lru_lock, flags);
-       if (!list_empty(list)) {
-               cond_resched();
-               goto retry;
-       }
-       return;
 }
 
 /*
  * make mem_cgroup's charge to be 0 if there is no task.
  * This enables deleting this mem_cgroup.
  */
-
-int mem_cgroup_force_empty(struct mem_cgroup *mem)
+static int mem_cgroup_force_empty(struct mem_cgroup *mem)
 {
        int ret = -EBUSY;
        int node, zid;
+
        css_get(&mem->css);
        /*
         * page reclaim code (kswapd etc..) will move pages between
-`       * active_list <-> inactive_list while we don't take a lock.
+        * active_list <-> inactive_list while we don't take a lock.
         * So, we have to do loop here until all lists are empty.
         */
        while (mem->res.usage > 0) {
@@ -906,9 +828,7 @@ out:
        return ret;
 }
 
-
-
-int mem_cgroup_write_strategy(char *buf, unsigned long long *tmp)
+static int mem_cgroup_write_strategy(char *buf, unsigned long long *tmp)
 {
        *tmp = memparse(buf, &buf);
        if (*buf != '\0')
@@ -945,8 +865,7 @@ static ssize_t mem_force_empty_write(struct cgroup *cont,
                                size_t nbytes, loff_t *ppos)
 {
        struct mem_cgroup *mem = mem_cgroup_from_cont(cont);
-       int ret;
-       ret = mem_cgroup_force_empty(mem);
+       int ret = mem_cgroup_force_empty(mem);
        if (!ret)
                ret = nbytes;
        return ret;
@@ -955,7 +874,6 @@ static ssize_t mem_force_empty_write(struct cgroup *cont,
 /*
  * Note: This should be removed if cgroup supports write-only file.
  */
-
 static ssize_t mem_force_empty_read(struct cgroup *cont,
                                struct cftype *cft,
                                struct file *file, char __user *userbuf,
@@ -964,7 +882,6 @@ static ssize_t mem_force_empty_read(struct cgroup *cont,
        return -EINVAL;
 }
 
-
 static const struct mem_cgroup_stat_desc {
        const char *msg;
        u64 unit;
@@ -1017,8 +934,6 @@ static int mem_control_stat_open(struct inode *unused, struct file *file)
        return single_open(file, mem_control_stat_show, cont);
 }
 
-
-
 static struct cftype mem_cgroup_files[] = {
        {
                .name = "usage_in_bytes",
@@ -1084,9 +999,6 @@ static void free_mem_cgroup_per_zone_info(struct mem_cgroup *mem, int node)
        kfree(mem->info.nodeinfo[node]);
 }
 
-
-static struct mem_cgroup init_mem_cgroup;
-
 static struct cgroup_subsys_state *
 mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)
 {
@@ -1176,7 +1088,6 @@ static void mem_cgroup_move_task(struct cgroup_subsys *ss,
 
 out:
        mmput(mm);
-       return;
 }
 
 struct cgroup_subsys mem_cgroup_subsys = {
index ce3c9e4492d803b011f50ea8641e477056116ddd..0d14d1e58a5fa78e6b6a01369cc1e0869c77dfe9 100644 (file)
@@ -1711,7 +1711,7 @@ unlock:
        }
        return ret;
 oom_free_new:
-       __free_page(new_page);
+       page_cache_release(new_page);
 oom:
        if (old_page)
                page_cache_release(old_page);
@@ -2093,12 +2093,9 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
        unlock_page(page);
 
        if (write_access) {
-               /* XXX: We could OR the do_wp_page code with this one? */
-               if (do_wp_page(mm, vma, address,
-                               page_table, pmd, ptl, pte) & VM_FAULT_OOM) {
-                       mem_cgroup_uncharge_page(page);
-                       ret = VM_FAULT_OOM;
-               }
+               ret |= do_wp_page(mm, vma, address, page_table, pmd, ptl, pte);
+               if (ret & VM_FAULT_ERROR)
+                       ret &= VM_FAULT_ERROR;
                goto out;
        }
 
@@ -2163,7 +2160,7 @@ release:
        page_cache_release(page);
        goto unlock;
 oom_free_page:
-       __free_page(page);
+       page_cache_release(page);
 oom:
        return VM_FAULT_OOM;
 }
index a73504ff5ab982007b2e0355e49f0dedcac65899..4e0eccca5e265ac19bc507a171a2f720d27f8c21 100644 (file)
@@ -153,11 +153,6 @@ static void remove_migration_pte(struct vm_area_struct *vma,
                return;
        }
 
-       if (mem_cgroup_charge(new, mm, GFP_KERNEL)) {
-               pte_unmap(ptep);
-               return;
-       }
-
        ptl = pte_lockptr(mm, pmd);
        spin_lock(ptl);
        pte = *ptep;
@@ -169,6 +164,20 @@ static void remove_migration_pte(struct vm_area_struct *vma,
        if (!is_migration_entry(entry) || migration_entry_to_page(entry) != old)
                goto out;
 
+       /*
+        * Yes, ignore the return value from a GFP_ATOMIC mem_cgroup_charge.
+        * Failure is not an option here: we're now expected to remove every
+        * migration pte, and will cause crashes otherwise.  Normally this
+        * is not an issue: mem_cgroup_prepare_migration bumped up the old
+        * page_cgroup count for safety, that's now attached to the new page,
+        * so this charge should just be another incrementation of the count,
+        * to keep in balance with rmap.c's mem_cgroup_uncharging.  But if
+        * there's been a force_empty, those reference counts may no longer
+        * be reliable, and this charge can actually fail: oh well, we don't
+        * make the situation any worse by proceeding as if it had succeeded.
+        */
+       mem_cgroup_charge(new, mm, GFP_ATOMIC);
+
        get_page(new);
        pte = pte_mkold(mk_pte(new, vma->vm_page_prot));
        if (is_write_migration_entry(entry))
index 4194b9db0104d54dea5ea871e0e111695fa49cba..44b2da11bf43f75a3714761ab09217339579977d 100644 (file)
@@ -412,7 +412,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
        return oom_kill_task(p);
 }
 
-#ifdef CONFIG_CGROUP_MEM_CONT
+#ifdef CONFIG_CGROUP_MEM_RES_CTLR
 void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask)
 {
        unsigned long points = 0;
index 8896e874a67dae2c558034dbbf27491b231c2b2a..402a504f12283f23cb510ec9ebfce4d0d52eea29 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/swap.h>
 #include <linux/interrupt.h>
 #include <linux/pagemap.h>
+#include <linux/jiffies.h>
 #include <linux/bootmem.h>
 #include <linux/compiler.h>
 #include <linux/kernel.h>
@@ -221,13 +222,19 @@ static inline int bad_range(struct zone *zone, struct page *page)
 
 static void bad_page(struct page *page)
 {
-       printk(KERN_EMERG "Bad page state in process '%s'\n"
-               KERN_EMERG "page:%p flags:0x%0*lx mapping:%p mapcount:%d count:%d\n"
-               KERN_EMERG "Trying to fix it up, but a reboot is needed\n"
-               KERN_EMERG "Backtrace:\n",
+       void *pc = page_get_page_cgroup(page);
+
+       printk(KERN_EMERG "Bad page state in process '%s'\n" KERN_EMERG
+               "page:%p flags:0x%0*lx mapping:%p mapcount:%d count:%d\n",
                current->comm, page, (int)(2*sizeof(unsigned long)),
                (unsigned long)page->flags, page->mapping,
                page_mapcount(page), page_count(page));
+       if (pc) {
+               printk(KERN_EMERG "cgroup:%p\n", pc);
+               page_reset_bad_cgroup(page);
+       }
+       printk(KERN_EMERG "Trying to fix it up, but a reboot is needed\n"
+               KERN_EMERG "Backtrace:\n");
        dump_stack();
        page->flags &= ~(1 << PG_lru    |
                        1 << PG_private |
@@ -453,6 +460,7 @@ static inline int free_pages_check(struct page *page)
 {
        if (unlikely(page_mapcount(page) |
                (page->mapping != NULL)  |
+               (page_get_page_cgroup(page) != NULL) |
                (page_count(page) != 0)  |
                (page->flags & (
                        1 << PG_lru     |
@@ -602,6 +610,7 @@ static int prep_new_page(struct page *page, int order, gfp_t gfp_flags)
 {
        if (unlikely(page_mapcount(page) |
                (page->mapping != NULL)  |
+               (page_get_page_cgroup(page) != NULL) |
                (page_count(page) != 0)  |
                (page->flags & (
                        1 << PG_lru     |
@@ -988,7 +997,6 @@ static void free_hot_cold_page(struct page *page, int cold)
 
        if (!PageHighMem(page))
                debug_check_no_locks_freed(page_address(page), PAGE_SIZE);
-       VM_BUG_ON(page_get_page_cgroup(page));
        arch_free_page(page, 0);
        kernel_map_pages(page, 1, 0);
 
@@ -1276,7 +1284,7 @@ static nodemask_t *zlc_setup(struct zonelist *zonelist, int alloc_flags)
        if (!zlc)
                return NULL;
 
-       if (jiffies - zlc->last_full_zap > 1 * HZ) {
+       if (time_after(jiffies, zlc->last_full_zap + HZ)) {
                bitmap_zero(zlc->fullzones, MAX_ZONES_PER_ZONELIST);
                zlc->last_full_zap = jiffies;
        }
@@ -2527,7 +2535,6 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
                set_page_links(page, zone, nid, pfn);
                init_page_count(page);
                reset_page_mapcount(page);
-               page_assign_page_cgroup(page, NULL);
                SetPageReserved(page);
 
                /*
index 8fd527c4e2bff8e45c929c42f01c60834c573ef9..0c9a2df06c39cc3733f0e5b6975d82d4b82807ae 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -321,7 +321,7 @@ static int page_referenced_anon(struct page *page,
                 * counting on behalf of references from different
                 * cgroups
                 */
-               if (mem_cont && !vm_match_cgroup(vma->vm_mm, mem_cont))
+               if (mem_cont && !mm_match_cgroup(vma->vm_mm, mem_cont))
                        continue;
                referenced += page_referenced_one(page, vma, &mapcount);
                if (!mapcount)
@@ -382,7 +382,7 @@ static int page_referenced_file(struct page *page,
                 * counting on behalf of references from different
                 * cgroups
                 */
-               if (mem_cont && !vm_match_cgroup(vma->vm_mm, mem_cont))
+               if (mem_cont && !mm_match_cgroup(vma->vm_mm, mem_cont))
                        continue;
                if ((vma->vm_flags & (VM_LOCKED|VM_MAYSHARE))
                                  == (VM_LOCKED|VM_MAYSHARE)) {
index 90b576cbc06e40fb0f43d06f37f5ef24deee9f13..3372bc579e896f474ef24cffa929b69228ff9445 100644 (file)
@@ -1370,14 +1370,17 @@ repeat:
                        shmem_swp_unmap(entry);
                        spin_unlock(&info->lock);
                        unlock_page(swappage);
-                       page_cache_release(swappage);
                        if (error == -ENOMEM) {
                                /* allow reclaim from this memory cgroup */
-                               error = mem_cgroup_cache_charge(NULL,
+                               error = mem_cgroup_cache_charge(swappage,
                                        current->mm, gfp & ~__GFP_HIGHMEM);
-                               if (error)
+                               if (error) {
+                                       page_cache_release(swappage);
                                        goto failed;
+                               }
+                               mem_cgroup_uncharge_page(swappage);
                        }
+                       page_cache_release(swappage);
                        goto repeat;
                }
        } else if (sgp == SGP_READ && !filepage) {
index 74c65af0a54f4c112e6f2bc223018deb74771d25..0863fd38a5ce06a87392f5ba753606a516a5d262 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -291,32 +291,16 @@ static inline struct kmem_cache_cpu *get_cpu_slab(struct kmem_cache *s, int cpu)
 #endif
 }
 
-/*
- * The end pointer in a slab is special. It points to the first object in the
- * slab but has bit 0 set to mark it.
- *
- * Note that SLUB relies on page_mapping returning NULL for pages with bit 0
- * in the mapping set.
- */
-static inline int is_end(void *addr)
-{
-       return (unsigned long)addr & PAGE_MAPPING_ANON;
-}
-
-static void *slab_address(struct page *page)
-{
-       return page->end - PAGE_MAPPING_ANON;
-}
-
+/* Verify that a pointer has an address that is valid within a slab page */
 static inline int check_valid_pointer(struct kmem_cache *s,
                                struct page *page, const void *object)
 {
        void *base;
 
-       if (object == page->end)
+       if (!object)
                return 1;
 
-       base = slab_address(page);
+       base = page_address(page);
        if (object < base || object >= base + s->objects * s->size ||
                (object - base) % s->size) {
                return 0;
@@ -349,8 +333,7 @@ static inline void set_freepointer(struct kmem_cache *s, void *object, void *fp)
 
 /* Scan freelist */
 #define for_each_free_object(__p, __s, __free) \
-       for (__p = (__free); (__p) != page->end; __p = get_freepointer((__s),\
-               __p))
+       for (__p = (__free); __p; __p = get_freepointer((__s), __p))
 
 /* Determine object index from a given position */
 static inline int slab_index(void *p, struct kmem_cache *s, void *addr)
@@ -502,7 +485,7 @@ static void slab_fix(struct kmem_cache *s, char *fmt, ...)
 static void print_trailer(struct kmem_cache *s, struct page *page, u8 *p)
 {
        unsigned int off;       /* Offset of last byte */
-       u8 *addr = slab_address(page);
+       u8 *addr = page_address(page);
 
        print_tracking(s, p);
 
@@ -637,7 +620,7 @@ static int check_bytes_and_report(struct kmem_cache *s, struct page *page,
  *     A. Free pointer (if we cannot overwrite object on free)
  *     B. Tracking data for SLAB_STORE_USER
  *     C. Padding to reach required alignment boundary or at mininum
- *             one word if debuggin is on to be able to detect writes
+ *             one word if debugging is on to be able to detect writes
  *             before the word boundary.
  *
  *     Padding is done using 0x5a (POISON_INUSE)
@@ -680,7 +663,7 @@ static int slab_pad_check(struct kmem_cache *s, struct page *page)
        if (!(s->flags & SLAB_POISON))
                return 1;
 
-       start = slab_address(page);
+       start = page_address(page);
        end = start + (PAGE_SIZE << s->order);
        length = s->objects * s->size;
        remainder = end - (start + length);
@@ -748,7 +731,7 @@ static int check_object(struct kmem_cache *s, struct page *page,
                 * of the free objects in this slab. May cause
                 * another error because the object count is now wrong.
                 */
-               set_freepointer(s, p, page->end);
+               set_freepointer(s, p, NULL);
                return 0;
        }
        return 1;
@@ -782,18 +765,18 @@ static int on_freelist(struct kmem_cache *s, struct page *page, void *search)
        void *fp = page->freelist;
        void *object = NULL;
 
-       while (fp != page->end && nr <= s->objects) {
+       while (fp && nr <= s->objects) {
                if (fp == search)
                        return 1;
                if (!check_valid_pointer(s, page, fp)) {
                        if (object) {
                                object_err(s, page, object,
                                        "Freechain corrupt");
-                               set_freepointer(s, object, page->end);
+                               set_freepointer(s, object, NULL);
                                break;
                        } else {
                                slab_err(s, page, "Freepointer corrupt");
-                               page->freelist = page->end;
+                               page->freelist = NULL;
                                page->inuse = s->objects;
                                slab_fix(s, "Freelist cleared");
                                return 0;
@@ -870,7 +853,7 @@ static int alloc_debug_processing(struct kmem_cache *s, struct page *page,
        if (!check_slab(s, page))
                goto bad;
 
-       if (object && !on_freelist(s, page, object)) {
+       if (!on_freelist(s, page, object)) {
                object_err(s, page, object, "Object already allocated");
                goto bad;
        }
@@ -880,7 +863,7 @@ static int alloc_debug_processing(struct kmem_cache *s, struct page *page,
                goto bad;
        }
 
-       if (object && !check_object(s, page, object, 0))
+       if (!check_object(s, page, object, 0))
                goto bad;
 
        /* Success perform special debug activities for allocs */
@@ -899,7 +882,7 @@ bad:
                 */
                slab_fix(s, "Marking all objects used");
                page->inuse = s->objects;
-               page->freelist = page->end;
+               page->freelist = NULL;
        }
        return 0;
 }
@@ -939,7 +922,7 @@ static int free_debug_processing(struct kmem_cache *s, struct page *page,
        }
 
        /* Special debug activities for freeing objects */
-       if (!SlabFrozen(page) && page->freelist == page->end)
+       if (!SlabFrozen(page) && !page->freelist)
                remove_full(s, page);
        if (s->flags & SLAB_STORE_USER)
                set_track(s, object, TRACK_FREE, addr);
@@ -1015,30 +998,11 @@ static unsigned long kmem_cache_flags(unsigned long objsize,
        void (*ctor)(struct kmem_cache *, void *))
 {
        /*
-        * The page->offset field is only 16 bit wide. This is an offset
-        * in units of words from the beginning of an object. If the slab
-        * size is bigger then we cannot move the free pointer behind the
-        * object anymore.
-        *
-        * On 32 bit platforms the limit is 256k. On 64bit platforms
-        * the limit is 512k.
-        *
-        * Debugging or ctor may create a need to move the free
-        * pointer. Fail if this happens.
+        * Enable debugging if selected on the kernel commandline.
         */
-       if (objsize >= 65535 * sizeof(void *)) {
-               BUG_ON(flags & (SLAB_RED_ZONE | SLAB_POISON |
-                               SLAB_STORE_USER | SLAB_DESTROY_BY_RCU));
-               BUG_ON(ctor);
-       } else {
-               /*
-                * Enable debugging if selected on the kernel commandline.
-                */
-               if (slub_debug && (!slub_debug_slabs ||
-                   strncmp(slub_debug_slabs, name,
-                       strlen(slub_debug_slabs)) == 0))
-                               flags |= slub_debug;
-       }
+       if (slub_debug && (!slub_debug_slabs ||
+           strncmp(slub_debug_slabs, name, strlen(slub_debug_slabs)) == 0))
+                       flags |= slub_debug;
 
        return flags;
 }
@@ -1124,7 +1088,6 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
                SetSlabDebug(page);
 
        start = page_address(page);
-       page->end = start + 1;
 
        if (unlikely(s->flags & SLAB_POISON))
                memset(start, POISON_INUSE, PAGE_SIZE << s->order);
@@ -1136,7 +1099,7 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
                last = p;
        }
        setup_object(s, page, last);
-       set_freepointer(s, last, page->end);
+       set_freepointer(s, last, NULL);
 
        page->freelist = start;
        page->inuse = 0;
@@ -1152,7 +1115,7 @@ static void __free_slab(struct kmem_cache *s, struct page *page)
                void *p;
 
                slab_pad_check(s, page);
-               for_each_object(p, s, slab_address(page))
+               for_each_object(p, s, page_address(page))
                        check_object(s, page, p, 0);
                ClearSlabDebug(page);
        }
@@ -1162,7 +1125,6 @@ static void __free_slab(struct kmem_cache *s, struct page *page)
                NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE,
                -pages);
 
-       page->mapping = NULL;
        __free_pages(page, s->order);
 }
 
@@ -1307,7 +1269,7 @@ static struct page *get_any_partial(struct kmem_cache *s, gfp_t flags)
         * may return off node objects because partial slabs are obtained
         * from other nodes and filled up.
         *
-        * If /sys/slab/xx/defrag_ratio is set to 100 (which makes
+        * If /sys/kernel/slab/xx/defrag_ratio is set to 100 (which makes
         * defrag_ratio = 1000) then every (well almost) allocation will
         * first attempt to defrag slab caches on other nodes. This means
         * scanning over all nodes to look for partial slabs which may be
@@ -1366,7 +1328,7 @@ static void unfreeze_slab(struct kmem_cache *s, struct page *page, int tail)
        ClearSlabFrozen(page);
        if (page->inuse) {
 
-               if (page->freelist != page->end) {
+               if (page->freelist) {
                        add_partial(n, page, tail);
                        stat(c, tail ? DEACTIVATE_TO_TAIL : DEACTIVATE_TO_HEAD);
                } else {
@@ -1382,9 +1344,11 @@ static void unfreeze_slab(struct kmem_cache *s, struct page *page, int tail)
                         * Adding an empty slab to the partial slabs in order
                         * to avoid page allocator overhead. This slab needs
                         * to come after the other slabs with objects in
-                        * order to fill them up. That way the size of the
-                        * partial list stays small. kmem_cache_shrink can
-                        * reclaim empty slabs from the partial list.
+                        * so that the others get filled first. That way the
+                        * size of the partial list stays small.
+                        *
+                        * kmem_cache_shrink can reclaim any empty slabs from the
+                        * partial list.
                         */
                        add_partial(n, page, 1);
                        slab_unlock(page);
@@ -1407,15 +1371,11 @@ static void deactivate_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
        if (c->freelist)
                stat(c, DEACTIVATE_REMOTE_FREES);
        /*
-        * Merge cpu freelist into freelist. Typically we get here
+        * Merge cpu freelist into slab freelist. Typically we get here
         * because both freelists are empty. So this is unlikely
         * to occur.
-        *
-        * We need to use _is_end here because deactivate slab may
-        * be called for a debug slab. Then c->freelist may contain
-        * a dummy pointer.
         */
-       while (unlikely(!is_end(c->freelist))) {
+       while (unlikely(c->freelist)) {
                void **object;
 
                tail = 0;       /* Hot objects. Put the slab first */
@@ -1442,6 +1402,7 @@ static inline void flush_slab(struct kmem_cache *s, struct kmem_cache_cpu *c)
 
 /*
  * Flush cpu slab.
+ *
  * Called from IPI handler with interrupts disabled.
  */
 static inline void __flush_cpu_slab(struct kmem_cache *s, int cpu)
@@ -1500,7 +1461,8 @@ static inline int node_match(struct kmem_cache_cpu *c, int node)
  * rest of the freelist to the lockless freelist.
  *
  * And if we were unable to get a new slab from the partial slab lists then
- * we need to allocate a new slab. This is slowest path since we may sleep.
+ * we need to allocate a new slab. This is the slowest path since it involves
+ * a call to the page allocator and the setup of a new slab.
  */
 static void *__slab_alloc(struct kmem_cache *s,
                gfp_t gfpflags, int node, void *addr, struct kmem_cache_cpu *c)
@@ -1514,18 +1476,19 @@ static void *__slab_alloc(struct kmem_cache *s,
        slab_lock(c->page);
        if (unlikely(!node_match(c, node)))
                goto another_slab;
+
        stat(c, ALLOC_REFILL);
+
 load_freelist:
        object = c->page->freelist;
-       if (unlikely(object == c->page->end))
+       if (unlikely(!object))
                goto another_slab;
        if (unlikely(SlabDebug(c->page)))
                goto debug;
 
-       object = c->page->freelist;
        c->freelist = object[c->offset];
        c->page->inuse = s->objects;
-       c->page->freelist = c->page->end;
+       c->page->freelist = NULL;
        c->node = page_to_nid(c->page);
 unlock_out:
        slab_unlock(c->page);
@@ -1578,7 +1541,6 @@ new_slab:
 
        return NULL;
 debug:
-       object = c->page->freelist;
        if (!alloc_debug_processing(s, c->page, object, addr))
                goto another_slab;
 
@@ -1607,7 +1569,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s,
 
        local_irq_save(flags);
        c = get_cpu_slab(s, smp_processor_id());
-       if (unlikely(is_end(c->freelist) || !node_match(c, node)))
+       if (unlikely(!c->freelist || !node_match(c, node)))
 
                object = __slab_alloc(s, gfpflags, node, addr, c);
 
@@ -1659,6 +1621,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page,
 
        if (unlikely(SlabDebug(page)))
                goto debug;
+
 checks_ok:
        prior = object[offset] = page->freelist;
        page->freelist = object;
@@ -1673,11 +1636,10 @@ checks_ok:
                goto slab_empty;
 
        /*
-        * Objects left in the slab. If it
-        * was not on the partial list before
+        * Objects left in the slab. If it was not on the partial list before
         * then add it.
         */
-       if (unlikely(prior == page->end)) {
+       if (unlikely(!prior)) {
                add_partial(get_node(s, page_to_nid(page)), page, 1);
                stat(c, FREE_ADD_PARTIAL);
        }
@@ -1687,7 +1649,7 @@ out_unlock:
        return;
 
 slab_empty:
-       if (prior != page->end) {
+       if (prior) {
                /*
                 * Slab still on the partial list.
                 */
@@ -1724,8 +1686,8 @@ static __always_inline void slab_free(struct kmem_cache *s,
        unsigned long flags;
 
        local_irq_save(flags);
-       debug_check_no_locks_freed(object, s->objsize);
        c = get_cpu_slab(s, smp_processor_id());
+       debug_check_no_locks_freed(object, c->objsize);
        if (likely(page == c->page && c->node >= 0)) {
                object[c->offset] = c->freelist;
                c->freelist = object;
@@ -1888,13 +1850,11 @@ static unsigned long calculate_alignment(unsigned long flags,
                unsigned long align, unsigned long size)
 {
        /*
-        * If the user wants hardware cache aligned objects then
-        * follow that suggestion if the object is sufficiently
-        * large.
+        * If the user wants hardware cache aligned objects then follow that
+        * suggestion if the object is sufficiently large.
         *
-        * The hardware cache alignment cannot override the
-        * specified alignment though. If that is greater
-        * then use it.
+        * The hardware cache alignment cannot override the specified
+        * alignment though. If that is greater then use it.
         */
        if ((flags & SLAB_HWCACHE_ALIGN) &&
                        size > cache_line_size() / 2)
@@ -1910,7 +1870,7 @@ static void init_kmem_cache_cpu(struct kmem_cache *s,
                        struct kmem_cache_cpu *c)
 {
        c->page = NULL;
-       c->freelist = (void *)PAGE_MAPPING_ANON;
+       c->freelist = NULL;
        c->node = 0;
        c->offset = s->offset / sizeof(void *);
        c->objsize = s->objsize;
@@ -2092,6 +2052,7 @@ static struct kmem_cache_node *early_kmem_cache_node_alloc(gfp_t gfpflags,
 #endif
        init_kmem_cache_node(n);
        atomic_long_inc(&n->nr_slabs);
+
        /*
         * lockdep requires consistent irq usage for each lock
         * so even though there cannot be a race this early in
@@ -2172,6 +2133,14 @@ static int calculate_sizes(struct kmem_cache *s)
        unsigned long size = s->objsize;
        unsigned long align = s->align;
 
+       /*
+        * Round up object size to the next word boundary. We can only
+        * place the free pointer at word boundaries and this determines
+        * the possible location of the free pointer.
+        */
+       size = ALIGN(size, sizeof(void *));
+
+#ifdef CONFIG_SLUB_DEBUG
        /*
         * Determine if we can poison the object itself. If the user of
         * the slab may touch the object after free or before allocation
@@ -2183,14 +2152,7 @@ static int calculate_sizes(struct kmem_cache *s)
        else
                s->flags &= ~__OBJECT_POISON;
 
-       /*
-        * Round up object size to the next word boundary. We can only
-        * place the free pointer at word boundaries and this determines
-        * the possible location of the free pointer.
-        */
-       size = ALIGN(size, sizeof(void *));
 
-#ifdef CONFIG_SLUB_DEBUG
        /*
         * If we are Redzoning then check if there is some space between the
         * end of the object and the free pointer. If not then add an
@@ -2343,7 +2305,7 @@ int kmem_ptr_validate(struct kmem_cache *s, const void *object)
        /*
         * We could also check if the object is on the slabs freelist.
         * But this would be too expensive and it seems that the main
-        * purpose of kmem_ptr_valid is to check if the object belongs
+        * purpose of kmem_ptr_valid() is to check if the object belongs
         * to a certain slab.
         */
        return 1;
@@ -2630,13 +2592,24 @@ void *__kmalloc(size_t size, gfp_t flags)
 }
 EXPORT_SYMBOL(__kmalloc);
 
+static void *kmalloc_large_node(size_t size, gfp_t flags, int node)
+{
+       struct page *page = alloc_pages_node(node, flags | __GFP_COMP,
+                                               get_order(size));
+
+       if (page)
+               return page_address(page);
+       else
+               return NULL;
+}
+
 #ifdef CONFIG_NUMA
 void *__kmalloc_node(size_t size, gfp_t flags, int node)
 {
        struct kmem_cache *s;
 
        if (unlikely(size > PAGE_SIZE))
-               return kmalloc_large(size, flags);
+               return kmalloc_large_node(size, flags, node);
 
        s = get_slab(size, flags);
 
@@ -2653,19 +2626,17 @@ size_t ksize(const void *object)
        struct page *page;
        struct kmem_cache *s;
 
-       BUG_ON(!object);
        if (unlikely(object == ZERO_SIZE_PTR))
                return 0;
 
        page = virt_to_head_page(object);
-       BUG_ON(!page);
 
        if (unlikely(!PageSlab(page)))
                return PAGE_SIZE << compound_order(page);
 
        s = page->slab;
-       BUG_ON(!s);
 
+#ifdef CONFIG_SLUB_DEBUG
        /*
         * Debugging requires use of the padding between object
         * and whatever may come after it.
@@ -2673,6 +2644,7 @@ size_t ksize(const void *object)
        if (s->flags & (SLAB_RED_ZONE | SLAB_POISON))
                return s->objsize;
 
+#endif
        /*
         * If we have the need to store the freelist pointer
         * back there or track user information then we can
@@ -2680,7 +2652,6 @@ size_t ksize(const void *object)
         */
        if (s->flags & (SLAB_DESTROY_BY_RCU | SLAB_STORE_USER))
                return s->inuse;
-
        /*
         * Else we can use all the padding etc for the allocation
         */
@@ -2957,7 +2928,7 @@ void __init kmem_cache_init(void)
        /*
         * Patch up the size_index table if we have strange large alignment
         * requirements for the kmalloc array. This is only the case for
-        * mips it seems. The standard arches will not generate any code here.
+        * MIPS it seems. The standard arches will not generate any code here.
         *
         * Largest permitted alignment is 256 bytes due to the way we
         * handle the index determination for the smaller caches.
@@ -2986,7 +2957,6 @@ void __init kmem_cache_init(void)
        kmem_size = sizeof(struct kmem_cache);
 #endif
 
-
        printk(KERN_INFO
                "SLUB: Genslabs=%d, HWalign=%d, Order=%d-%d, MinObjects=%d,"
                " CPUs=%d, Nodes=%d\n",
@@ -3083,12 +3053,15 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
                 */
                for_each_online_cpu(cpu)
                        get_cpu_slab(s, cpu)->objsize = s->objsize;
+
                s->inuse = max_t(int, s->inuse, ALIGN(size, sizeof(void *)));
                up_write(&slub_lock);
+
                if (sysfs_slab_alias(s, name))
                        goto err;
                return s;
        }
+
        s = kmalloc(kmem_size, GFP_KERNEL);
        if (s) {
                if (kmem_cache_open(s, GFP_KERNEL, name,
@@ -3184,7 +3157,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
        struct kmem_cache *s;
 
        if (unlikely(size > PAGE_SIZE))
-               return kmalloc_large(size, gfpflags);
+               return kmalloc_large_node(size, gfpflags, node);
 
        s = get_slab(size, gfpflags);
 
@@ -3199,7 +3172,7 @@ static int validate_slab(struct kmem_cache *s, struct page *page,
                                                unsigned long *map)
 {
        void *p;
-       void *addr = slab_address(page);
+       void *addr = page_address(page);
 
        if (!check_slab(s, page) ||
                        !on_freelist(s, page, NULL))
@@ -3482,7 +3455,7 @@ static int add_location(struct loc_track *t, struct kmem_cache *s,
 static void process_slab(struct loc_track *t, struct kmem_cache *s,
                struct page *page, enum track_item alloc)
 {
-       void *addr = slab_address(page);
+       void *addr = page_address(page);
        DECLARE_BITMAP(map, s->objects);
        void *p;
 
@@ -3591,8 +3564,8 @@ enum slab_stat_type {
 #define SO_CPU         (1 << SL_CPU)
 #define SO_OBJECTS     (1 << SL_OBJECTS)
 
-static unsigned long slab_objects(struct kmem_cache *s,
-                       char *buf, unsigned long flags)
+static ssize_t show_slab_objects(struct kmem_cache *s,
+                           char *buf, unsigned long flags)
 {
        unsigned long total = 0;
        int cpu;
@@ -3602,6 +3575,8 @@ static unsigned long slab_objects(struct kmem_cache *s,
        unsigned long *per_cpu;
 
        nodes = kzalloc(2 * sizeof(unsigned long) * nr_node_ids, GFP_KERNEL);
+       if (!nodes)
+               return -ENOMEM;
        per_cpu = nodes + nr_node_ids;
 
        for_each_possible_cpu(cpu) {
@@ -3754,25 +3729,25 @@ SLAB_ATTR_RO(aliases);
 
 static ssize_t slabs_show(struct kmem_cache *s, char *buf)
 {
-       return slab_objects(s, buf, SO_FULL|SO_PARTIAL|SO_CPU);
+       return show_slab_objects(s, buf, SO_FULL|SO_PARTIAL|SO_CPU);
 }
 SLAB_ATTR_RO(slabs);
 
 static ssize_t partial_show(struct kmem_cache *s, char *buf)
 {
-       return slab_objects(s, buf, SO_PARTIAL);
+       return show_slab_objects(s, buf, SO_PARTIAL);
 }
 SLAB_ATTR_RO(partial);
 
 static ssize_t cpu_slabs_show(struct kmem_cache *s, char *buf)
 {
-       return slab_objects(s, buf, SO_CPU);
+       return show_slab_objects(s, buf, SO_CPU);
 }
 SLAB_ATTR_RO(cpu_slabs);
 
 static ssize_t objects_show(struct kmem_cache *s, char *buf)
 {
-       return slab_objects(s, buf, SO_FULL|SO_PARTIAL|SO_CPU|SO_OBJECTS);
+       return show_slab_objects(s, buf, SO_FULL|SO_PARTIAL|SO_CPU|SO_OBJECTS);
 }
 SLAB_ATTR_RO(objects);
 
@@ -3971,7 +3946,6 @@ SLAB_ATTR(remote_node_defrag_ratio);
 #endif
 
 #ifdef CONFIG_SLUB_STATS
-
 static int show_stat(struct kmem_cache *s, char *buf, enum stat_item si)
 {
        unsigned long sum  = 0;
@@ -4155,8 +4129,8 @@ static struct kset *slab_kset;
 #define ID_STR_LENGTH 64
 
 /* Create a unique string id for a slab cache:
- * format
- * :[flags-]size:[memory address of kmemcache]
+ *
+ * Format      :[flags-]size
  */
 static char *create_unique_id(struct kmem_cache *s)
 {
index 710a20bb9749cc9c9397e85bb59643dc38c27698..d4ec59aa5c4632962f8adf1aad5cef68afbe5701 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -176,7 +176,7 @@ void activate_page(struct page *page)
                SetPageActive(page);
                add_page_to_active_list(zone, page);
                __count_vm_event(PGACTIVATE);
-               mem_cgroup_move_lists(page_get_page_cgroup(page), true);
+               mem_cgroup_move_lists(page, true);
        }
        spin_unlock_irq(&zone->lru_lock);
 }
index c35c49e54fb6527eae91cb02177fc2b05a00abad..7d20ce41ecf52c2cd4027207558734f835124992 100644 (file)
@@ -134,8 +134,7 @@ invalidate_complete_page(struct address_space *mapping, struct page *page)
 }
 
 /**
- * truncate_inode_pages - truncate range of pages specified by start and
- * end byte offsets
+ * truncate_inode_pages - truncate range of pages specified by start & end byte offsets
  * @mapping: mapping to truncate
  * @lstart: offset from which to truncate
  * @lend: offset to which to truncate
index a26dabd62fed40c8ec7832dc4656feaf7d3909f9..45711585684ec74c01f7b93ae28a8d8b4f62bfb9 100644 (file)
@@ -126,7 +126,7 @@ long vm_total_pages;        /* The total number of pages which the VM controls */
 static LIST_HEAD(shrinker_list);
 static DECLARE_RWSEM(shrinker_rwsem);
 
-#ifdef CONFIG_CGROUP_MEM_CONT
+#ifdef CONFIG_CGROUP_MEM_RES_CTLR
 #define scan_global_lru(sc)    (!(sc)->mem_cgroup)
 #else
 #define scan_global_lru(sc)    (1)
@@ -1128,7 +1128,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
                ClearPageActive(page);
 
                list_move(&page->lru, &zone->inactive_list);
-               mem_cgroup_move_lists(page_get_page_cgroup(page), false);
+               mem_cgroup_move_lists(page, false);
                pgmoved++;
                if (!pagevec_add(&pvec, page)) {
                        __mod_zone_page_state(zone, NR_INACTIVE, pgmoved);
@@ -1156,8 +1156,9 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
                VM_BUG_ON(PageLRU(page));
                SetPageLRU(page);
                VM_BUG_ON(!PageActive(page));
+
                list_move(&page->lru, &zone->active_list);
-               mem_cgroup_move_lists(page_get_page_cgroup(page), true);
+               mem_cgroup_move_lists(page, true);
                pgmoved++;
                if (!pagevec_add(&pvec, page)) {
                        __mod_zone_page_state(zone, NR_ACTIVE, pgmoved);
@@ -1427,7 +1428,7 @@ unsigned long try_to_free_pages(struct zone **zones, int order, gfp_t gfp_mask)
        return do_try_to_free_pages(zones, gfp_mask, &sc);
 }
 
-#ifdef CONFIG_CGROUP_MEM_CONT
+#ifdef CONFIG_CGROUP_MEM_RES_CTLR
 
 unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem_cont,
                                                gfp_t gfp_mask)
index 7c5459c8e8efdf9e7e9e51d485c9f9ff99eb20f9..34f8bf98bc0529b4d69f7c60ff6f739ed63077a3 100644 (file)
@@ -417,7 +417,8 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
                l2cap_sock_kill(sk);
        }
 
-       del_timer_sync(&conn->info_timer);
+       if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)
+               del_timer_sync(&conn->info_timer);
 
        hcon->l2cap_data = NULL;
        kfree(conn);
index aef01533dfb6ca2ed6dbc636ba58dc4ca490492d..d9a02b2cc28940d1dde4f5f7ee6064f9581b046b 100644 (file)
@@ -839,7 +839,7 @@ static void neigh_timer_handler(unsigned long arg)
                struct sk_buff *skb = skb_peek(&neigh->arp_queue);
                /* keep skb alive even if arp_queue overflows */
                if (skb)
-                       skb_get(skb);
+                       skb = skb_copy(skb, GFP_ATOMIC);
                write_unlock(&neigh->lock);
                neigh->ops->solicit(neigh, skb);
                atomic_inc(&neigh->probes);
index 6faa128a4c8ef22d110c22b2add2dc8a4ffbbfd3..4b7e756181c9ec96eea6b0f5397aec3c87008a5a 100644 (file)
@@ -39,6 +39,8 @@ static struct sk_buff_head skb_pool;
 static atomic_t trapped;
 
 #define USEC_PER_POLL  50
+#define NETPOLL_RX_ENABLED  1
+#define NETPOLL_RX_DROP     2
 
 #define MAX_SKB_SIZE \
                (MAX_UDP_CHUNK + sizeof(struct udphdr) + \
@@ -126,11 +128,13 @@ static int poll_one_napi(struct netpoll_info *npinfo,
        if (!test_bit(NAPI_STATE_SCHED, &napi->state))
                return budget;
 
+       npinfo->rx_flags |= NETPOLL_RX_DROP;
        atomic_inc(&trapped);
 
        work = napi->poll(napi, budget);
 
        atomic_dec(&trapped);
+       npinfo->rx_flags &= ~NETPOLL_RX_DROP;
 
        return budget - work;
 }
@@ -472,7 +476,7 @@ int __netpoll_rx(struct sk_buff *skb)
        if (skb->dev->type != ARPHRD_ETHER)
                goto out;
 
-       /* if receive ARP during middle of NAPI poll, then queue */
+       /* check if netpoll clients need ARP */
        if (skb->protocol == htons(ETH_P_ARP) &&
            atomic_read(&trapped)) {
                skb_queue_tail(&npi->arp_tx, skb);
@@ -534,9 +538,6 @@ int __netpoll_rx(struct sk_buff *skb)
        return 1;
 
 out:
-       /* If packet received while already in poll then just
-        * silently drop.
-        */
        if (atomic_read(&trapped)) {
                kfree_skb(skb);
                return 1;
@@ -675,6 +676,7 @@ int netpoll_setup(struct netpoll *np)
                        goto release;
                }
 
+               npinfo->rx_flags = 0;
                npinfo->rx_np = NULL;
 
                spin_lock_init(&npinfo->rx_lock);
@@ -756,6 +758,7 @@ int netpoll_setup(struct netpoll *np)
 
        if (np->rx_hook) {
                spin_lock_irqsave(&npinfo->rx_lock, flags);
+               npinfo->rx_flags |= NETPOLL_RX_ENABLED;
                npinfo->rx_np = np;
                spin_unlock_irqrestore(&npinfo->rx_lock, flags);
        }
@@ -797,6 +800,7 @@ void netpoll_cleanup(struct netpoll *np)
                        if (npinfo->rx_np == np) {
                                spin_lock_irqsave(&npinfo->rx_lock, flags);
                                npinfo->rx_np = NULL;
+                               npinfo->rx_flags &= ~NETPOLL_RX_ENABLED;
                                spin_unlock_irqrestore(&npinfo->rx_lock, flags);
                        }
 
index 19880b086e712f4e29932debfdc0b06714fef6e7..9c7e5ffb223dfcc10f3873a48ce99d6f87fe5386 100644 (file)
@@ -343,7 +343,7 @@ config INET_ESP
        tristate "IP: ESP transformation"
        select XFRM
        select CRYPTO
-       select CRYPTO_AEAD
+       select CRYPTO_AUTHENC
        select CRYPTO_HMAC
        select CRYPTO_MD5
        select CRYPTO_CBC
index 10013ccee8dd92c0939b2ef1e06678ffc272efe1..5dd938579eeb62187ddee9ebce6f6eb2e9d7602a 100644 (file)
@@ -753,9 +753,9 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
                printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name);
                b->htype = dev->type; /* can cause undefined behavior */
        }
+
+       /* server_ip and your_ip address are both already zero per RFC2131 */
        b->hlen = dev->addr_len;
-       b->your_ip = NONE;
-       b->server_ip = NONE;
        memcpy(b->hw_addr, dev->dev_addr, dev->addr_len);
        b->secs = htons(jiffies_diff / HZ);
        b->xid = d->xid;
index 5212ed9b0c98d701169074f83898cd143e9315c6..7eb7636db0d0e0f0b0675d17de4b4a17db32d4b3 100644 (file)
@@ -1,12 +1,13 @@
 /*
  * Binary Increase Congestion control for TCP
- *
+ * Home page:
+ *      http://netsrv.csc.ncsu.edu/twiki/bin/view/Main/BIC
  * This is from the implementation of BICTCP in
  * Lison-Xu, Kahaled Harfoush, and Injong Rhee.
  *  "Binary Increase Congestion Control for Fast, Long Distance
  *  Networks" in InfoComm 2004
  * Available from:
- *  http://www.csc.ncsu.edu/faculty/rhee/export/bitcp.pdf
+ *  http://netsrv.csc.ncsu.edu/export/bitcp.pdf
  *
  * Unless BIC is enabled and congestion window is large
  * this behaves the same as the original Reno.
index 19c449f62672d7cf41f03a65f6d6dbc0cc3b3c04..7facdb0f69608be661e409c2ead641f5d0fb1bc8 100644 (file)
@@ -1367,7 +1367,7 @@ static struct sk_buff *tcp_sacktag_walk(struct sk_buff *skb, struct sock *sk,
  * a normal way
  */
 static struct sk_buff *tcp_sacktag_skip(struct sk_buff *skb, struct sock *sk,
-                                       u32 skip_to_seq)
+                                       u32 skip_to_seq, int *fack_count)
 {
        tcp_for_write_queue_from(skb, sk) {
                if (skb == tcp_send_head(sk))
@@ -1375,6 +1375,8 @@ static struct sk_buff *tcp_sacktag_skip(struct sk_buff *skb, struct sock *sk,
 
                if (!before(TCP_SKB_CB(skb)->end_seq, skip_to_seq))
                        break;
+
+               *fack_count += tcp_skb_pcount(skb);
        }
        return skb;
 }
@@ -1390,7 +1392,7 @@ static struct sk_buff *tcp_maybe_skipping_dsack(struct sk_buff *skb,
                return skb;
 
        if (before(next_dup->start_seq, skip_to_seq)) {
-               skb = tcp_sacktag_skip(skb, sk, next_dup->start_seq);
+               skb = tcp_sacktag_skip(skb, sk, next_dup->start_seq, fack_count);
                tcp_sacktag_walk(skb, sk, NULL,
                                 next_dup->start_seq, next_dup->end_seq,
                                 1, fack_count, reord, flag);
@@ -1537,7 +1539,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
 
                        /* Head todo? */
                        if (before(start_seq, cache->start_seq)) {
-                               skb = tcp_sacktag_skip(skb, sk, start_seq);
+                               skb = tcp_sacktag_skip(skb, sk, start_seq,
+                                                      &fack_count);
                                skb = tcp_sacktag_walk(skb, sk, next_dup,
                                                       start_seq,
                                                       cache->start_seq,
@@ -1565,7 +1568,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
                                goto walk;
                        }
 
-                       skb = tcp_sacktag_skip(skb, sk, cache->end_seq);
+                       skb = tcp_sacktag_skip(skb, sk, cache->end_seq,
+                                              &fack_count);
                        /* Check overlap against next cached too (past this one already) */
                        cache++;
                        continue;
@@ -1577,7 +1581,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
                                break;
                        fack_count = tp->fackets_out;
                }
-               skb = tcp_sacktag_skip(skb, sk, start_seq);
+               skb = tcp_sacktag_skip(skb, sk, start_seq, &fack_count);
 
 walk:
                skb = tcp_sacktag_walk(skb, sk, next_dup, start_seq, end_seq,
index 3ffb0323668cc8fe40cba537589f061a68923a6c..58219dfffef8a499c4508181ccdd0cf13a8af49b 100644 (file)
@@ -85,7 +85,7 @@ config INET6_ESP
        depends on IPV6
        select XFRM
        select CRYPTO
-       select CRYPTO_AEAD
+       select CRYPTO_AUTHENC
        select CRYPTO_HMAC
        select CRYPTO_MD5
        select CRYPTO_CBC
index b825399fc16002dc98a3983c8475462286072afc..6eef1f2a75535503f5c1562fb196bd56a3626c05 100644 (file)
@@ -76,9 +76,11 @@ static int __init ircomm_init(void)
 
 #ifdef CONFIG_PROC_FS
        { struct proc_dir_entry *ent;
-       ent = create_proc_entry("ircomm", 0, proc_irda);
-       if (ent)
-               ent->proc_fops = &ircomm_proc_fops;
+       ent = proc_create("ircomm", 0, proc_irda, &ircomm_proc_fops);
+       if (!ent) {
+               printk(KERN_ERR "ircomm_init: can't create /proc entry!\n");
+               return -ENODEV;
+       }
        }
 #endif /* CONFIG_PROC_FS */
 
index a4b56e25a91705abb9899559f7fb6ae07a535b52..1eb4bbcb1c9e9ef59aee2d8474275fac3dc79b20 100644 (file)
@@ -128,13 +128,11 @@ static int __init irlan_init(void)
 
 #ifdef CONFIG_PROC_FS
        { struct proc_dir_entry *proc;
-       proc = create_proc_entry("irlan", 0, proc_irda);
+       proc = proc_create("irlan", 0, proc_irda, &irlan_fops);
        if (!proc) {
                printk(KERN_ERR "irlan_init: can't create /proc entry!\n");
                return -ENODEV;
        }
-
-       proc->proc_fops = &irlan_fops;
        }
 #endif /* CONFIG_PROC_FS */
 
index cae24fbda966f654d3817dcb38077b334ddd0b1a..88e80a312732a9ed18e7e1d511d79ac6f0f9d682 100644 (file)
@@ -72,11 +72,9 @@ void __init irda_proc_register(void)
                return;
        proc_irda->owner = THIS_MODULE;
 
-       for (i=0; i<ARRAY_SIZE(irda_dirs); i++) {
-               d = create_proc_entry(irda_dirs[i].name, 0, proc_irda);
-               if (d)
-                       d->proc_fops = irda_dirs[i].fops;
-       }
+       for (i = 0; i < ARRAY_SIZE(irda_dirs); i++)
+               d = proc_create(irda_dirs[i].name, 0, proc_irda,
+                               irda_dirs[i].fops);
 }
 
 /*
index 2753b0c448f374f3f27c26f991e97d94c43459ad..d764f4c1b7e4eac68962e3bb95b37df2d57ece97 100644 (file)
@@ -621,7 +621,6 @@ static int iucv_sever_pathid(u16 pathid, u8 userdata[16])
        return iucv_call_b2f0(IUCV_SEVER, parm);
 }
 
-#ifdef CONFIG_SMP
 /**
  * __iucv_cleanup_queue
  * @dummy: unused dummy argument
@@ -632,7 +631,6 @@ static int iucv_sever_pathid(u16 pathid, u8 userdata[16])
 static void __iucv_cleanup_queue(void *dummy)
 {
 }
-#endif
 
 /**
  * iucv_cleanup_queue
index c339571632b2f102fdc8a81a8416fb71826ccf98..3b77410588e734258706245c8057d741a7916e8d 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright 2002-2005, Instant802 Networks, Inc.
  * Copyright 2005, Devicescape Software, Inc.
  * Copyright 2007, Mattias Nissler <mattias.nissler@gmx.de>
- * Copyright 2007, Stefano Brivio <stefano.brivio@polimi.it>
+ * Copyright 2007-2008, Stefano Brivio <stefano.brivio@polimi.it>
  *
  * 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
  * RC_PID_ARITH_SHIFT.
  */
 
-
-/* Shift the adjustment so that we won't switch to a lower rate if it exhibited
- * a worse failed frames behaviour and we'll choose the highest rate whose
- * failed frames behaviour is not worse than the one of the original rate
- * target. While at it, check that the adjustment is within the ranges. Then,
- * provide the new rate index. */
-static int rate_control_pid_shift_adjust(struct rc_pid_rateinfo *r,
-                                        int adj, int cur, int l)
-{
-       int i, j, k, tmp;
-
-       j = r[cur].rev_index;
-       i = j + adj;
-
-       if (i < 0)
-               return r[0].index;
-       if (i >= l - 1)
-               return r[l - 1].index;
-
-       tmp = i;
-
-       if (adj < 0) {
-               for (k = j; k >= i; k--)
-                       if (r[k].diff <= r[j].diff)
-                               tmp = k;
-       } else {
-               for (k = i + 1; k + i < l; k++)
-                       if (r[k].diff <= r[i].diff)
-                               tmp = k;
-       }
-
-       return r[tmp].index;
-}
-
+/* Adjust the rate while ensuring that we won't switch to a lower rate if it
+ * exhibited a worse failed frames behaviour and we'll choose the highest rate
+ * whose failed frames behaviour is not worse than the one of the original rate
+ * target. While at it, check that the new rate is valid. */
 static void rate_control_pid_adjust_rate(struct ieee80211_local *local,
                                         struct sta_info *sta, int adj,
                                         struct rc_pid_rateinfo *rinfo)
 {
        struct ieee80211_sub_if_data *sdata;
        struct ieee80211_hw_mode *mode;
-       int newidx;
-       int maxrate;
-       int back = (adj > 0) ? 1 : -1;
+       int cur_sorted, new_sorted, probe, tmp, n_bitrates;
+       int cur = sta->txrate;
 
        sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
 
        mode = local->oper_hw_mode;
-       maxrate = sdata->bss ? sdata->bss->max_ratectrl_rateidx : -1;
+       n_bitrates = mode->num_rates;
 
-       newidx = rate_control_pid_shift_adjust(rinfo, adj, sta->txrate,
-                                              mode->num_rates);
+       /* Map passed arguments to sorted values. */
+       cur_sorted = rinfo[cur].rev_index;
+       new_sorted = cur_sorted + adj;
 
-       while (newidx != sta->txrate) {
-               if (rate_supported(sta, mode, newidx) &&
-                   (maxrate < 0 || newidx <= maxrate)) {
-                       sta->txrate = newidx;
-                       break;
-               }
+       /* Check limits. */
+       if (new_sorted < 0)
+               new_sorted = rinfo[0].rev_index;
+       else if (new_sorted >= n_bitrates)
+               new_sorted = rinfo[n_bitrates - 1].rev_index;
 
-               newidx += back;
+       tmp = new_sorted;
+
+       if (adj < 0) {
+               /* Ensure that the rate decrease isn't disadvantageous. */
+               for (probe = cur_sorted; probe >= new_sorted; probe--)
+                       if (rinfo[probe].diff <= rinfo[cur_sorted].diff &&
+                           rate_supported(sta, mode, rinfo[probe].index))
+                               tmp = probe;
+       } else {
+               /* Look for rate increase with zero (or below) cost. */
+               for (probe = new_sorted + 1; probe < n_bitrates; probe++)
+                       if (rinfo[probe].diff <= rinfo[new_sorted].diff &&
+                           rate_supported(sta, mode, rinfo[probe].index))
+                               tmp = probe;
        }
 
+       /* Fit the rate found to the nearest supported rate. */
+       do {
+               if (rate_supported(sta, mode, rinfo[tmp].index)) {
+                       sta->txrate = rinfo[tmp].index;
+                       break;
+               }
+               if (adj < 0)
+                       tmp--;
+               else
+                       tmp++;
+       } while (tmp < n_bitrates && tmp >= 0);
+
 #ifdef CONFIG_MAC80211_DEBUGFS
        rate_control_pid_event_rate_change(
                &((struct rc_pid_sta_info *)sta->rate_ctrl_priv)->events,
-               newidx, mode->rates[newidx].rate);
+               cur, mode->rates[cur].rate);
 #endif
 }
 
index 9e214da82d9eb0aff64f7844d219d2689cb4a475..973f1dbc2ec3a8555542601cf900abb4b22d022a 100644 (file)
@@ -256,12 +256,10 @@ int __init sctp_eps_proc_init(void)
 {
        struct proc_dir_entry *p;
 
-       p = create_proc_entry("eps", S_IRUGO, proc_net_sctp);
+       p = proc_create("eps", S_IRUGO, proc_net_sctp, &sctp_eps_seq_fops);
        if (!p)
                return -ENOMEM;
 
-       p->proc_fops = &sctp_eps_seq_fops;
-
        return 0;
 }
 
@@ -367,12 +365,11 @@ int __init sctp_assocs_proc_init(void)
 {
        struct proc_dir_entry *p;
 
-       p = create_proc_entry("assocs", S_IRUGO, proc_net_sctp);
+       p = proc_create("assocs", S_IRUGO, proc_net_sctp,
+                       &sctp_assocs_seq_fops);
        if (!p)
                return -ENOMEM;
 
-       p->proc_fops = &sctp_assocs_seq_fops;
-
        return 0;
 }
 
index 74d97cc247872216fc179bf5fdce5b0b9c2cd671..e1fb471cc50182e5e907bef3caa566f8ede7e6d4 100644 (file)
@@ -22,5 +22,16 @@ config SAMPLE_KOBJECT
 
          If in doubt, say "N" here.
 
+config SAMPLE_KPROBES
+       tristate "Build kprobes examples -- loadable modules only"
+       depends on KPROBES && m
+       help
+         This build several kprobes example modules.
+
+config SAMPLE_KRETPROBES
+       tristate "Build kretprobes example -- loadable modules only"
+       default m
+       depends on SAMPLE_KPROBES && KRETPROBES
+
 endif # SAMPLES
 
index 8652d0f268ad0fb25e24c65375828ec932df2e96..2e02575f779441bf1babe686f50f0b7fb1d3e03e 100644 (file)
@@ -1,3 +1,3 @@
 # Makefile for Linux samples code
 
-obj-$(CONFIG_SAMPLES)  += markers/ kobject/
+obj-$(CONFIG_SAMPLES)  += markers/ kobject/ kprobes/
diff --git a/samples/kprobes/Makefile b/samples/kprobes/Makefile
new file mode 100644 (file)
index 0000000..68739bc
--- /dev/null
@@ -0,0 +1,5 @@
+# builds the kprobes example kernel modules;
+# then to use one (as root):  insmod <module_name.ko>
+
+obj-$(CONFIG_SAMPLE_KPROBES) += kprobe_example.o jprobe_example.o
+obj-$(CONFIG_SAMPLE_KRETPROBES) += kretprobe_example.o
diff --git a/samples/kprobes/jprobe_example.c b/samples/kprobes/jprobe_example.c
new file mode 100644 (file)
index 0000000..b754135
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Here's a sample kernel module showing the use of jprobes to dump
+ * the arguments of do_fork().
+ *
+ * For more information on theory of operation of jprobes, see
+ * Documentation/kprobes.txt
+ *
+ * Build and insert the kernel module as done in the kprobe example.
+ * You will see the trace data in /var/log/messages and on the
+ * console whenever do_fork() is invoked to create a new process.
+ * (Some messages may be suppressed if syslogd is configured to
+ * eliminate duplicate messages.)
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/kprobes.h>
+
+/*
+ * Jumper probe for do_fork.
+ * Mirror principle enables access to arguments of the probed routine
+ * from the probe handler.
+ */
+
+/* Proxy routine having the same arguments as actual do_fork() routine */
+static long jdo_fork(unsigned long clone_flags, unsigned long stack_start,
+             struct pt_regs *regs, unsigned long stack_size,
+             int __user *parent_tidptr, int __user *child_tidptr)
+{
+       printk(KERN_INFO "jprobe: clone_flags = 0x%lx, stack_size = 0x%lx,"
+                       " regs = 0x%p\n",
+              clone_flags, stack_size, regs);
+
+       /* Always end with a call to jprobe_return(). */
+       jprobe_return();
+       return 0;
+}
+
+static struct jprobe my_jprobe = {
+       .entry                  = jdo_fork,
+       .kp = {
+               .symbol_name    = "do_fork",
+       },
+};
+
+static int __init jprobe_init(void)
+{
+       int ret;
+
+       ret = register_jprobe(&my_jprobe);
+       if (ret < 0) {
+               printk(KERN_INFO "register_jprobe failed, returned %d\n", ret);
+               return -1;
+       }
+       printk(KERN_INFO "Planted jprobe at %p, handler addr %p\n",
+              my_jprobe.kp.addr, my_jprobe.entry);
+       return 0;
+}
+
+static void __exit jprobe_exit(void)
+{
+       unregister_jprobe(&my_jprobe);
+       printk(KERN_INFO "jprobe at %p unregistered\n", my_jprobe.kp.addr);
+}
+
+module_init(jprobe_init)
+module_exit(jprobe_exit)
+MODULE_LICENSE("GPL");
diff --git a/samples/kprobes/kprobe_example.c b/samples/kprobes/kprobe_example.c
new file mode 100644 (file)
index 0000000..a681998
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * NOTE: This example is works on x86 and powerpc.
+ * Here's a sample kernel module showing the use of kprobes to dump a
+ * stack trace and selected registers when do_fork() is called.
+ *
+ * For more information on theory of operation of kprobes, see
+ * Documentation/kprobes.txt
+ *
+ * You will see the trace data in /var/log/messages and on the console
+ * whenever do_fork() is invoked to create a new process.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/kprobes.h>
+
+/* For each probe you need to allocate a kprobe structure */
+static struct kprobe kp = {
+       .symbol_name    = "do_fork",
+};
+
+/* kprobe pre_handler: called just before the probed instruction is executed */
+static int handler_pre(struct kprobe *p, struct pt_regs *regs)
+{
+#ifdef CONFIG_X86
+       printk(KERN_INFO "pre_handler: p->addr = 0x%p, ip = %lx,"
+                       " flags = 0x%lx\n",
+               p->addr, regs->ip, regs->flags);
+#endif
+#ifdef CONFIG_PPC
+       printk(KERN_INFO "pre_handler: p->addr = 0x%p, nip = 0x%lx,"
+                       " msr = 0x%lx\n",
+               p->addr, regs->nip, regs->msr);
+#endif
+
+       /* A dump_stack() here will give a stack backtrace */
+       return 0;
+}
+
+/* kprobe post_handler: called after the probed instruction is executed */
+static void handler_post(struct kprobe *p, struct pt_regs *regs,
+                               unsigned long flags)
+{
+#ifdef CONFIG_X86
+       printk(KERN_INFO "post_handler: p->addr = 0x%p, flags = 0x%lx\n",
+               p->addr, regs->flags);
+#endif
+#ifdef CONFIG_PPC
+       printk(KERN_INFO "post_handler: p->addr = 0x%p, msr = 0x%lx\n",
+               p->addr, regs->msr);
+#endif
+}
+
+/*
+ * fault_handler: this is called if an exception is generated for any
+ * instruction within the pre- or post-handler, or when Kprobes
+ * single-steps the probed instruction.
+ */
+static int handler_fault(struct kprobe *p, struct pt_regs *regs, int trapnr)
+{
+       printk(KERN_INFO "fault_handler: p->addr = 0x%p, trap #%dn",
+               p->addr, trapnr);
+       /* Return 0 because we don't handle the fault. */
+       return 0;
+}
+
+static int __init kprobe_init(void)
+{
+       int ret;
+       kp.pre_handler = handler_pre;
+       kp.post_handler = handler_post;
+       kp.fault_handler = handler_fault;
+
+       ret = register_kprobe(&kp);
+       if (ret < 0) {
+               printk(KERN_INFO "register_kprobe failed, returned %d\n", ret);
+               return ret;
+       }
+       printk(KERN_INFO "Planted kprobe at %p\n", kp.addr);
+       return 0;
+}
+
+static void __exit kprobe_exit(void)
+{
+       unregister_kprobe(&kp);
+       printk(KERN_INFO "kprobe at %p unregistered\n", kp.addr);
+}
+
+module_init(kprobe_init)
+module_exit(kprobe_exit)
+MODULE_LICENSE("GPL");
diff --git a/samples/kprobes/kretprobe_example.c b/samples/kprobes/kretprobe_example.c
new file mode 100644 (file)
index 0000000..4e764b3
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * kretprobe_example.c
+ *
+ * Here's a sample kernel module showing the use of return probes to
+ * report the return value and total time taken for probed function
+ * to run.
+ *
+ * usage: insmod kretprobe_example.ko func=<func_name>
+ *
+ * If no func_name is specified, do_fork is instrumented
+ *
+ * For more information on theory of operation of kretprobes, see
+ * Documentation/kprobes.txt
+ *
+ * Build and insert the kernel module as done in the kprobe example.
+ * You will see the trace data in /var/log/messages and on the console
+ * whenever the probed function returns. (Some messages may be suppressed
+ * if syslogd is configured to eliminate duplicate messages.)
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/kprobes.h>
+#include <linux/ktime.h>
+#include <linux/limits.h>
+
+static char func_name[NAME_MAX] = "do_fork";
+module_param_string(func, func_name, NAME_MAX, S_IRUGO);
+MODULE_PARM_DESC(func, "Function to kretprobe; this module will report the"
+                       " function's execution time");
+
+/* per-instance private data */
+struct my_data {
+       ktime_t entry_stamp;
+};
+
+/* Here we use the entry_hanlder to timestamp function entry */
+static int entry_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
+{
+       struct my_data *data;
+
+       if (!current->mm)
+               return 1;       /* Skip kernel threads */
+
+       data = (struct my_data *)ri->data;
+       data->entry_stamp = ktime_get();
+       return 0;
+}
+
+/*
+ * Return-probe handler: Log the return value and duration. Duration may turn
+ * out to be zero consistently, depending upon the granularity of time
+ * accounting on the platform.
+ */
+static int ret_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
+{
+       int retval = regs_return_value(regs);
+       struct my_data *data = (struct my_data *)ri->data;
+       s64 delta;
+       ktime_t now;
+
+       now = ktime_get();
+       delta = ktime_to_ns(ktime_sub(now, data->entry_stamp));
+       printk(KERN_INFO "%s returned %d and took %lld ns to execute\n",
+                       func_name, retval, (long long)delta);
+       return 0;
+}
+
+static struct kretprobe my_kretprobe = {
+       .handler                = ret_handler,
+       .entry_handler          = entry_handler,
+       .data_size              = sizeof(struct my_data),
+       /* Probe up to 20 instances concurrently. */
+       .maxactive              = 20,
+};
+
+static int __init kretprobe_init(void)
+{
+       int ret;
+
+       my_kretprobe.kp.symbol_name = func_name;
+       ret = register_kretprobe(&my_kretprobe);
+       if (ret < 0) {
+               printk(KERN_INFO "register_kretprobe failed, returned %d\n",
+                               ret);
+               return -1;
+       }
+       printk(KERN_INFO "Planted return probe at %s: %p\n",
+                       my_kretprobe.kp.symbol_name, my_kretprobe.kp.addr);
+       return 0;
+}
+
+static void __exit kretprobe_exit(void)
+{
+       unregister_kretprobe(&my_kretprobe);
+       printk(KERN_INFO "kretprobe at %p unregistered\n",
+                       my_kretprobe.kp.addr);
+
+       /* nmissed > 0 suggests that maxactive was set too low. */
+       printk(KERN_INFO "Missed probing %d instances of %s\n",
+               my_kretprobe.nmissed, my_kretprobe.kp.symbol_name);
+}
+
+module_init(kretprobe_init)
+module_exit(kretprobe_exit)
+MODULE_LICENSE("GPL");
index 2086a856400a9c7258958b96fe0f3d53d3d70ff8..2a7cef9726e4892b3454e7198dca4c529aeed891 100755 (executable)
@@ -9,7 +9,7 @@ use strict;
 my $P = $0;
 $P =~ s@.*/@@g;
 
-my $V = '0.14';
+my $V = '0.15';
 
 use Getopt::Long qw(:config no_auto_abbrev);
 
@@ -105,8 +105,7 @@ our $Sparse = qr{
                        __iomem|
                        __must_check|
                        __init_refok|
-                       __kprobes|
-                       fastcall
+                       __kprobes
                }x;
 our $Attribute = qr{
                        const|
@@ -158,7 +157,10 @@ sub build_types {
                        \b
                        (?:const\s+)?
                        (?:unsigned\s+)?
-                       $all
+                       (?:
+                               $all|
+                               (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)
+                       )
                        (?:\s+$Sparse|\s+const)*
                        \b
                  }x;
@@ -362,6 +364,7 @@ sub ctx_statement_block {
 
        my $type = '';
        my $level = 0;
+       my $p;
        my $c;
        my $len = 0;
 
@@ -386,6 +389,7 @@ sub ctx_statement_block {
                                last;
                        }
                }
+               $p = $c;
                $c = substr($blk, $off, 1);
                $remainder = substr($blk, $off);
 
@@ -397,8 +401,9 @@ sub ctx_statement_block {
                }
 
                # An else is really a conditional as long as its not else if
-               if ($level == 0 && $remainder =~ /(\s+else)(?:\s|{)/ &&
-                                       $remainder !~ /\s+else\s+if\b/) {
+               if ($level == 0 && (!defined($p) || $p =~ /(?:\s|\})/) &&
+                               $remainder =~ /(else)(?:\s|{)/ &&
+                               $remainder !~ /else\s+if\b/) {
                        $coff = $off + length($1);
                }
 
@@ -445,21 +450,73 @@ sub ctx_statement_block {
                        $line, $remain + 1, $off - $loff + 1, $level);
 }
 
+sub statement_lines {
+       my ($stmt) = @_;
+
+       # Strip the diff line prefixes and rip blank lines at start and end.
+       $stmt =~ s/(^|\n)./$1/g;
+       $stmt =~ s/^\s*//;
+       $stmt =~ s/\s*$//;
+
+       my @stmt_lines = ($stmt =~ /\n/g);
+
+       return $#stmt_lines + 2;
+}
+
+sub statement_rawlines {
+       my ($stmt) = @_;
+
+       my @stmt_lines = ($stmt =~ /\n/g);
+
+       return $#stmt_lines + 2;
+}
+
+sub statement_block_size {
+       my ($stmt) = @_;
+
+       $stmt =~ s/(^|\n)./$1/g;
+       $stmt =~ s/^\s*{//;
+       $stmt =~ s/}\s*$//;
+       $stmt =~ s/^\s*//;
+       $stmt =~ s/\s*$//;
+
+       my @stmt_lines = ($stmt =~ /\n/g);
+       my @stmt_statements = ($stmt =~ /;/g);
+
+       my $stmt_lines = $#stmt_lines + 2;
+       my $stmt_statements = $#stmt_statements + 1;
+
+       if ($stmt_lines > $stmt_statements) {
+               return $stmt_lines;
+       } else {
+               return $stmt_statements;
+       }
+}
+
 sub ctx_statement_full {
        my ($linenr, $remain, $off) = @_;
        my ($statement, $condition, $level);
 
        my (@chunks);
 
+       # Grab the first conditional/block pair.
        ($statement, $condition, $linenr, $remain, $off, $level) =
                                ctx_statement_block($linenr, $remain, $off);
        #print "F: c<$condition> s<$statement>\n";
+       push(@chunks, [ $condition, $statement ]);
+       if (!($remain > 0 && $condition =~ /^\s*(?:\n[+-])?\s*(?:if|else|do)\b/s)) {
+               return ($level, $linenr, @chunks);
+       }
+
+       # Pull in the following conditional/block pairs and see if they
+       # could continue the statement.
        for (;;) {
-               push(@chunks, [ $condition, $statement ]);
-               last if (!($remain > 0 && $condition =~ /^.\s*(?:if|else|do)/));
                ($statement, $condition, $linenr, $remain, $off, $level) =
                                ctx_statement_block($linenr, $remain, $off);
-               #print "C: c<$condition> s<$statement>\n";
+               #print "C: c<$condition> s<$statement> remain<$remain>\n";
+               last if (!($remain > 0 && $condition =~ /^\s*(?:\n[+-])?\s*(?:else|do)\b/s));
+               #print "C: push\n";
+               push(@chunks, [ $condition, $statement ]);
        }
 
        return ($level, $linenr, @chunks);
@@ -593,13 +650,13 @@ sub cat_vet {
 }
 
 my $av_preprocessor = 0;
-my $av_paren = 0;
+my $av_pending;
 my @av_paren_type;
 
 sub annotate_reset {
        $av_preprocessor = 0;
-       $av_paren = 0;
-       @av_paren_type = ();
+       $av_pending = '_';
+       @av_paren_type = ('E');
 }
 
 sub annotate_values {
@@ -611,12 +668,13 @@ sub annotate_values {
        print "$stream\n" if ($dbg_values > 1);
 
        while (length($cur)) {
-               print " <$type> " if ($dbg_values > 1);
+               print " <" . join('', @av_paren_type) .
+                                       "> <$type> " if ($dbg_values > 1);
                if ($cur =~ /^(\s+)/o) {
                        print "WS($1)\n" if ($dbg_values > 1);
                        if ($1 =~ /\n/ && $av_preprocessor) {
+                               $type = pop(@av_paren_type);
                                $av_preprocessor = 0;
-                               $type = 'N';
                        }
 
                } elsif ($cur =~ /^($Type)/) {
@@ -626,11 +684,33 @@ sub annotate_values {
                } elsif ($cur =~ /^(#\s*define\s*$Ident)(\(?)/o) {
                        print "DEFINE($1)\n" if ($dbg_values > 1);
                        $av_preprocessor = 1;
-                       $av_paren_type[$av_paren] = 'N';
+                       $av_pending = 'N';
 
-               } elsif ($cur =~ /^(#\s*(?:ifdef|ifndef|if|else|elif|endif))/o) {
-                       print "PRE($1)\n" if ($dbg_values > 1);
+               } elsif ($cur =~ /^(#\s*(?:ifdef|ifndef|if))/o) {
+                       print "PRE_START($1)\n" if ($dbg_values > 1);
                        $av_preprocessor = 1;
+
+                       push(@av_paren_type, $type);
+                       push(@av_paren_type, $type);
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(#\s*(?:else|elif))/o) {
+                       print "PRE_RESTART($1)\n" if ($dbg_values > 1);
+                       $av_preprocessor = 1;
+
+                       push(@av_paren_type, $av_paren_type[$#av_paren_type]);
+
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(#\s*(?:endif))/o) {
+                       print "PRE_END($1)\n" if ($dbg_values > 1);
+
+                       $av_preprocessor = 1;
+
+                       # Assume all arms of the conditional end as this
+                       # one does, and continue as if the #endif was not here.
+                       pop(@av_paren_type);
+                       push(@av_paren_type, $type);
                        $type = 'N';
 
                } elsif ($cur =~ /^(\\\n)/o) {
@@ -639,13 +719,13 @@ sub annotate_values {
                } elsif ($cur =~ /^(sizeof)\s*(\()?/o) {
                        print "SIZEOF($1)\n" if ($dbg_values > 1);
                        if (defined $2) {
-                               $av_paren_type[$av_paren] = 'V';
+                               $av_pending = 'V';
                        }
                        $type = 'N';
 
                } elsif ($cur =~ /^(if|while|typeof|__typeof__|for)\b/o) {
                        print "COND($1)\n" if ($dbg_values > 1);
-                       $av_paren_type[$av_paren] = 'N';
+                       $av_pending = 'N';
                        $type = 'N';
 
                } elsif ($cur =~/^(return|case|else)/o) {
@@ -654,14 +734,14 @@ sub annotate_values {
 
                } elsif ($cur =~ /^(\()/o) {
                        print "PAREN('$1')\n" if ($dbg_values > 1);
-                       $av_paren++;
+                       push(@av_paren_type, $av_pending);
+                       $av_pending = '_';
                        $type = 'N';
 
                } elsif ($cur =~ /^(\))/o) {
-                       $av_paren-- if ($av_paren > 0);
-                       if (defined $av_paren_type[$av_paren]) {
-                               $type = $av_paren_type[$av_paren];
-                               undef $av_paren_type[$av_paren];
+                       my $new_type = pop(@av_paren_type);
+                       if ($new_type ne '_') {
+                               $type = $new_type;
                                print "PAREN('$1') -> $type\n"
                                                        if ($dbg_values > 1);
                        } else {
@@ -670,7 +750,7 @@ sub annotate_values {
 
                } elsif ($cur =~ /^($Ident)\(/o) {
                        print "FUNC($1)\n" if ($dbg_values > 1);
-                       $av_paren_type[$av_paren] = 'V';
+                       $av_pending = 'V';
 
                } elsif ($cur =~ /^($Ident|$Constant)/o) {
                        print "IDENT($1)\n" if ($dbg_values > 1);
@@ -680,11 +760,11 @@ sub annotate_values {
                        print "ASSIGN($1)\n" if ($dbg_values > 1);
                        $type = 'N';
 
-               } elsif ($cur =~/^(;)/) {
+               } elsif ($cur =~/^(;|{|})/) {
                        print "END($1)\n" if ($dbg_values > 1);
                        $type = 'E';
 
-               } elsif ($cur =~ /^(;|{|}|\?|:|\[)/o) {
+               } elsif ($cur =~ /^(;|\?|:|\[)/o) {
                        print "CLOSE($1)\n" if ($dbg_values > 1);
                        $type = 'N';
 
@@ -988,7 +1068,7 @@ sub process {
                }
 
 # check for RCS/CVS revision markers
-               if ($rawline =~ /\$(Revision|Log|Id)(?:\$|)/) {
+               if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) {
                        WARN("CVS style keyword markers, these will _not_ be updated\n". $herecurr);
                }
 
@@ -999,41 +1079,44 @@ sub process {
 
 # Check for potential 'bare' types
                if ($realcnt) {
+                       my ($s, $c) = ctx_statement_block($linenr, $realcnt, 0);
+                       $s =~ s/\n./ /g;
+                       $s =~ s/{.*$//;
+
                        # Ignore goto labels.
-                       if ($line =~ /$Ident:\*$/) {
+                       if ($s =~ /$Ident:\*$/) {
 
                        # Ignore functions being called
-                       } elsif ($line =~ /^.\s*$Ident\s*\(/) {
+                       } elsif ($s =~ /^.\s*$Ident\s*\(/) {
 
                        # definitions in global scope can only start with types
-                       } elsif ($line =~ /^.(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?($Ident)\b/) {
-                               possible($1, $line);
+                       } elsif ($s =~ /^.(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?($Ident)\b/) {
+                               possible($1, $s);
 
                        # declarations always start with types
-                       } elsif ($prev_values eq 'E' && $line =~ /^.\s*(?:$Storage\s+)?(?:const\s+)?($Ident)\b(:?\s+$Sparse)?\s*\**\s*$Ident\s*(?:;|=|,)/) {
-                               possible($1);
+                       } elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:const\s+)?($Ident)\b(:?\s+$Sparse)?\s*\**\s*$Ident\s*(?:;|=|,)/) {
+                               possible($1, $s);
                        }
 
                        # any (foo ... *) is a pointer cast, and foo is a type
-                       while ($line =~ /\(($Ident)(?:\s+$Sparse)*\s*\*+\s*\)/g) {
-                               possible($1, $line);
+                       while ($s =~ /\(($Ident)(?:\s+$Sparse)*\s*\*+\s*\)/g) {
+                               possible($1, $s);
                        }
 
                        # Check for any sort of function declaration.
                        # int foo(something bar, other baz);
                        # void (*store_gdt)(x86_descr_ptr *);
-                       if ($prev_values eq 'E' && $line =~ /^(.(?:typedef\s*)?(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*(?:\b$Ident|\(\*\s*$Ident\))\s*)\(/) {
+                       if ($prev_values eq 'E' && $s =~ /^(.(?:typedef\s*)?(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*(?:\b$Ident|\(\*\s*$Ident\))\s*)\(/) {
                                my ($name_len) = length($1);
-                               my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, $name_len);
-                               my $ctx = join("\n", @ctx);
 
-                               $ctx =~ s/\n.//;
+                               my $ctx = $s;
                                substr($ctx, 0, $name_len + 1) = '';
                                $ctx =~ s/\)[^\)]*$//;
+
                                for my $arg (split(/\s*,\s*/, $ctx)) {
                                        if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/ || $arg =~ /^($Ident)$/) {
 
-                                               possible($1, $line);
+                                               possible($1, $s);
                                        }
                                }
                        }
@@ -1100,8 +1183,8 @@ sub process {
                $curr_values = $prev_values . $curr_values;
                if ($dbg_values) {
                        my $outline = $opline; $outline =~ s/\t/ /g;
-                       warn "--> .$outline\n";
-                       warn "--> $curr_values\n";
+                       print "$linenr > .$outline\n";
+                       print "$linenr > $curr_values\n";
                }
                $prev_values = substr($curr_values, -1);
 
@@ -1148,7 +1231,9 @@ sub process {
                        if (($prevline !~ /^}/) &&
                           ($prevline !~ /^\+}/) &&
                           ($prevline !~ /^ }/) &&
-                          ($prevline !~ /\b\Q$name\E(?:\s+$Attribute)?\s*(?:;|=)/)) {
+                          ($prevline !~ /^.DECLARE_$Ident\(\Q$name\E\)/) &&
+                          ($prevline !~ /^.LIST_HEAD\(\Q$name\E\)/) &&
+                          ($prevline !~ /\b\Q$name\E(?:\s+$Attribute)?\s*(?:;|=|\[)/)) {
                                WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr);
                        }
                }
@@ -1266,7 +1351,7 @@ sub process {
                                =>|->|<<|>>|<|>|=|!|~|
                                &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%
                        }x;
-                       my @elements = split(/($;+|$ops|;)/, $opline);
+                       my @elements = split(/($ops|;)/, $opline);
                        my $off = 0;
 
                        my $blank = copy_spacing($opline);
@@ -1277,6 +1362,7 @@ sub process {
                                my $a = '';
                                $a = 'V' if ($elements[$n] ne '');
                                $a = 'W' if ($elements[$n] =~ /\s$/);
+                               $a = 'C' if ($elements[$n] =~ /$;$/);
                                $a = 'B' if ($elements[$n] =~ /(\[|\()$/);
                                $a = 'O' if ($elements[$n] eq '');
                                $a = 'E' if ($elements[$n] eq '' && $n == 0);
@@ -1287,6 +1373,7 @@ sub process {
                                if (defined $elements[$n + 2]) {
                                        $c = 'V' if ($elements[$n + 2] ne '');
                                        $c = 'W' if ($elements[$n + 2] =~ /^\s/);
+                                       $c = 'C' if ($elements[$n + 2] =~ /^$;/);
                                        $c = 'B' if ($elements[$n + 2] =~ /^(\)|\]|;)/);
                                        $c = 'O' if ($elements[$n + 2] eq '');
                                        $c = 'E' if ($elements[$n + 2] =~ /\s*\\$/);
@@ -1330,13 +1417,13 @@ sub process {
                                if ($op_type ne 'V' &&
                                    $ca =~ /\s$/ && $cc =~ /^\s*,/) {
 
-                               # Ignore comments
-                               } elsif ($op =~ /^$;+$/) {
+#                              # Ignore comments
+#                              } elsif ($op =~ /^$;+$/) {
 
                                # ; should have either the end of line or a space or \ after it
                                } elsif ($op eq ';') {
-                                       if ($ctx !~ /.x[WEB]/ && $cc !~ /^\\/ &&
-                                           $cc !~ /^;/) {
+                                       if ($ctx !~ /.x[WEBC]/ &&
+                                           $cc !~ /^\\/ && $cc !~ /^;/) {
                                                ERROR("need space after that '$op' $at\n" . $hereptr);
                                        }
 
@@ -1351,7 +1438,7 @@ sub process {
 
                                # , must have a space on the right.
                                } elsif ($op eq ',') {
-                                       if ($ctx !~ /.xW|.xE/ && $cc !~ /^}/) {
+                                       if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) {
                                                ERROR("need space after that '$op' $at\n" . $hereptr);
                                        }
 
@@ -1364,7 +1451,7 @@ sub process {
                                # unary operator, or a cast
                                } elsif ($op eq '!' || $op eq '~' ||
                                         ($is_unary && ($op eq '*' || $op eq '-' || $op eq '&'))) {
-                                       if ($ctx !~ /[WEB]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) {
+                                       if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) {
                                                ERROR("need space before that '$op' $at\n" . $hereptr);
                                        }
                                        if ($ctx =~ /.xW/) {
@@ -1373,7 +1460,7 @@ sub process {
 
                                # unary ++ and unary -- are allowed no space on one side.
                                } elsif ($op eq '++' or $op eq '--') {
-                                       if ($ctx !~ /[WOB]x[^W]/ && $ctx !~ /[^W]x[WOBE]/) {
+                                       if ($ctx !~ /[WOBC]x[^W]/ && $ctx !~ /[^W]x[WOBEC]/) {
                                                ERROR("need space one side of that '$op' $at\n" . $hereptr);
                                        }
                                        if ($ctx =~ /WxB/ || ($ctx =~ /Wx./ && $cc =~ /^;/)) {
@@ -1387,13 +1474,13 @@ sub process {
                                         $op eq '*' or $op eq '/' or
                                         $op eq '%')
                                {
-                                       if ($ctx !~ /VxV|WxW|VxE|WxE|VxO/) {
+                                       if ($ctx !~ /VxV|WxW|VxE|WxE|VxO|Cx.|.xC/) {
                                                ERROR("need consistent spacing around '$op' $at\n" .
                                                        $hereptr);
                                        }
 
                                # All the others need spaces both sides.
-                               } elsif ($ctx !~ /[EW]x[WE]/) {
+                               } elsif ($ctx !~ /[EWC]x[CWE]/) {
                                        # Ignore email addresses <foo@bar>
                                        if (!($op eq '<' && $cb =~ /$;\S+\@\S+>/) &&
                                            !($op eq '>' && $cb =~ /<\S+\@\S+$;/)) {
@@ -1551,7 +1638,7 @@ sub process {
 
 # multi-statement macros should be enclosed in a do while loop, grab the
 # first statement and ensure its the whole macro if its not enclosed
-# in a known goot container
+# in a known good container
                if ($prevline =~ /\#define.*\\/ &&
                   $prevline !~/(?:do\s+{|\(\{|\{)/ &&
                   $line !~ /(?:do\s+{|\(\{|\{)/ &&
@@ -1599,84 +1686,95 @@ sub process {
 # check for redundant bracing round if etc
                if ($line =~ /(^.*)\bif\b/ && $1 !~ /else\s*$/) {
                        my ($level, $endln, @chunks) =
-                               ctx_statement_full($linenr, $realcnt, 0);
+                               ctx_statement_full($linenr, $realcnt, 1);
                        #print "chunks<$#chunks> linenr<$linenr> endln<$endln> level<$level>\n";
-                       if ($#chunks > 1 && $level == 0) {
+                       #print "APW: <<$chunks[1][0]>><<$chunks[1][1]>>\n";
+                       if ($#chunks > 0 && $level == 0) {
                                my $allowed = 0;
                                my $seen = 0;
+                               my $herectx = $here . "\n";;
+                               my $ln = $linenr - 1;
                                for my $chunk (@chunks) {
                                        my ($cond, $block) = @{$chunk};
 
+                                       $herectx .= "$rawlines[$ln]\n[...]\n";
+                                       $ln += statement_rawlines($block) - 1;
+
                                        substr($block, 0, length($cond)) = '';
 
                                        $seen++ if ($block =~ /^\s*{/);
 
-                                       $block =~ s/(^|\n)./$1/g;
-                                       $block =~ s/^\s*{//;
-                                       $block =~ s/}\s*$//;
-                                       $block =~ s/^\s*//;
-                                       $block =~ s/\s*$//;
-
-                                       my @lines = ($block =~ /\n/g);
-                                       my @statements = ($block =~ /;/g);
-
-                                       #print "cond<$cond> block<$block> lines<" . scalar(@lines) . "> statements<" . scalar(@statements) . "> seen<$seen> allowed<$allowed>\n";
-                                       if (scalar(@lines) != 0) {
+                                       #print "cond<$cond> block<$block> allowed<$allowed>\n";
+                                       if (statement_lines($cond) > 1) {
+                                               #print "APW: ALLOWED: cond<$cond>\n";
                                                $allowed = 1;
                                        }
                                        if ($block =~/\b(?:if|for|while)\b/) {
+                                               #print "APW: ALLOWED: block<$block>\n";
                                                $allowed = 1;
                                        }
-                                       if (scalar(@statements) > 1) {
+                                       if (statement_block_size($block) > 1) {
+                                               #print "APW: ALLOWED: lines block<$block>\n";
                                                $allowed = 1;
                                        }
                                }
                                if ($seen && !$allowed) {
-                                       WARN("braces {} are not necessary for any arm of this statement\n" . $herecurr);
-                                       $suppress_ifbraces = $endln;
+                                       WARN("braces {} are not necessary for any arm of this statement\n" . $herectx);
                                }
+                               # Either way we have looked over this whole
+                               # statement and said what needs to be said.
+                               $suppress_ifbraces = $endln;
                        }
                }
                if ($linenr > $suppress_ifbraces &&
                                        $line =~ /\b(if|while|for|else)\b/) {
-                       # Locate the end of the opening statement.
-                       my @control = ctx_statement($linenr, $realcnt, 0);
-                       my $nr = $linenr + (scalar(@control) - 1);
-                       my $cnt = $realcnt - (scalar(@control) - 1);
-
-                       my $off = $realcnt - $cnt;
-                       #print "$off: line<$line>end<" . $lines[$nr - 1] . ">\n";
-
-                       # If this is is a braced statement group check it
-                       if ($lines[$nr - 1] =~ /{\s*$/) {
-                               my ($lvl, @block) = ctx_block_level($nr, $cnt);
-
-                               my $stmt = join("\n", @block);
-                               # Drop the diff line leader.
-                               $stmt =~ s/\n./\n/g;
-                               # Drop the code outside the block.
-                               $stmt =~ s/(^[^{]*){\s*//;
-                               my $before = $1;
-                               $stmt =~ s/\s*}([^}]*$)//;
-                               my $after = $1;
-
-                               #print "block<" . join(' ', @block) . "><" . scalar(@block) . ">\n";
-                               #print "before<$before> stmt<$stmt> after<$after>\n\n";
-
-                               # Count the newlines, if there is only one
-                               # then the block should not have {}'s.
-                               my @lines = ($stmt =~ /\n/g);
-                               my @statements = ($stmt =~ /;/g);
-                               #print "lines<" . scalar(@lines) . ">\n";
-                               #print "statements<" . scalar(@statements) . ">\n";
-                               if ($lvl == 0 && scalar(@lines) == 0 &&
-                                   scalar(@statements) < 2 &&
-                                   $stmt !~ /{/ && $stmt !~ /\bif\b/ &&
-                                   $before !~ /}/ && $after !~ /{/) {
-                                       my $herectx = "$here\n" . join("\n", @control, @block[1 .. $#block]) . "\n";
-                                       shift(@block);
-                                       WARN("braces {} are not necessary for single statement blocks\n" . $herectx);
+                       my ($level, $endln, @chunks) =
+                               ctx_statement_full($linenr, $realcnt, $-[0]);
+
+                       my $allowed = 0;
+
+                       # Check the pre-context.
+                       if (substr($line, 0, $-[0]) =~ /(\}\s*)$/) {
+                               #print "APW: ALLOWED: pre<$1>\n";
+                               $allowed = 1;
+                       }
+                       # Check the condition.
+                       my ($cond, $block) = @{$chunks[0]};
+                       if (defined $cond) {
+                               substr($block, 0, length($cond)) = '';
+                       }
+                       if (statement_lines($cond) > 1) {
+                               #print "APW: ALLOWED: cond<$cond>\n";
+                               $allowed = 1;
+                       }
+                       if ($block =~/\b(?:if|for|while)\b/) {
+                               #print "APW: ALLOWED: block<$block>\n";
+                               $allowed = 1;
+                       }
+                       if (statement_block_size($block) > 1) {
+                               #print "APW: ALLOWED: lines block<$block>\n";
+                               $allowed = 1;
+                       }
+                       # Check the post-context.
+                       if (defined $chunks[1]) {
+                               my ($cond, $block) = @{$chunks[1]};
+                               if (defined $cond) {
+                                       substr($block, 0, length($cond)) = '';
+                               }
+                               if ($block =~ /^\s*\{/) {
+                                       #print "APW: ALLOWED: chunk-1 block<$block>\n";
+                                       $allowed = 1;
+                               }
+                       }
+                       if ($level == 0 && $block =~ /^\s*\{/ && !$allowed) {
+                               my $herectx = $here . "\n";;
+                               my $end = $linenr + statement_rawlines($block) - 1;
+
+                               for (my $ln = $linenr - 1; $ln < $end; $ln++) {
+                                       $herectx .= $rawlines[$ln] . "\n";;
                                }
+
+                               WARN("braces {} are not necessary for single statement blocks\n" . $herectx);
                        }
                }
 
@@ -1828,15 +1926,6 @@ sub process {
                print "are false positives report them to the maintainer, see\n";
                print "CHECKPATCH in MAINTAINERS.\n";
        }
-       print <<EOL if ($file == 1 && $quiet == 0);
-
-WARNING: Using --file mode. Please do not send patches to linux-kernel
-that change whole existing files if you did not significantly change most
-of the the file for other reasons anyways or just wrote the file newly
-from scratch. Pure code style patches have a significant cost in a
-quickly changing code base like Linux because they cause rejects
-with other changes.
-EOL
 
        return $clean;
 }
index 649326bf64ea37e82afe63901560f96c687a468b..78d8f92310a4651e5069c3ea32c3cbbd09f77dc9 100644 (file)
@@ -181,8 +181,7 @@ static void dummy_sb_free_security (struct super_block *sb)
        return;
 }
 
-static int dummy_sb_copy_data (struct file_system_type *type,
-                              void *orig, void *copy)
+static int dummy_sb_copy_data (char *orig, char *copy)
 {
        return 0;
 }
@@ -245,19 +244,17 @@ static void dummy_sb_post_pivotroot (struct nameidata *old_nd, struct nameidata
        return;
 }
 
-static int dummy_sb_get_mnt_opts(const struct super_block *sb, char ***mount_options,
-                                int **flags, int *num_opts)
+static int dummy_sb_get_mnt_opts(const struct super_block *sb,
+                                struct security_mnt_opts *opts)
 {
-       *mount_options = NULL;
-       *flags = NULL;
-       *num_opts = 0;
+       security_init_mnt_opts(opts);
        return 0;
 }
 
-static int dummy_sb_set_mnt_opts(struct super_block *sb, char **mount_options,
-                                int *flags, int num_opts)
+static int dummy_sb_set_mnt_opts(struct super_block *sb,
+                                struct security_mnt_opts *opts)
 {
-       if (unlikely(num_opts))
+       if (unlikely(opts->num_mnt_opts))
                return -EOPNOTSUPP;
        return 0;
 }
@@ -268,6 +265,11 @@ static void dummy_sb_clone_mnt_opts(const struct super_block *oldsb,
        return;
 }
 
+static int dummy_sb_parse_opts_str(char *options, struct security_mnt_opts *opts)
+{
+       return 0;
+}
+
 static int dummy_inode_alloc_security (struct inode *inode)
 {
        return 0;
@@ -1028,6 +1030,7 @@ void security_fixup_ops (struct security_operations *ops)
        set_to_dummy_if_null(ops, sb_get_mnt_opts);
        set_to_dummy_if_null(ops, sb_set_mnt_opts);
        set_to_dummy_if_null(ops, sb_clone_mnt_opts);
+       set_to_dummy_if_null(ops, sb_parse_opts_str);
        set_to_dummy_if_null(ops, inode_alloc_security);
        set_to_dummy_if_null(ops, inode_free_security);
        set_to_dummy_if_null(ops, inode_init_security);
index d15e56cbaadeea25c550cfc985de2dbbfbf410fa..b1387a6b416da9f85a8a8fa3114d386abc1d8757 100644 (file)
@@ -244,10 +244,11 @@ void security_sb_free(struct super_block *sb)
        security_ops->sb_free_security(sb);
 }
 
-int security_sb_copy_data(struct file_system_type *type, void *orig, void *copy)
+int security_sb_copy_data(char *orig, char *copy)
 {
-       return security_ops->sb_copy_data(type, orig, copy);
+       return security_ops->sb_copy_data(orig, copy);
 }
+EXPORT_SYMBOL(security_sb_copy_data);
 
 int security_sb_kern_mount(struct super_block *sb, void *data)
 {
@@ -306,24 +307,30 @@ void security_sb_post_pivotroot(struct nameidata *old_nd, struct nameidata *new_
 }
 
 int security_sb_get_mnt_opts(const struct super_block *sb,
-                             char ***mount_options,
-                             int **flags, int *num_opts)
+                               struct security_mnt_opts *opts)
 {
-       return security_ops->sb_get_mnt_opts(sb, mount_options, flags, num_opts);
+       return security_ops->sb_get_mnt_opts(sb, opts);
 }
 
 int security_sb_set_mnt_opts(struct super_block *sb,
-                             char **mount_options,
-                             int *flags, int num_opts)
+                               struct security_mnt_opts *opts)
 {
-       return security_ops->sb_set_mnt_opts(sb, mount_options, flags, num_opts);
+       return security_ops->sb_set_mnt_opts(sb, opts);
 }
+EXPORT_SYMBOL(security_sb_set_mnt_opts);
 
 void security_sb_clone_mnt_opts(const struct super_block *oldsb,
                                struct super_block *newsb)
 {
        security_ops->sb_clone_mnt_opts(oldsb, newsb);
 }
+EXPORT_SYMBOL(security_sb_clone_mnt_opts);
+
+int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts)
+{
+       return security_ops->sb_parse_opts_str(options, opts);
+}
+EXPORT_SYMBOL(security_sb_parse_opts_str);
 
 int security_inode_alloc(struct inode *inode)
 {
index 75c2e99bfb813a0653350bf18572d1359878dde5..4bf4807f2d44351f9a46084a21e26567e8602448 100644 (file)
@@ -443,8 +443,7 @@ out:
  * mount options, or whatever.
  */
 static int selinux_get_mnt_opts(const struct super_block *sb,
-                               char ***mount_options, int **mnt_opts_flags,
-                               int *num_opts)
+                               struct security_mnt_opts *opts)
 {
        int rc = 0, i;
        struct superblock_security_struct *sbsec = sb->s_security;
@@ -452,9 +451,7 @@ static int selinux_get_mnt_opts(const struct super_block *sb,
        u32 len;
        char tmp;
 
-       *num_opts = 0;
-       *mount_options = NULL;
-       *mnt_opts_flags = NULL;
+       security_init_mnt_opts(opts);
 
        if (!sbsec->initialized)
                return -EINVAL;
@@ -470,18 +467,18 @@ static int selinux_get_mnt_opts(const struct super_block *sb,
        /* count the number of mount options for this sb */
        for (i = 0; i < 8; i++) {
                if (tmp & 0x01)
-                       (*num_opts)++;
+                       opts->num_mnt_opts++;
                tmp >>= 1;
        }
 
-       *mount_options = kcalloc(*num_opts, sizeof(char *), GFP_ATOMIC);
-       if (!*mount_options) {
+       opts->mnt_opts = kcalloc(opts->num_mnt_opts, sizeof(char *), GFP_ATOMIC);
+       if (!opts->mnt_opts) {
                rc = -ENOMEM;
                goto out_free;
        }
 
-       *mnt_opts_flags = kcalloc(*num_opts, sizeof(int), GFP_ATOMIC);
-       if (!*mnt_opts_flags) {
+       opts->mnt_opts_flags = kcalloc(opts->num_mnt_opts, sizeof(int), GFP_ATOMIC);
+       if (!opts->mnt_opts_flags) {
                rc = -ENOMEM;
                goto out_free;
        }
@@ -491,22 +488,22 @@ static int selinux_get_mnt_opts(const struct super_block *sb,
                rc = security_sid_to_context(sbsec->sid, &context, &len);
                if (rc)
                        goto out_free;
-               (*mount_options)[i] = context;
-               (*mnt_opts_flags)[i++] = FSCONTEXT_MNT;
+               opts->mnt_opts[i] = context;
+               opts->mnt_opts_flags[i++] = FSCONTEXT_MNT;
        }
        if (sbsec->flags & CONTEXT_MNT) {
                rc = security_sid_to_context(sbsec->mntpoint_sid, &context, &len);
                if (rc)
                        goto out_free;
-               (*mount_options)[i] = context;
-               (*mnt_opts_flags)[i++] = CONTEXT_MNT;
+               opts->mnt_opts[i] = context;
+               opts->mnt_opts_flags[i++] = CONTEXT_MNT;
        }
        if (sbsec->flags & DEFCONTEXT_MNT) {
                rc = security_sid_to_context(sbsec->def_sid, &context, &len);
                if (rc)
                        goto out_free;
-               (*mount_options)[i] = context;
-               (*mnt_opts_flags)[i++] = DEFCONTEXT_MNT;
+               opts->mnt_opts[i] = context;
+               opts->mnt_opts_flags[i++] = DEFCONTEXT_MNT;
        }
        if (sbsec->flags & ROOTCONTEXT_MNT) {
                struct inode *root = sbsec->sb->s_root->d_inode;
@@ -515,24 +512,16 @@ static int selinux_get_mnt_opts(const struct super_block *sb,
                rc = security_sid_to_context(isec->sid, &context, &len);
                if (rc)
                        goto out_free;
-               (*mount_options)[i] = context;
-               (*mnt_opts_flags)[i++] = ROOTCONTEXT_MNT;
+               opts->mnt_opts[i] = context;
+               opts->mnt_opts_flags[i++] = ROOTCONTEXT_MNT;
        }
 
-       BUG_ON(i != *num_opts);
+       BUG_ON(i != opts->num_mnt_opts);
 
        return 0;
 
 out_free:
-       /* don't leak context string if security_sid_to_context had an error */
-       if (*mount_options && i)
-               for (; i > 0; i--)
-                       kfree((*mount_options)[i-1]);
-       kfree(*mount_options);
-       *mount_options = NULL;
-       kfree(*mnt_opts_flags);
-       *mnt_opts_flags = NULL;
-       *num_opts = 0;
+       security_free_mnt_opts(opts);
        return rc;
 }
 
@@ -553,12 +542,13 @@ static int bad_option(struct superblock_security_struct *sbsec, char flag,
                        return 1;
        return 0;
 }
+
 /*
  * Allow filesystems with binary mount data to explicitly set mount point
  * labeling information.
  */
-static int selinux_set_mnt_opts(struct super_block *sb, char **mount_options,
-                               int *flags, int num_opts)
+static int selinux_set_mnt_opts(struct super_block *sb,
+                               struct security_mnt_opts *opts)
 {
        int rc = 0, i;
        struct task_security_struct *tsec = current->security;
@@ -568,6 +558,9 @@ static int selinux_set_mnt_opts(struct super_block *sb, char **mount_options,
        struct inode_security_struct *root_isec = inode->i_security;
        u32 fscontext_sid = 0, context_sid = 0, rootcontext_sid = 0;
        u32 defcontext_sid = 0;
+       char **mount_options = opts->mnt_opts;
+       int *flags = opts->mnt_opts_flags;
+       int num_opts = opts->num_mnt_opts;
 
        mutex_lock(&sbsec->lock);
 
@@ -588,6 +581,21 @@ static int selinux_set_mnt_opts(struct super_block *sb, char **mount_options,
                goto out;
        }
 
+       /*
+        * Binary mount data FS will come through this function twice.  Once
+        * from an explicit call and once from the generic calls from the vfs.
+        * Since the generic VFS calls will not contain any security mount data
+        * we need to skip the double mount verification.
+        *
+        * This does open a hole in which we will not notice if the first
+        * mount using this sb set explict options and a second mount using
+        * this sb does not set any security options.  (The first options
+        * will be used for both mounts)
+        */
+       if (sbsec->initialized && (sb->s_type->fs_flags & FS_BINARY_MOUNTDATA)
+           && (num_opts == 0))
+               goto out;
+
        /*
         * parse the mount options, check if they are valid sids.
         * also check if someone is trying to mount the same sb more
@@ -792,43 +800,14 @@ static void selinux_sb_clone_mnt_opts(const struct super_block *oldsb,
        mutex_unlock(&newsbsec->lock);
 }
 
-/*
- * string mount options parsing and call set the sbsec
- */
-static int superblock_doinit(struct super_block *sb, void *data)
+int selinux_parse_opts_str(char *options, struct security_mnt_opts *opts)
 {
+       char *p;
        char *context = NULL, *defcontext = NULL;
        char *fscontext = NULL, *rootcontext = NULL;
-       int rc = 0;
-       char *p, *options = data;
-       /* selinux only know about a fixed number of mount options */
-       char *mnt_opts[NUM_SEL_MNT_OPTS];
-       int mnt_opts_flags[NUM_SEL_MNT_OPTS], num_mnt_opts = 0;
-
-       if (!data)
-               goto out;
+       int rc, num_mnt_opts = 0;
 
-       /* with the nfs patch this will become a goto out; */
-       if (sb->s_type->fs_flags & FS_BINARY_MOUNTDATA) {
-               const char *name = sb->s_type->name;
-               /* NFS we understand. */
-               if (!strcmp(name, "nfs")) {
-                       struct nfs_mount_data *d = data;
-
-                       if (d->version !=  NFS_MOUNT_VERSION)
-                               goto out;
-
-                       if (d->context[0]) {
-                               context = kstrdup(d->context, GFP_KERNEL);
-                               if (!context) {
-                                       rc = -ENOMEM;
-                                       goto out;
-                               }
-                       }
-                       goto build_flags;
-               } else
-                       goto out;
-       }
+       opts->num_mnt_opts = 0;
 
        /* Standard string-based options. */
        while ((p = strsep(&options, "|")) != NULL) {
@@ -901,26 +880,37 @@ static int superblock_doinit(struct super_block *sb, void *data)
                }
        }
 
-build_flags:
+       rc = -ENOMEM;
+       opts->mnt_opts = kcalloc(NUM_SEL_MNT_OPTS, sizeof(char *), GFP_ATOMIC);
+       if (!opts->mnt_opts)
+               goto out_err;
+
+       opts->mnt_opts_flags = kcalloc(NUM_SEL_MNT_OPTS, sizeof(int), GFP_ATOMIC);
+       if (!opts->mnt_opts_flags) {
+               kfree(opts->mnt_opts);
+               goto out_err;
+       }
+
        if (fscontext) {
-               mnt_opts[num_mnt_opts] = fscontext;
-               mnt_opts_flags[num_mnt_opts++] = FSCONTEXT_MNT;
+               opts->mnt_opts[num_mnt_opts] = fscontext;
+               opts->mnt_opts_flags[num_mnt_opts++] = FSCONTEXT_MNT;
        }
        if (context) {
-               mnt_opts[num_mnt_opts] = context;
-               mnt_opts_flags[num_mnt_opts++] = CONTEXT_MNT;
+               opts->mnt_opts[num_mnt_opts] = context;
+               opts->mnt_opts_flags[num_mnt_opts++] = CONTEXT_MNT;
        }
        if (rootcontext) {
-               mnt_opts[num_mnt_opts] = rootcontext;
-               mnt_opts_flags[num_mnt_opts++] = ROOTCONTEXT_MNT;
+               opts->mnt_opts[num_mnt_opts] = rootcontext;
+               opts->mnt_opts_flags[num_mnt_opts++] = ROOTCONTEXT_MNT;
        }
        if (defcontext) {
-               mnt_opts[num_mnt_opts] = defcontext;
-               mnt_opts_flags[num_mnt_opts++] = DEFCONTEXT_MNT;
+               opts->mnt_opts[num_mnt_opts] = defcontext;
+               opts->mnt_opts_flags[num_mnt_opts++] = DEFCONTEXT_MNT;
        }
 
-out:
-       rc = selinux_set_mnt_opts(sb, mnt_opts, mnt_opts_flags, num_mnt_opts);
+       opts->num_mnt_opts = num_mnt_opts;
+       return 0;
+
 out_err:
        kfree(context);
        kfree(defcontext);
@@ -928,6 +918,33 @@ out_err:
        kfree(rootcontext);
        return rc;
 }
+/*
+ * string mount options parsing and call set the sbsec
+ */
+static int superblock_doinit(struct super_block *sb, void *data)
+{
+       int rc = 0;
+       char *options = data;
+       struct security_mnt_opts opts;
+
+       security_init_mnt_opts(&opts);
+
+       if (!data)
+               goto out;
+
+       BUG_ON(sb->s_type->fs_flags & FS_BINARY_MOUNTDATA);
+
+       rc = selinux_parse_opts_str(options, &opts);
+       if (rc)
+               goto out_err;
+
+out:
+       rc = selinux_set_mnt_opts(sb, &opts);
+
+out_err:
+       security_free_mnt_opts(&opts);
+       return rc;
+}
 
 static inline u16 inode_mode_to_security_class(umode_t mode)
 {
@@ -2253,7 +2270,7 @@ static inline void take_selinux_option(char **to, char *from, int *first,
        }
 }
 
-static int selinux_sb_copy_data(struct file_system_type *type, void *orig, void *copy)
+static int selinux_sb_copy_data(char *orig, char *copy)
 {
        int fnosec, fsec, rc = 0;
        char *in_save, *in_curr, *in_end;
@@ -2263,12 +2280,6 @@ static int selinux_sb_copy_data(struct file_system_type *type, void *orig, void
        in_curr = orig;
        sec_curr = copy;
 
-       /* Binary mount data: just copy */
-       if (type->fs_flags & FS_BINARY_MOUNTDATA) {
-               copy_page(sec_curr, in_curr);
-               goto out;
-       }
-
        nosec = (char *)get_zeroed_page(GFP_KERNEL);
        if (!nosec) {
                rc = -ENOMEM;
@@ -5251,6 +5262,8 @@ static struct security_operations selinux_ops = {
        .sb_get_mnt_opts =              selinux_get_mnt_opts,
        .sb_set_mnt_opts =              selinux_set_mnt_opts,
        .sb_clone_mnt_opts =            selinux_sb_clone_mnt_opts,
+       .sb_parse_opts_str =            selinux_parse_opts_str,
+
 
        .inode_alloc_security =         selinux_inode_alloc_security,
        .inode_free_security =          selinux_inode_free_security,
index 837ce420d2f64ff810c4e96b7b7ce9a1ca695328..f7d2f03781f29b650d7e9bfa82822bb680b2a82d 100644 (file)
 #define POLICYDB_VERSION_MAX   POLICYDB_VERSION_POLCAP
 #endif
 
+#define CONTEXT_MNT    0x01
+#define FSCONTEXT_MNT  0x02
+#define ROOTCONTEXT_MNT        0x04
+#define DEFCONTEXT_MNT 0x08
+
 struct netlbl_lsm_secattr;
 
 extern int selinux_enabled;
index 770eb067e165f493b1e153cac3cfcec6d66953f7..0241fd359675a947def24347cbc22dd559fe314e 100644 (file)
@@ -189,17 +189,10 @@ static void smack_sb_free_security(struct super_block *sb)
  * Copy the Smack specific mount options out of the mount
  * options list.
  */
-static int smack_sb_copy_data(struct file_system_type *type, void *orig,
-                             void *smackopts)
+static int smack_sb_copy_data(char *orig, char *smackopts)
 {
        char *cp, *commap, *otheropts, *dp;
 
-       /* Binary mount data: just copy */
-       if (type->fs_flags & FS_BINARY_MOUNTDATA) {
-               copy_page(smackopts, orig);
-               return 0;
-       }
-
        otheropts = (char *)get_zeroed_page(GFP_KERNEL);
        if (otheropts == NULL)
                return -ENOMEM;
index 317f8e211cd2a136f6a07c8333731dadd0389cbe..4232fd75dd20b710a4ca16c857b80a83948f2fe9 100644 (file)
@@ -211,6 +211,10 @@ static void ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
        case IOAPIC_LOWEST_PRIORITY:
                vcpu = kvm_get_lowest_prio_vcpu(ioapic->kvm, vector,
                                deliver_bitmask);
+#ifdef CONFIG_X86
+               if (irq == 0)
+                       vcpu = ioapic->kvm->vcpus[0];
+#endif
                if (vcpu != NULL)
                        ioapic_inj_irq(ioapic, vcpu, vector,
                                       trig_mode, delivery_mode);
@@ -220,6 +224,10 @@ static void ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
                                     deliver_bitmask, vector, IOAPIC_LOWEST_PRIORITY);
                break;
        case IOAPIC_FIXED:
+#ifdef CONFIG_X86
+               if (irq == 0)
+                       deliver_bitmask = 1;
+#endif
                for (vcpu_id = 0; deliver_bitmask != 0; vcpu_id++) {
                        if (!(deliver_bitmask & (1 << vcpu_id)))
                                continue;
index 32fbf800696901866b760cef48b880a151c58399..b2e12893e3f4d4b0f39d64ff733333171e3a0dfb 100644 (file)
@@ -169,6 +169,7 @@ static struct kvm *kvm_create_vm(void)
        kvm_io_bus_init(&kvm->pio_bus);
        mutex_init(&kvm->lock);
        kvm_io_bus_init(&kvm->mmio_bus);
+       init_rwsem(&kvm->slots_lock);
        spin_lock(&kvm_lock);
        list_add(&kvm->vm_list, &vm_list);
        spin_unlock(&kvm_lock);
@@ -339,9 +340,9 @@ int kvm_set_memory_region(struct kvm *kvm,
 {
        int r;
 
-       down_write(&current->mm->mmap_sem);
+       down_write(&kvm->slots_lock);
        r = __kvm_set_memory_region(kvm, mem, user_alloc);
-       up_write(&current->mm->mmap_sem);
+       up_write(&kvm->slots_lock);
        return r;
 }
 EXPORT_SYMBOL_GPL(kvm_set_memory_region);